Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

c_sorter Struct Reference

#include <parser-structs.h>

List of all members.

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)


Detailed Description

This class acts as sorting functions for c_terms and c_rules.


Member Function Documentation

bool c_sorter::c_rule_lt const c_rule t1,
const c_rule t2
[static]
 

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.

Parameters:
t1 the left hand rule.
t2 the right hand rule.
Returns:
Is t1 sorted before t2?

bool c_sorter::c_term_lt const c_term t1,
const c_term t2
[static]
 

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

Parameters:
t1 the left hand term
t2 the right hand term
Returns:
Is t1 sorted before t2?


The documentation for this struct was generated from the following files:
Generated on Wed Feb 16 20:54:21 2005 for Fixpoint Engine by  doxygen 1.3.9.1