[SLP-Homepage]
[Source Modules]
[Manual]
[Run]
[Examples]
Argument (List) of Ground Literal
This module defines a class garg_c.
The objects of this class correspond to argument terms
in ground literals (used in conditional facts).
Each argument term has a "next" link (pointer to another argument term),
so objects of this class are really lists of argument terms.
I earlier always had separate classes for things and lists of things,
but that only complicated the code.
However,
in this case arguments of ground literals are really constants,
and there is a separate class for constants
cnst
(because constants appear also in other contexts).
Ground argument terms,
i.e. constants
can be symbolic constants/atoms or integers.
Construction:
- garg_c:
-
garg_c(cnst_t cnst)
;
This method creates a new ground argument term
out of a given constant.
The "next" pointer will be NIL.
Object Methods:
- get_cnst:
-
cnst_t get_cnst(void) const
;
This method returns the constant
of this ground argument term.
- get_next:
-
garg_c* get_next(void) const
;
This method returns the next argument term
of the enclosing ground literal
(or NIL if there is none).
- set_next:
-
void set_next(garg_c* next)
;
This method sets the link to the next argument term
to the given value.
It can only be called if the "next" pointer in this object
is currently NIL,
i.e. if this object is currently the last argument term.
- print_list:
-
void print_list(void) const
;
This method prints the lists of argument terms (constants),
separated by commas.
Implementation:
Stefan Brass
(sbrass@sis.pitt.edu),
October 11, 2001.
[HTML 3.2 Checked]