AMulet 2.0
AIG Multiplier Verification Tool
elimination.h File Reference

contains functions used in the polynomial solver More...

#include <string.h>
#include "nss.h"
#include "pac.h"
#include "slicing.h"
Include dependency graph for elimination.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

Polynomialadd_up_factors (FILE *file)
 
std::vector< Polynomial * > merge_factors (FILE *file, std::vector< Polynomial * > container)
 
void add_up_spec_of_slice (FILE *file)
 
void eliminate_by_one_gate (Gate *n1, Gate *n2, FILE *file)
 
Polynomialreduce_by_one_poly (const Polynomial *p1, Gate *n, FILE *file)
 
void remove_internal_xor_gates (FILE *file)
 
void remove_single_occs_gates (FILE *file)
 
void remove_slice_minus_one_gates (FILE *file)
 
void decomposing (FILE *file)
 
void eliminate_booth_pattern (FILE *file)
 
Polynomialinc_spec_poly (unsigned i)
 
Polynomialmod_poly (const Polynomial *p1, bool print_rule, FILE *file)
 
void correct_pp_unsigned (const Polynomial *p, FILE *file)
 
void correct_pp_signed (const Polynomial *p, FILE *file)
 
void correct_pp (const Polynomial *p, FILE *file)
 
const Polynomialreduce (FILE *file)
 
bool check_inputs_only (const Polynomial *p)
 
void write_witness_vector (const Term *t, FILE *file)
 
void write_witnesses (const Polynomial *p, FILE *file)
 
void generate_witness (const Polynomial *p, const char *name)
 

Variables

bool pac
 True, when the PAC proof format is involved. More...
 
bool nss
 True, when the Nullstellensatz proof format is involved. More...
 

Detailed Description

contains functions used in the polynomial solver

This file contains all functions used for preprocessing the Gröbner basis and for reducing the specification by the slices.

Part of AMulet2.0 : AIG Multiplier Verification Tool. Copyright (C) 2020 Daniela Kaufmann, Johannes Kepler University Linz

Function Documentation

Polynomial* add_up_factors ( FILE *  file)

Adds up the computed factors of a slice to compute the sliced specification Prints PAC rules for the process. Used only when pac=1.

Parameters
fileoutput file for PAC rules
Returns
polynomial, which is the sum of all computed factors of a slice
void add_up_spec_of_slice ( FILE *  file)

Adds up the computed sliced specifications. Prints PAC rules for the process. Used only when pac=1.

Parameters
fileoutput file for PAC rules
bool check_inputs_only ( const Polynomial p)

Checks whether the polynomial contains only input variables

Parameters
pPolynomial* to be checked
Returns
true if p contains only input variables
void correct_pp ( const Polynomial p,
FILE *  file 
)

Reducing the computed specification by the modulo constant, by calling appropriate subfunctions.

See also
correct_pp_unsigned(const Polynomial * p, FILE * file)
correct_pp_signed(const Polynomial * p, FILE * file)
Parameters
pPolynomial to be reduced
fileoutput file for PAC rules
void correct_pp_signed ( const Polynomial p,
FILE *  file 
)

Reducing the computed signed specification by the modulo constant

Parameters
pPolynomial to be reduced
fileoutput file for PAC rules
void correct_pp_unsigned ( const Polynomial p,
FILE *  file 
)

Reduces the computed unsigned specification by the modulo constant

Parameters
pPolynomial to be reduced
fileoutput file for PAC rules
void decomposing ( FILE *  file)

Remove repeatedly all single gates (until completion)

Parameters
fileoutput file for PAC rules
void eliminate_booth_pattern ( FILE *  file)

Remove all gates that are identified as a Booth pattern

Parameters
fileoutput file for PAC rules
void eliminate_by_one_gate ( Gate n1,
Gate n2,
FILE *  file 
)

Reduces the gate constraint of n1 by the gate constraint of n2

Parameters
n1Gate that is reduced by n2
n2Gate
fileoutput file for PAC rules
void generate_witness ( const Polynomial p,
const char *  name 
)

Generates a witness for the remainder polynomial p, by identifying the smallest term in the polynomial and setting all its variables to 1.

Parameters
pPolynomial* for which counter examples are generated
nameprefix name for the output file, suffix is '.cex'
Polynomial* inc_spec_poly ( unsigned  i)

Defines the slice specification for slice i: -s_i + PP_i

Parameters
iunsigned integer for the index of the slice
Returns
Polynomial for slice specification
std::vector<Polynomial*> merge_factors ( FILE *  file,
std::vector< Polynomial * >  container 
)

Merges computed factors of a slice of the same level. Prints PAC rules for the process. Used only when pac=1.

Parameters
fileoutput file for PAC rules
containervector containing the factors, ordered by level
Returns
vector of polynomials such that each polynomial has a unique level
Polynomial* mod_poly ( const Polynomial p1,
bool  print_rule,
FILE *  file 
)

Reduces p1 by the constant 2^NN

Parameters
p1Polynomial to be reduced
print_rulebool indicating whether we print the PAC rules
fileoutput file for PAC rules
Returns
the computed polynomial remainder
const Polynomial* reduce ( FILE *  file)

Incremental verification algorithm, where we reduce the slice-wise specifcations by the gate constraints of the slices

Parameters
fileoutput file for PAC rules
Returns
the computed polynomial remainder, 0 if the circuit is correct
Polynomial* reduce_by_one_poly ( const Polynomial p1,
Gate n,
FILE *  file 
)

Reduces p1 by the gate constraint of n

Parameters
p1Polynomial to be reduced
nGate
fileoutput file for PAC rules
Returns
the computed polynomial remainder
void remove_internal_xor_gates ( FILE *  file)

Remove all internal gates in identified XOR gates

Parameters
fileoutput file for PAC rules
void remove_single_occs_gates ( FILE *  file)

Remove all single-parent gates (only one loop)

Parameters
fileoutput file for PAC rules
void remove_slice_minus_one_gates ( FILE *  file)

Remove all gates that have not been assigned to a slice

Parameters
fileoutput file for PAC rules
void write_witness_vector ( const Term t,
FILE *  file 
)

Writes a vector to the file such that all input variables in the term t are set to 1, all other to 0.

Parameters
tTerm
fileoutput file for the counter example
void write_witnesses ( const Polynomial p,
FILE *  file 
)

Search for the smallest term and calls write_witness_vector on that

Parameters
pPolynomial* for which counter examples are generated
fileoutput file for the counter example

Variable Documentation

bool nss

True, when the Nullstellensatz proof format is involved.

True, when the Nullstellensatz proof format is involved.

bool pac

True, when the PAC proof format is involved.

True, when the PAC proof format is involved.