/*

Copyright © 2023-26 Sean Holden. All rights reserved.

*/
/*

This file is part of Connect++.

Connect++ is free software: you can redistribute it and/or modify it 
under the terms of the GNU General Public License as published by the 
Free Software Foundation, either version 3 of the License, or (at your 
option) any later version.

Connect++ is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 
more details.

You should have received a copy of the GNU General Public License along 
with Connect++. If not, see <https://www.gnu.org/licenses/>. 

*/

#include "Predicate.hpp"
//----------------------------------------------------------------------
string Predicate::to_string() const {
  colour_string::ColourString cs(params::use_colours);
  return cs(name).purple();
}
//----------------------------------------------------------------------
string Predicate::to_tptp_string() const {
  return name;
}
//----------------------------------------------------------------------
string Predicate::make_LaTeX() const {
  string s ("\\text{");
  s += latex_escape_characters(name);
  s += "}";
  return s;
}
//----------------------------------------------------------------------
string Predicate::make_Graphviz() const {
  return name;
}
//---------------------------------------------------------------------
bool Predicate::is_compatible_with(const Predicate& p2) const {
    return (name == p2.name) && (arity == p2.arity);
}
//---------------------------------------------------------------------
/**
* \brief Only for debugging.
*
* Use Predicate::to_string if you want something pretty. 
*/
ostream& operator<<(ostream& out, const Predicate& p) {
    out << "Predicate: " << setw(params::output_width) << p.id
        << " Name: " << setw(params::output_width + 15) << p.name
        << " Arity: " << setw(params::output_width) << p.arity;
    return out;
}
