QSpace Class Reference

Base class for a quantified space. Base class for a quantified space (with restricted quantifiers or not). The array v has to be kept up-to-date by the copy constructor of any descendant of this class. More...

#include <qecore.hh>

Inherited by Implicative.

Inheritance diagram for QSpace:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 QSpace (unsigned int nv)
 QSpace (QSpace &qs)
virtual ~QSpace ()
int nv ()
 Returns the number of variablas. returns the number of variables this quantified space contains.
virtual bool quantification (int v)=0
 Returns a variable quantificaion. Returns wether a variable is quantified existentially (false) or universally (true).
virtual int status (int var, unsigned long int &propsteps)=0
 Returns the current partial status of the quantified space. Returns the current status of the quantified space, but limits the computation of this status at the variable given in parameter. So, this method will return "don't know" more often than a complete status computation. Returns 1 for "true", 0 for "false", and -1 for "Don't know, try a next variable". A "Don't know" answer while all the variables have been assigned can be considered as a "true".
virtual int finalStatus (unsigned long int &propsteps)=0
 Returns the thuth value of a completely assigned problem. Performs the last checks to return in a complete way the truth value of the problem. All non-subsumes variables must be assigned for this method to be correct.
virtual bool subsumed (int var)=0
 Returns wether a variable is subsumed or not. A variable is subsumed if it is assigned or it is bound by no more constraint. The answer must be correct, but not complete (so, a "not sure" must return False for the solver to remain correct.
virtual QSpaceclone ()=0
virtual void assign (int var, int **vals, int nbVals)=0
 Assigns a value to a variable. assigns a value to a variable. Only this method will be used by the search engine.
virtual void remove (int var, int **vals, int nbVals)=0
virtual void backtrack ()=0
 Method called when the solver backtracks to this quantified space. This method is useful to indicate some new information to the branchong heuristic, like simply updating the scores.
virtual void indicateBranchingHeuristic (BranchingHeuristic *bh)=0
 Indicates the branching heuristic to be used when performing search. Indicates the branching heuristic to be used when performing search. This method is typically invoked by the solver at its construction.
virtual void print ()=0
 Print the space details to the default output.

Public Attributes

IntVarArgs v
 Array of the variables of the quantified space. This array contains all the variables of the quantified space (with current domain).

Protected Attributes

unsigned int n
unsigned long int ps

Detailed Description

Base class for a quantified space. Base class for a quantified space (with restricted quantifiers or not). The array v has to be kept up-to-date by the copy constructor of any descendant of this class.

Definition at line 47 of file qecore.hh.


Constructor & Destructor Documentation

QSpace::QSpace ( unsigned int  nv  ) 

Constructor for a new quantified space with n variables.

Definition at line 28 of file qecore.cc.

References n.

QSpace::QSpace ( QSpace qs  ) 

Copy constructor.

Definition at line 32 of file qecore.cc.

References n, ps, and v.

virtual QSpace::~QSpace (  )  [inline, virtual]

Definition at line 60 of file qecore.hh.


Member Function Documentation

int QSpace::nv (  )  [inline]

Returns the number of variablas. returns the number of variables this quantified space contains.

Definition at line 66 of file qecore.hh.

References n.

Referenced by BranchingHeuristic::BranchingHeuristic(), Implicative::print(), and QSolver::QSolver().

virtual bool QSpace::quantification ( int  v  )  [pure virtual]

Returns a variable quantificaion. Returns wether a variable is quantified existentially (false) or universally (true).

Parameters:
v The variable number.

Implemented in Implicative.

Referenced by BranchingHeuristic::BranchingHeuristic().

virtual int QSpace::status ( int  var,
unsigned long int &  propsteps 
) [pure virtual]

Returns the current partial status of the quantified space. Returns the current status of the quantified space, but limits the computation of this status at the variable given in parameter. So, this method will return "don't know" more often than a complete status computation. Returns 1 for "true", 0 for "false", and -1 for "Don't know, try a next variable". A "Don't know" answer while all the variables have been assigned can be considered as a "true".

Parameters:
var The number of the variable to compute the status around.
propsteps Will be increased by the number of propagation steps performed (for statistical purposes).

Implemented in Implicative.

Referenced by QSolver::rSolve(), and QSolver::solve().

virtual int QSpace::finalStatus ( unsigned long int &  propsteps  )  [pure virtual]

Returns the thuth value of a completely assigned problem. Performs the last checks to return in a complete way the truth value of the problem. All non-subsumes variables must be assigned for this method to be correct.

Parameters:
propsteps Will be increased by the number of propagation steps performed (for statistical purposes).

Implemented in Implicative.

Referenced by QSolver::rSolve().

virtual bool QSpace::subsumed ( int  var  )  [pure virtual]

Returns wether a variable is subsumed or not. A variable is subsumed if it is assigned or it is bound by no more constraint. The answer must be correct, but not complete (so, a "not sure" must return False for the solver to remain correct.

Parameters:
var The variable number.

Implemented in Implicative.

Referenced by BranchingHeuristic::nextVar().

virtual QSpace* QSpace::clone (  )  [pure virtual]

Returns a clone of the quantified space (possibly after a propagation call)

Implemented in Implicative.

Referenced by QSolver::rSolve().

virtual void QSpace::assign ( int  var,
int **  vals,
int  nbVals 
) [pure virtual]

Assigns a value to a variable. assigns a value to a variable. Only this method will be used by the search engine.

Parameters:
var The number of the variable to assign.
val The value to assign to this variable.

Implemented in Implicative.

Referenced by QSolver::rSolve().

virtual void QSpace::remove ( int  var,
int **  vals,
int  nbVals 
) [pure virtual]

Implemented in Implicative.

Referenced by QSolver::rSolve().

virtual void QSpace::backtrack (  )  [pure virtual]

Method called when the solver backtracks to this quantified space. This method is useful to indicate some new information to the branchong heuristic, like simply updating the scores.

Implemented in Implicative.

Referenced by QSolver::rSolve().

virtual void QSpace::indicateBranchingHeuristic ( BranchingHeuristic bh  )  [pure virtual]

Indicates the branching heuristic to be used when performing search. Indicates the branching heuristic to be used when performing search. This method is typically invoked by the solver at its construction.

Implemented in Implicative.

Referenced by QSolver::QSolver().

virtual void QSpace::print (  )  [pure virtual]

Print the space details to the default output.

Implemented in Implicative.

Referenced by QSolver::rSolve().


Member Data Documentation

unsigned int QSpace::n [protected]

Definition at line 49 of file qecore.hh.

Referenced by Implicative::Implicative(), nv(), and QSpace().

unsigned long int QSpace::ps [protected]

Definition at line 50 of file qecore.hh.

Referenced by QSpace().

IntVarArgs QSpace::v

Array of the variables of the quantified space. This array contains all the variables of the quantified space (with current domain).

Definition at line 72 of file qecore.hh.

Referenced by Implicative::cascade(), Implicative::Implicative(), Implicative::makeStructure(), Implicative::print(), Implicative::QBoolVar(), Implicative::QIntVar(), QSpace(), sdf::score(), and Implicative::subsumed().


The documentation for this class was generated from the following files:
Generated on Fri Sep 21 16:36:42 2007 for qecode by  doxygen 1.5.2