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

c_rule Class Reference

#include <parser-classes.hpp>

Inheritance diagram for c_rule:

Inheritance graph
[legend]
Collaboration diagram for c_rule:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 c_rule ()
 ~c_rule ()
void deep_delete ()
void deep_copy (c_rule *copy, bool reindex=false) const
void project_constraint () const
void get_variables (std::set< std::string > &vars) const
void sort_before (const c_rule *r) const
void sort_same (const c_rule *r) const

Public Attributes

c_termhead
std::vector< c_term * > body
std::map< const c_rule *,
int > 
sorted_rules
con_type constraint

Static Public Attributes

int global_variable_index = 0
int count = 0

Detailed Description

This class represents a CLP rule, holding a head, an associated constraint and zero or more body literals.


Constructor & Destructor Documentation

c_rule::c_rule  ) 
 

Default constructor. Creates a head.

c_rule::~c_rule  ) 
 

Destructor.


Member Function Documentation

void c_rule::deep_copy c_rule copy,
bool  reindex = false
const
 

Copy this c_rule recursively into another c_rule.

Parameters:
copy allocated memory area for another rule.
reindex should variables be reindexed?

void c_rule::deep_delete  )  [virtual]
 

Calls delete on the head and body recursively. Note that this should NOT be done when the rule contains term that wasn't created using deep_copy during safety mode off.

Implements c_base.

void c_rule::get_variables std::set< std::string > &  vars  )  const
 

Inserts the variables names used in this rule into the supplied set of strings.

void c_rule::project_constraint  )  const
 

Project the constraint in this rule to the variables used somewhere in the rule.

void c_rule::sort_before const c_rule r  )  const
 

Mark this rule as sorted before another rule.

Parameters:
r the other rule.

void c_rule::sort_same const c_rule r  )  const
 

Mark this rule as sorted at the same place as another rule.

Parameters:
r the other rule.


Member Data Documentation

std::vector<c_term*> c_rule::body
 

The body literals of this rule (none if it is an answer). All of these literals are of type T_FUNCTOR.

con_type c_rule::constraint [mutable]
 

The constraint of this rule.

int c_rule::count = 0 [static]
 

The number of c_rule instances allocated and not destroyed.

int c_rule::global_variable_index = 0 [static]
 

The index for variables in a new rule instance, increased by 1 for every rule instance.

c_term* c_rule::head
 

The head of this rule, is of type T_FUNCTOR and isn't negated.

std::map<const c_rule*, int> c_rule::sorted_rules [mutable]
 

Cached orderings between this rule and others.


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