AMulet 2.0
AIG Multiplier Verification Tool
Term Class Reference

#include <term.h>

Collaboration diagram for Term:

Public Member Functions

 Term (const Var *_v, Term *_r, uint64_t _hash, Term *_n)
 
const Varget_var () const
 
int get_var_level () const
 
int get_var_num () const
 
const char * get_var_name () const
 
Termget_rest () const
 
uint64_t get_hash () const
 
Termget_next () const
 
void set_next (Term *t)
 
uint64_t get_ref () const
 
uint64_t inc_ref ()
 
uint64_t dec_ref ()
 
Termcopy ()
 
void print (FILE *file) const
 
unsigned size () const
 
int cmp (const Term *t) const
 
bool contains (const Var *v) const
 

Private Attributes

const Varvariable
 head variable More...
 
Termrest
 tail in linked list More...
 
uint64_t ref
 reference counter More...
 
const uint64_t hash
 hash value More...
 
Termnext
 hash collision chain link More...
 

Detailed Description

This class is used to represent terms in a polynomial. Terms are represented as ordered linked lists of variables.

Constructor & Destructor Documentation

Term::Term ( const Var _v,
Term _r,
uint64_t  _hash,
Term _n 
)

Constructor

Parameters
_vVar*
_rTerm*
_hashuint64_t
_nTerm*

Member Function Documentation

int Term::cmp ( const Term t) const

Compares this term to term t using the levels of the variables

Parameters
tTerm*
Returns
+1 if this > t -1 if this < t 0 if this = t
bool Term::contains ( const Var v) const

Checks whether v is contained in Term

Parameters
vVar*
Returns
true if v is contained in term
Term * Term::copy ( )

Copy routine

Returns
A copy of the current term
uint64_t Term::dec_ref ( )
inline

Decreases ref

Returns
uint64_t
uint64_t Term::get_hash ( ) const
inline

Getter for member hash

Returns
uint64_t
Term* Term::get_next ( ) const
inline

Getter for member next

Returns
Term*
uint64_t Term::get_ref ( ) const
inline

Getter for member ref

Returns
uint64_t
Term* Term::get_rest ( ) const
inline

Getter for member rest

Returns
Term*
const Var* Term::get_var ( ) const
inline

Getter for member variable

Returns
Var*
int Term::get_var_level ( ) const
inline

Getter for level of variable

Returns
integer
const char* Term::get_var_name ( ) const
inline

Getter for name of variable

Returns
char*
int Term::get_var_num ( ) const
inline

Getter for num of variable

Returns
integer
uint64_t Term::inc_ref ( )
inline

Increases ref

Returns
uint64_t
void Term::print ( FILE *  file) const

Printing routine

Parameters
fileOutput file
void Term::set_next ( Term t)
inline

Setter for member term

Parameters
tTerm*
unsigned Term::size ( ) const

Returns the number of variables in a term

Returns
unsigned integer

Member Data Documentation

const uint64_t Term::hash
private

hash value

Term* Term::next
private

hash collision chain link

uint64_t Term::ref
private

reference counter

Term* Term::rest
private

tail in linked list

const Var* Term::variable
private

head variable


The documentation for this class was generated from the following files: