#include <parser-classes.hpp>
Static Public Member Functions | |
bool | c_rule_lt (const c_rule *c1, const c_rule *c2) |
bool | c_term_lt (const c_term *c1, const c_term *c2) |
Static Private Member Functions | |
int | c_term_order (const c_term *c1, const c_term *c2) |
int | c_rule_order (const c_rule *c1, const c_rule *c2) |
|
A sorting function for c_rules. Answers and calls may not be mixed in the same sorting. This function merely calls c_term_order to check if the order was "c1 before c2".
|
|
Determines the order of two rules. In case of two answers, the one with the least head (by c_term_lt) is preferred. In case of two calls, they are primarily sorted recursively on body literals, secondarily on body length and tertiarily on the head. All term sorting is done through c_term_lt.
|
|
A sorting function for c_terms. This function merely calls c_term_order to check if the order was "c1 before c2".
|
|
Determines the order of two terms. The terms are first sorted in the order "variables before functors before lists". After that, they are sorted on (in case of functors) primarily on functor name, secondarily recursively on arguments and tertially on negatedness. In case of lists, the terms are sorted recursively on the list elements, shortest list first. In case of variables no sorting is done (two variables are always equal, resulting in that only one variant of a term may exist).
|