/*

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/>. 

*/

#ifndef CLAUSE_COMPARISONS_HPP
#define CLAUSE_COMPARISONS_HPP

#include "Clause.hpp"

using ClauseRoleName = pair<Clause, pair<string, string>>;

/**
* \brief Provide a function object to compare clauses by size.
*
* As clause roles always get re-ordered with clauses this 
* actually acts on pairs. 
*/
struct ClauseLengthCompare {
    bool operator()(const ClauseRoleName& c1, 
                    const ClauseRoleName& c2) const {
        return (std::get<0>(c1).size() < std::get<0>(c2).size());
    }
};

#endif