[SLP-Homepage]    [Source Modules]    [Manual]    [Run]    [Examples]
 

Argument List of a Literal in a Rule

This module defines a class rargs_c. The objects of this class correspond to lists of argument terms in a rule. As usual, each object is a pair of head and tail, not really an entire list (tail is the "next"-pointer, i.e. a reference to another rargs_c-object).


Construction:

rargs_c:
rargs_c(rarg_t head);
This method creates a new list of argument terms out of a given element (a single argument term). The given element will be the head of the list, the tail will be empty (NIL).


Object Methods:

get_head:
rarg_t get_head(void) const;
This method returns the first term in the list.
get_tail:
rargs_c* get_tail(void) const;
This method returns the rest of the list (all terms except the first one).
append:
void append(rargs_c* tail);
This method sets the tail of the list to the given value. It can only be called if the tail is currently NIL, i.e. if this is the last list element.
print:
void print(rvars_t vars) const;
This method prints the lists of terms (separated by commas). Since the rarg_c objects for the terms contain only the variable offsets, the list of variables in the rule is needed in order to print the variable names.


Implementation:


Stefan Brass (sbrass@sis.pitt.edu), September 27, 2001.    [HTML 3.2 Checked]