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

c_sorter Class Reference

#include <parser-classes.hpp>

List of all members.

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)


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 c1,
const c_rule c2
[static]
 

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

Parameters:
c1 the left hand rule.
c2 the right hand rule.
Returns:
Is c1 sorted before c2?

int c_sorter::c_rule_order const c_rule c1,
const c_rule c2
[static, private]
 

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.

Parameters:
c1 the left hand rule.
c2 the right hand rule.
Returns:
-1 iff c1 < c2, 0 iff c1 = c2 or 1 iff c1 > c2

bool c_sorter::c_term_lt const c_term c1,
const c_term c2
[static]
 

A sorting function for c_terms.

This function merely calls c_term_order to check if the order was "c1 before c2".

Parameters:
c1 the left hand term
c2 the right hand term
Returns:
Is c1 sorted before c2?

int c_sorter::c_term_order const c_term c1,
const c_term c2
[static, private]
 

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

Parameters:
c1 the left hand term.
c2 the right hand term.
Returns:
-1 iff c1 < c2, 0 iff c1 = c2 or 1 iff c1 > c2


The documentation for this class was generated from the following files:
Generated on Mon Mar 21 00:08:19 2005 for Fixpoint Engine by  doxygen 1.3.9.1