Main Page   Class Hierarchy   Compound List   File List   Contact   Download   Symbolic Constraints   Examples  

SCIL::boolfunction Class Reference

Boolean functions. More...

#include <boolfunction.h>

Collaboration diagram for SCIL::boolfunction:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 boolfunction (var _v, bool _negated=false)
 Creates a boolfunction consisting of only one basic variable.
 boolfunction (var _v1, var _v2, boolOperator _op, bool _negated=false)
 Creates a boolfunction (v1 op v2).
 boolfunction (boolfunction *_left, var _v2, boolOperator _op, bool _negated=false)
 Creates a boolfunction (left op v2).
 boolfunction (var _v1, boolfunction *_right, boolOperator _op, bool _negated=false)
 Creates a boolfunction (v1 op right).
 boolfunction (boolfunction *_left, boolfunction *_right, boolOperator _op, bool _negated=false)
 Creates a boolfunction (left op right).
boolfunctioncopy ()
 Creates a copy of the boolfunction and returns a pointer to that copy.
row get_rLinear () const
 Returns the linearization row.
boolfunctionget_left () const
 Returns a pointer to the left operand.
boolfunctionget_right () const
 Returns a pointer to the right operand.
var get_v () const
 Returns the variable v The basic variable v is only set if op is BASIC.
boolOperator get_op () const
 Returns the operator of the boolfunction.
bool is_negated () const
 Returns true if the boolfunction is negated.
void negate ()
 Negates the boolfunction.
void add (boolOperator _op, var _v, bool negated=false)
 Adds v to the right-hand side of the boolfunction using operator op.
void add (var _v, boolOperator _op, bool negated=false)
 Adds v to the left-hand side of the boolfunction using operator op.
void add (boolfunction *_left, boolOperator _op, bool negated=false)
 Adds the boolfunction left to the left-hand side of the boolfunction using operator op.
void add (boolOperator _op, boolfunction *_right, bool negated=false)
 Adds the boolfunction right to the right-hand side of the boolfunction using operator op.
varlinearize (ILP_Problem &IP)
 Linearizes the boolfunction and creates the linearization variable which is stored in rLinear.
void simplify ()
 Simplifies the boolfunction.
bool evaluate (solution &S)
 Evaluates the boolfunction based on Solution S.
std::string get_originalTerm ()
 Returns the original term stored by simplify.
std::string toString ()
 Converts the boolfunction to a string.
bool isHomogeneous (boolOperator _op=BASIC)
std::vector< varget_vars ()
 Returns a vector of all contained variables in the boolfunction.

Friends

class bool_inst

Detailed Description

The class boolfunction represents a Boolean function which is basically composed of a left and right operand and the associated operator. The two operands are also boolfunctions and therefore a boolfunction may also consist of only one basic variable.

Boolfunctions may only be used with pointers because of their tree structure.

Definition at line 17 of file boolfunction.h.


Member Function Documentation

bool SCIL::boolfunction::isHomogeneous ( boolOperator  _op = BASIC  ) 

Returns true if every operator in the boolfunction is of the same type and is one of AND, OR, NAND or NOR

void SCIL::boolfunction::simplify (  ) 

Reformulates the boolfunction to a term without any negations, exclusive disjunctions and equivalences. The original term is stored as a string in the private attribute originalTerm.

Referenced by SCIL::ILP_Problem::add_boolfunction().


The documentation for this class was generated from the following file:
Generated on Mon Mar 28 22:03:53 2011 for SCIL by  doxygen 1.6.3