#include <gate.h>
Public Member Functions | |
Gate (int n_, std::string name_, int level_, bool input_=0, bool output_=0) | |
const Var * | get_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 () |
Polynomial * | get_gate_constraint () const |
void | set_gate_constraint (Polynomial *p) |
void | print_gate_constraint (FILE *file) const |
Polynomial * | get_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 |
Gate * | parents_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 |
Gate * | children_front () const |
Gate * | children_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 Var * | v |
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... | |
Polynomial * | gate_constraint = 0 |
Polynomial implied by the aig gate. More... | |
Polynomial * | co_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... | |
Internal structure to represent the AIG graph.
Gate::Gate | ( | int | n_, |
std::string | name_, | ||
int | level_, | ||
bool | input_ = 0 , |
||
bool | output_ = 0 |
||
) |
Constructor Calls constructor of Var
n_ | value, corresponding to aiger value |
name_ | string name of the variable |
level | position in order of the variable |
Gate::~Gate | ( | ) |
Destructor
|
inline |
Getter for begin of ancestors
|
inline |
Getter for end of ancestors
|
inline |
Getter for back of children
|
inline |
Getter for begin of children
|
inline |
Getter for end of children
|
inline |
Getter for front of children
|
inline |
Appends gate n to the children
n | Gate* |
|
inline |
Removes gate n from the children
n | Gate* |
|
inline |
Getter for size of children
|
inline |
Decreases carry_gate
|
inline |
Decreases slice
|
inline |
Getter for aig_output
|
inline |
Getter for bo
|
inline |
Getter for carry_gate
|
inline |
Getter for co_factor
|
inline |
Getter for elim
|
inline |
Getter for fsa
|
inline |
Getter for fsa_inp
|
inline |
Getter for gate_constraint
|
inline |
Getter for input
|
inline |
Getter for level
|
inline |
Getter for moved
|
inline |
Getter for neg
|
inline |
Getter for output
|
inline |
Getter for partial_product
|
inline |
Getter for prop_gen_gate
|
inline |
Getter for slice
|
inline |
Getter for v
|
inline |
Getter for name of v
|
inline |
Getter for number of v
|
inline |
Getter for xor_chain
|
inline |
Getter for xor_gate
|
inline |
Increases carry_gate
|
inline |
Increases fsa_inp
|
inline |
Increases slice
bool Gate::is_child | ( | const Gate * | n | ) | const |
Determines whether n is contained in the children of this gate
n | Gate* |
bool Gate::is_in_parents | ( | const Gate * | n | ) | const |
Determines whether n is contained in the parents of this gate
n | Gate* |
|
inline |
Sets aig_output to true
|
inline |
Sets bo to true
|
inline |
Sets elim to true
|
inline |
Sets fsa to true
|
inline |
Sets moved to true
|
inline |
Sets partial_product to true
|
inline |
Sets prop_gen_gate to true
|
inline |
Sets xor_chain to true
bool Gate::orig | ( | ) | const |
Determines whether gate constraint is original
|
inline |
Getter for begin of parents
|
inline |
Getter for end of parents
|
inline |
Getter for front of parents
|
inline |
Appends gate n to the parents
n | Gate* |
|
inline |
Removes gate n from the parents
n | Gate* |
|
inline |
Getter for size of parents
|
inline |
Prints the gate constraint
file | output file |
|
inline |
Sets fsa_inp to 0
|
inline |
Searches for gate n in ancestors
n | Gate* |
|
inline |
Adds the tuple (n,p) to the ancestors
n | Gate* |
p | Polynomial* |
|
inline |
Setter for carry_gate
integer |
|
inline |
Setter for back of children
n | Gate* |
|
inline |
Setter for front of children
n | Gate* |
|
inline |
Setter for co_factor
p | Polynomial* |
|
inline |
Setter for gate_constraint
p | Polynomial * |
|
inline |
Setter for level
l | integer |
|
inline |
Setter for neg
val | Boolean |
|
inline |
Setter for slice
val | integer |
|
inline |
Setter for xor_gate
val | integer |
|
inline |
Sets prop_gen_gate to false
|
private |
True if the gate is an output in the aig.
|
private |
Used to store all dependencies in nss proofs (-certify)
|
private |
True if gate is identified to belong to booth pattern.
|
private |
Counts how often gate is used in bigger slice.
|
private |
list of gates that are children
|
private |
Polynomial generated as co-factor for nss proofs (-certify)
|
private |
True if gate is eliminated during preprocessing.
|
private |
True if gate is identified to belong to complex fsa (-substitute)
|
private |
True if gate is input of complex fsa (-substitute)
|
private |
Polynomial implied by the aig gate.
|
private |
True if gate is an input.
|
private |
Distance to inputs.
|
private |
True if gate has been moved during fix_xors.
|
private |
True if gate occurs negative (-substitute)
|
private |
True if the gate is an output s_i.
|
private |
list of gates that are parents
|
private |
True if gate is identified as a partial product.
|
private |
True if circuit is a prop_gen_gate (-substitute)
|
private |
slice a gate is attached to
|
private |
Variable of the gate, as used in the polynomials.
|
private |
True if gate belongs to xor_chain in last slice.
|
private |
is set to 1 for root node, 2 for internal nodes of XORs