AMulet 2.0
AIG Multiplier Verification Tool
Gate Class Reference

#include <gate.h>

Collaboration diagram for Gate:

Public Member Functions

 Gate (int n_, std::string name_, int level_, bool input_=0, bool output_=0)
 
const Varget_var () const
 
int get_var_num () const
 
const char * get_var_name () const
 
bool get_input () const
 
bool get_output () const
 
bool get_pp () const
 
void mark_pp ()
 
bool get_aig_output () const
 
void mark_aig_output ()
 
int get_level () const
 
void set_level (int l)
 
bool get_xor_chain () const
 
void mark_xor_chain ()
 
int get_xor_gate () const
 
void set_xor_gate (int val)
 
int get_carry_gate () const
 
void set_carry_gate (int val)
 
void inc_carry_gate ()
 
void dec_carry_gate ()
 
int get_slice () const
 
void set_slice (int val)
 
void inc_slice ()
 
void dec_slice ()
 
bool get_prop_gen_gate () const
 
void mark_prop_gen_gate ()
 
void unmark_prop_gen_gate ()
 
bool get_fsa () const
 
void mark_fsa ()
 
int get_fsa_inp () const
 
void inc_fsa_inp ()
 
void reset_fsa_inp ()
 
bool get_neg () const
 
void set_neg (bool val)
 
bool get_moved () const
 
void mark_moved ()
 
bool get_bo () const
 
void mark_bo ()
 
bool get_elim () const
 
void mark_elim ()
 
Polynomialget_gate_constraint () const
 
void set_gate_constraint (Polynomial *p)
 
void print_gate_constraint (FILE *file) const
 
Polynomialget_cofactor () const
 
void set_cofactor (Polynomial *p)
 
std::map< Gate *, Polynomial * >::const_iterator anc_begin () const
 
std::map< Gate *, Polynomial * >::const_iterator anc_end () const
 
std::map< Gate *, Polynomial * >::iterator search_in_anc (Gate *n)
 
void set_ancestor (Gate *n, Polynomial *p)
 
std::list< Gate * >::const_iterator parents_begin () const
 
std::list< Gate * >::const_iterator parents_end () const
 
size_t parents_size () const
 
Gateparents_front () const
 
void parents_push_back (Gate *n)
 
void parents_remove (Gate *n)
 
std::list< Gate * >::const_iterator children_begin () const
 
std::list< Gate * >::const_iterator children_end () const
 
size_t children_size () const
 
Gatechildren_front () const
 
Gatechildren_back () const
 
void set_children_front (Gate *n)
 
void set_children_back (Gate *n)
 
void children_push_back (Gate *n)
 
void children_remove (Gate *n)
 
bool orig () const
 
 ~Gate ()
 
bool is_in_parents (const Gate *n) const
 
bool is_child (const Gate *n) const
 

Private Attributes

const Varv
 Variable of the gate, as used in the polynomials. More...
 
bool input
 True if gate is an input. More...
 
bool output
 True if the gate is an output s_i. More...
 
bool aig_output = 0
 True if the gate is an output in the aig. More...
 
bool partial_product = 0
 True if gate is identified as a partial product. More...
 
int level = 0
 Distance to inputs. More...
 
bool xor_chain = 0
 True if gate belongs to xor_chain in last slice. More...
 
int xor_gate = 0
 is set to 1 for root node, 2 for internal nodes of XORs More...
 
int carry_gate = 0
 Counts how often gate is used in bigger slice. More...
 
int slice = -1
 slice a gate is attached to More...
 
bool prop_gen_gate = 0
 True if circuit is a prop_gen_gate (-substitute) More...
 
bool fsa = 0
 True if gate is identified to belong to complex fsa (-substitute) More...
 
int fsa_inp = 0
 True if gate is input of complex fsa (-substitute) More...
 
bool neg = 0
 True if gate occurs negative (-substitute) More...
 
bool moved = 0
 True if gate has been moved during fix_xors. More...
 
bool bo = 0
 True if gate is identified to belong to booth pattern. More...
 
bool elim = 0
 True if gate is eliminated during preprocessing. More...
 
Polynomialgate_constraint = 0
 Polynomial implied by the aig gate. More...
 
Polynomialco_factor = 0
 Polynomial generated as co-factor for nss proofs (-certify) More...
 
std::map< Gate *, Polynomial * > ancestors
 Used to store all dependencies in nss proofs (-certify) More...
 
std::list< Gate * > parents
 list of gates that are parents More...
 
std::list< Gate * > children
 list of gates that are children More...
 

Detailed Description

Internal structure to represent the AIG graph.

Constructor & Destructor Documentation

Gate::Gate ( int  n_,
std::string  name_,
int  level_,
bool  input_ = 0,
bool  output_ = 0 
)

Constructor Calls constructor of Var

Parameters
n_value, corresponding to aiger value
name_string name of the variable
levelposition in order of the variable
Gate::~Gate ( )

Destructor

Member Function Documentation

std::map<Gate*, Polynomial*>::const_iterator Gate::anc_begin ( ) const
inline

Getter for begin of ancestors

Returns
std::map<Gate*, Polynomial*>::const_iterator
std::map<Gate*, Polynomial*>::const_iterator Gate::anc_end ( ) const
inline

Getter for end of ancestors

Returns
std::map<Gate*, Polynomial*>::const_iterator
Gate* Gate::children_back ( ) const
inline

Getter for back of children

Returns
Gate*
std::list<Gate*>::const_iterator Gate::children_begin ( ) const
inline

Getter for begin of children

Returns
std::list<Gate*>::const_iterator
std::list<Gate*>::const_iterator Gate::children_end ( ) const
inline

Getter for end of children

Returns
std::list<Gate*>::const_iterator
Gate* Gate::children_front ( ) const
inline

Getter for front of children

Returns
Gate*
void Gate::children_push_back ( Gate n)
inline

Appends gate n to the children

Parameters
nGate*
void Gate::children_remove ( Gate n)
inline

Removes gate n from the children

Parameters
nGate*
size_t Gate::children_size ( ) const
inline

Getter for size of children

Returns
size_t
void Gate::dec_carry_gate ( )
inline

Decreases carry_gate

void Gate::dec_slice ( )
inline

Decreases slice

bool Gate::get_aig_output ( ) const
inline

Getter for aig_output

Returns
member aig_output
bool Gate::get_bo ( ) const
inline

Getter for bo

Returns
member bo
int Gate::get_carry_gate ( ) const
inline

Getter for carry_gate

Returns
member carry_gate
Polynomial* Gate::get_cofactor ( ) const
inline

Getter for co_factor

Returns
member co_factor
bool Gate::get_elim ( ) const
inline

Getter for elim

Returns
member elim
bool Gate::get_fsa ( ) const
inline

Getter for fsa

Returns
member fsa
int Gate::get_fsa_inp ( ) const
inline

Getter for fsa_inp

Returns
member fsa_inp
Polynomial* Gate::get_gate_constraint ( ) const
inline

Getter for gate_constraint

Returns
member gate_constraint
bool Gate::get_input ( ) const
inline

Getter for input

Returns
member input
int Gate::get_level ( ) const
inline

Getter for level

Returns
member level
bool Gate::get_moved ( ) const
inline

Getter for moved

Returns
member moved
bool Gate::get_neg ( ) const
inline

Getter for neg

Returns
member neg
bool Gate::get_output ( ) const
inline

Getter for output

Returns
member output
bool Gate::get_pp ( ) const
inline

Getter for partial_product

Returns
member partial_product
bool Gate::get_prop_gen_gate ( ) const
inline

Getter for prop_gen_gate

Returns
member prop_gen_gate
int Gate::get_slice ( ) const
inline

Getter for slice

Returns
member slice
const Var* Gate::get_var ( ) const
inline

Getter for v

Returns
member v
const char* Gate::get_var_name ( ) const
inline

Getter for name of v

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

Getter for number of v

Returns
integer
bool Gate::get_xor_chain ( ) const
inline

Getter for xor_chain

Returns
member xor_chain
int Gate::get_xor_gate ( ) const
inline

Getter for xor_gate

Returns
member xor_gate
void Gate::inc_carry_gate ( )
inline

Increases carry_gate

void Gate::inc_fsa_inp ( )
inline

Increases fsa_inp

void Gate::inc_slice ( )
inline

Increases slice

bool Gate::is_child ( const Gate n) const

Determines whether n is contained in the children of this gate

Parameters
nGate*
Returns
True whether n is child of this gate
bool Gate::is_in_parents ( const Gate n) const

Determines whether n is contained in the parents of this gate

Parameters
nGate*
Returns
True whether n is parent of this gate
void Gate::mark_aig_output ( )
inline

Sets aig_output to true

void Gate::mark_bo ( )
inline

Sets bo to true

void Gate::mark_elim ( )
inline

Sets elim to true

void Gate::mark_fsa ( )
inline

Sets fsa to true

void Gate::mark_moved ( )
inline

Sets moved to true

void Gate::mark_pp ( )
inline

Sets partial_product to true

void Gate::mark_prop_gen_gate ( )
inline

Sets prop_gen_gate to true

void Gate::mark_xor_chain ( )
inline

Sets xor_chain to true

bool Gate::orig ( ) const

Determines whether gate constraint is original

Returns
True if ancestors are empty, i.e., polynomial has not been reduced
std::list<Gate*>::const_iterator Gate::parents_begin ( ) const
inline

Getter for begin of parents

Returns
std::list<Gate*>::const_iterator
std::list<Gate*>::const_iterator Gate::parents_end ( ) const
inline

Getter for end of parents

Returns
std::list<Gate*>::const_iterator
Gate* Gate::parents_front ( ) const
inline

Getter for front of parents

Returns
Gate*
void Gate::parents_push_back ( Gate n)
inline

Appends gate n to the parents

Parameters
nGate*
void Gate::parents_remove ( Gate n)
inline

Removes gate n from the parents

Parameters
nGate*
size_t Gate::parents_size ( ) const
inline

Getter for size of parents

Returns
size_t
void Gate::print_gate_constraint ( FILE *  file) const
inline

Prints the gate constraint

Parameters
fileoutput file
void Gate::reset_fsa_inp ( )
inline

Sets fsa_inp to 0

std::map<Gate*, Polynomial*>::iterator Gate::search_in_anc ( Gate n)
inline

Searches for gate n in ancestors

Parameters
nGate*
Returns
std::map<Gate*, Polynomial*>::iterator
void Gate::set_ancestor ( Gate n,
Polynomial p 
)
inline

Adds the tuple (n,p) to the ancestors

Parameters
nGate*
pPolynomial*
void Gate::set_carry_gate ( int  val)
inline

Setter for carry_gate

Parameters
integer
void Gate::set_children_back ( Gate n)
inline

Setter for back of children

Parameters
nGate*
void Gate::set_children_front ( Gate n)
inline

Setter for front of children

Parameters
nGate*
void Gate::set_cofactor ( Polynomial p)
inline

Setter for co_factor

Parameters
pPolynomial*
void Gate::set_gate_constraint ( Polynomial p)
inline

Setter for gate_constraint

Parameters
pPolynomial *
void Gate::set_level ( int  l)
inline

Setter for level

Parameters
linteger
void Gate::set_neg ( bool  val)
inline

Setter for neg

Parameters
valBoolean
void Gate::set_slice ( int  val)
inline

Setter for slice

Parameters
valinteger
void Gate::set_xor_gate ( int  val)
inline

Setter for xor_gate

Parameters
valinteger
void Gate::unmark_prop_gen_gate ( )
inline

Sets prop_gen_gate to false

Member Data Documentation

bool Gate::aig_output = 0
private

True if the gate is an output in the aig.

std::map<Gate*, Polynomial*> Gate::ancestors
private

Used to store all dependencies in nss proofs (-certify)

bool Gate::bo = 0
private

True if gate is identified to belong to booth pattern.

int Gate::carry_gate = 0
private

Counts how often gate is used in bigger slice.

std::list<Gate*> Gate::children
private

list of gates that are children

Polynomial* Gate::co_factor = 0
private

Polynomial generated as co-factor for nss proofs (-certify)

bool Gate::elim = 0
private

True if gate is eliminated during preprocessing.

bool Gate::fsa = 0
private

True if gate is identified to belong to complex fsa (-substitute)

int Gate::fsa_inp = 0
private

True if gate is input of complex fsa (-substitute)

Polynomial* Gate::gate_constraint = 0
private

Polynomial implied by the aig gate.

bool Gate::input
private

True if gate is an input.

int Gate::level = 0
private

Distance to inputs.

bool Gate::moved = 0
private

True if gate has been moved during fix_xors.

bool Gate::neg = 0
private

True if gate occurs negative (-substitute)

bool Gate::output
private

True if the gate is an output s_i.

std::list<Gate*> Gate::parents
private

list of gates that are parents

bool Gate::partial_product = 0
private

True if gate is identified as a partial product.

bool Gate::prop_gen_gate = 0
private

True if circuit is a prop_gen_gate (-substitute)

int Gate::slice = -1
private

slice a gate is attached to

const Var* Gate::v
private

Variable of the gate, as used in the polynomials.

bool Gate::xor_chain = 0
private

True if gate belongs to xor_chain in last slice.

int Gate::xor_gate = 0
private

is set to 1 for root node, 2 for internal nodes of XORs


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