<< Prev | - Up - |
OZ_CtVar
The constraint system dependent part of a class derived from OZ_CtVar
stores typically
a constraint C
, i. e., an instance of the class representing a constraint,
a reference to a constraint CR
, and
a constraint profile CP
.
The constraint C
is used either to encapsulate propagation (for reified constraints) or to handle constraints of global variables properly. The reference to a constraint CR
is used to access the actual constraint and thus to be able to modify it. It either points to C
or directly to the constraint associated with a constrained variable.
ctSetValue
[member function pure virtual]
virtual void ctSetValue(OZ_Term t) = 0;
Initializes C
to the value denoted by t
and makes CR
pointing to C
.
ctRefConstraint
[member function pure virtual]
virtual OZ_Ct * ctRefConstraint(OZ_Ct * c) = 0;
Set CR
to c
and returns CR
.
ctSaveConstraint
[member function pure virtual]
virtual OZ_Ct * ctSaveConstraint(OZ_Ct * c) = 0;
Stores c
in C
and returns c
.
ctRestoreConstraint
[member function pure virtual]
virtual void ctRestoreConstraint(void) = 0;
Stores C
at *CR
.
ctSetConstraintProfile
[member function pure virtual]
virtual void ctSetConstraintProfile(void) = 0;
Initializes CP
with the profile of CR
.
ctGetConstraintProfile
[member function pure virtual]
virtual OZ_CtProfile * ctGetConstraintProfile(void) = 0;
Returns CP
.
ctGetConstraint
[member function pure virtual]
virtual OZ_Ct * ctGetConstraint(void) = 0;
Returns CR
.
isTouched
[member function pure virtual]
virtual OZ_Boolean isTouched(void) const = 0;
Returns OZ_True
if current constraint is not implied anymore by the constraint that was present upon calling read()
or readEncap()
.
OZ_CtVar
[constructor]
OZ_CtVar(void);
Initializes an instance of this class.
operator new
[static operator member function]
static void * operator new(size_t);
Allocates memory for an instance of a class derived from OZ_CtVar
on the propagator heap of the Oz runtime system.
operator delete
[static operator member function]
static void operator delete(void *, size_t);
Deallocates memory of an instance of a class derived from OZ_CtVar
from the propagator heap of the Oz runtime system.
operator new[]
[static operator member function]
static void * operator new[](size_t);
Allocates memory for an array of instances of a class derived from OZ_CtVar
on the propagator heap of the Oz runtime system.
operator delete[]
[static operator member function]
static void operator delete[](void *, size_t);
Deallocates memory of an array of instances of a class derived from OZ_CtVar
from the propagator heap of the Oz runtime system.
ask
[member function]
void ask(OZ_Term);
Initializes an instance of a derived class of OZ_CtVar
for reading the constraint of the corresponding variable. The members leave()
and fail()
must not be called.
read
[member function]
void read(OZ_Term);
Initializes an instance of a derived class of OZ_CtVar
for accessing the corresponding variable in the constraint store for constraint propagation. Modifying the constraint is visible in the store. The members leave()
and fail()
must be called.
readEncap
[member function]
void readEncap(OZ_Term);
Initializes an instance of a derived class of OZ_CtVar
for accessing the corresponding variable in the constraint store for encapsulated constraint propagation (typically used for reified constraints). Modifying the constraint is not visible in the store. The members leave()
and fail()
must be called.
leave
[member function]
OZ_Boolean leave(void);
This member function has to be called if the instance of a derived class of OZ_CtVar
has been initialized by read()
resp. readEncap()
and the constraint represented by the propagator is consistent with the constraint store. It returns OZ_False
if the corresponding variable denotes a value. Otherwise it returns OZ_True
. Further, this member function causes suspending computation to be woken up.
fail
[member function]
void fail(void);
This member function has to be called if the instance of a derived class of OZ_CtVar
has been initialized by read()
resp. readEncap()
and the constraint represented by the propagator is inconsistent with the constraint store.
<< Prev | - Up - |