#include <parser-structs.h>
Static Public Member Functions | |
bool | c_rule_lt (const c_rule *t1, const c_rule *t2) |
bool | c_term_lt (const c_term *t1, const c_term *t2) |
|
A sorting function for c_rules. Answers and calls may not be mixed in the same sorting. 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. The terms are first sorted in the order "variables before functors before lists before numbers". 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 numbers the sorting is done on the value and in case of variables no sorting is done (two variables are always equal, resulting in that only one variant of a term may exist).
|