cprover
cnft Class Referenceabstract

#include <cnf.h>

+ Inheritance diagram for cnft:
+ Collaboration diagram for cnft:

Public Member Functions

 cnft (message_handlert &message_handler)
 
virtual ~cnft ()
 
virtual literalt land (literalt a, literalt b) override
 
virtual literalt lor (literalt a, literalt b) override
 
virtual literalt land (const bvt &bv) override
 Tseitin encoding of conjunction between multiple literals. More...
 
virtual literalt lor (const bvt &bv) override
 Tseitin encoding of disjunction between multiple literals. More...
 
virtual literalt lxor (const bvt &bv) override
 Tseitin encoding of XOR between multiple literals. More...
 
virtual literalt lxor (literalt a, literalt b) override
 
virtual literalt lnand (literalt a, literalt b) override
 
virtual literalt lnor (literalt a, literalt b) override
 
virtual literalt lequal (literalt a, literalt b) override
 
virtual literalt limplies (literalt a, literalt b) override
 
virtual literalt lselect (literalt a, literalt b, literalt c) override
 
virtual literalt new_variable () override
 Generate a new variable and return it as a literal. More...
 
virtual size_t no_variables () const override
 
virtual void set_no_variables (size_t no)
 
virtual size_t no_clauses () const =0
 
- Public Member Functions inherited from propt
 propt (message_handlert &message_handler)
 
virtual ~propt ()
 
virtual void set_equal (literalt a, literalt b)
 asserts a==b in the propositional formula More...
 
virtual void l_set_to (literalt a, bool value)
 
void l_set_to_true (literalt a)
 
void l_set_to_false (literalt a)
 
void lcnf (literalt l0, literalt l1)
 
void lcnf (literalt l0, literalt l1, literalt l2)
 
void lcnf (literalt l0, literalt l1, literalt l2, literalt l3)
 
virtual void lcnf (const bvt &bv)=0
 
virtual bool has_set_to () const
 
virtual bool cnf_handled_well () const
 
virtual void set_assumptions (const bvt &)
 
virtual bool has_set_assumptions () const
 
virtual void set_variable_name (literalt, const irep_idt &)
 
bvt new_variables (std::size_t width)
 generates a bitvector of given width with new variables More...
 
virtual const std::string solver_text ()=0
 
resultt prop_solve ()
 
virtual tvt l_get (literalt a) const =0
 
virtual void set_assignment (literalt a, bool value)=0
 
virtual bool is_in_conflict (literalt l) const =0
 Returns true if an assumption is in the final conflict. More...
 
virtual bool has_is_in_conflict () const
 
virtual void set_frozen (literalt)
 
virtual void set_time_limit_seconds (uint32_t)
 
std::size_t get_number_of_solver_calls () const
 

Protected Member Functions

void gate_and (literalt a, literalt b, literalt o)
 Tseitin encoding of conjunction of two literals. More...
 
void gate_or (literalt a, literalt b, literalt o)
 Tseitin encoding of disjunction of two literals. More...
 
void gate_xor (literalt a, literalt b, literalt o)
 Tseitin encoding of XOR of two literals. More...
 
void gate_nand (literalt a, literalt b, literalt o)
 Tseitin encoding of NAND of two literals. More...
 
void gate_nor (literalt a, literalt b, literalt o)
 Tseitin encoding of NOR of two literals. More...
 
void gate_equal (literalt a, literalt b, literalt o)
 Tseitin encoding of equality between two literals. More...
 
void gate_implies (literalt a, literalt b, literalt o)
 Tseitin encoding of implication between two literals. More...
 
bool process_clause (const bvt &bv, bvt &dest)
 filter 'true' from clause, eliminate duplicates, recognise trivially satisfied clauses More...
 
- Protected Member Functions inherited from propt
virtual resultt do_prop_solve ()=0
 

Static Protected Member Functions

static bvt eliminate_duplicates (const bvt &)
 eliminate duplicates from given vector of literals More...
 
static bool is_all (const bvt &bv, literalt l)
 

Protected Attributes

size_t _no_variables
 
- Protected Attributes inherited from propt
bvt lcnf_bv
 
messaget log
 
std::size_t number_of_solver_calls = 0
 

Additional Inherited Members

- Public Types inherited from propt
enum  resultt { resultt::P_SATISFIABLE, resultt::P_UNSATISFIABLE, resultt::P_ERROR }
 

Detailed Description

Definition at line 17 of file cnf.h.

Constructor & Destructor Documentation

◆ cnft()

cnft::cnft ( message_handlert message_handler)
inlineexplicit

Definition at line 22 of file cnf.h.

◆ ~cnft()

virtual cnft::~cnft ( )
inlinevirtual

Definition at line 26 of file cnf.h.

Member Function Documentation

◆ eliminate_duplicates()

bvt cnft::eliminate_duplicates ( const bvt bv)
staticprotected

eliminate duplicates from given vector of literals

parameters: set of literals given as vector
Returns
set of literals, duplicates removed

Definition at line 400 of file cnf.cpp.

◆ gate_and()

void cnft::gate_and ( literalt  a,
literalt  b,
literalt  o 
)
protected

Tseitin encoding of conjunction of two literals.

parameters: Two input signals to the AND gate, one output
Returns
Side effect: add clauses that encodes relation between inputs/output via lcnf

Definition at line 25 of file cnf.cpp.

◆ gate_equal()

void cnft::gate_equal ( literalt  a,
literalt  b,
literalt  o 
)
protected

Tseitin encoding of equality between two literals.

parameters: Two input signals to the EQUAL gate, one output

Definition at line 145 of file cnf.cpp.

◆ gate_implies()

void cnft::gate_implies ( literalt  a,
literalt  b,
literalt  o 
)
protected

Tseitin encoding of implication between two literals.

parameters: Two input signals to the IMPLIES gate, one output

Definition at line 152 of file cnf.cpp.

◆ gate_nand()

void cnft::gate_nand ( literalt  a,
literalt  b,
literalt  o 
)
protected

Tseitin encoding of NAND of two literals.

parameters: Two input signals to the NAND gate, one output

Definition at line 101 of file cnf.cpp.

◆ gate_nor()

void cnft::gate_nor ( literalt  a,
literalt  b,
literalt  o 
)
protected

Tseitin encoding of NOR of two literals.

parameters: Two input signals to the NOR gate, one output

Definition at line 123 of file cnf.cpp.

◆ gate_or()

void cnft::gate_or ( literalt  a,
literalt  b,
literalt  o 
)
protected

Tseitin encoding of disjunction of two literals.

parameters: Two input signals to the OR gate, one output

Definition at line 48 of file cnf.cpp.

◆ gate_xor()

void cnft::gate_xor ( literalt  a,
literalt  b,
literalt  o 
)
protected

Tseitin encoding of XOR of two literals.

parameters: Two input signals to the XOR gate, one output

Definition at line 70 of file cnf.cpp.

◆ is_all()

static bool cnft::is_all ( const bvt bv,
literalt  l 
)
inlinestaticprotected

Definition at line 60 of file cnf.h.

◆ land() [1/2]

literalt cnft::land ( literalt  a,
literalt  b 
)
overridevirtual
parameters: Two inputs to the AND gate
Returns
Output signal of the AND gate as literal

Implements propt.

Definition at line 265 of file cnf.cpp.

◆ land() [2/2]

literalt cnft::land ( const bvt bv)
overridevirtual

Tseitin encoding of conjunction between multiple literals.

parameters: Any number of inputs to the AND gate
Returns
Output signal of the AND gate as literal

Implements propt.

Definition at line 160 of file cnf.cpp.

◆ lequal()

literalt cnft::lequal ( literalt  a,
literalt  b 
)
overridevirtual

Implements propt.

Definition at line 331 of file cnf.cpp.

◆ limplies()

literalt cnft::limplies ( literalt  a,
literalt  b 
)
overridevirtual

Implements propt.

Definition at line 336 of file cnf.cpp.

◆ lnand()

literalt cnft::lnand ( literalt  a,
literalt  b 
)
overridevirtual
parameters: Two inputs to the NAND gate
Returns
Output signal of the NAND gate as literal

Implements propt.

Definition at line 319 of file cnf.cpp.

◆ lnor()

literalt cnft::lnor ( literalt  a,
literalt  b 
)
overridevirtual
parameters: Two inputs to the NOR gate
Returns
Output signal of the NOR gate as literal

Implements propt.

Definition at line 326 of file cnf.cpp.

◆ lor() [1/2]

literalt cnft::lor ( literalt  a,
literalt  b 
)
overridevirtual
parameters: Two inputs to the OR gate
Returns
Output signal of the OR gate as literal

Implements propt.

Reimplemented in qbf_bdd_coret.

Definition at line 281 of file cnf.cpp.

◆ lor() [2/2]

literalt cnft::lor ( const bvt bv)
overridevirtual

Tseitin encoding of disjunction between multiple literals.

parameters: Any number of inputs to the OR gate
Returns
Output signal of the OR gate as literal

Implements propt.

Reimplemented in qbf_bdd_coret.

Definition at line 203 of file cnf.cpp.

◆ lselect()

literalt cnft::lselect ( literalt  a,
literalt  b,
literalt  c 
)
overridevirtual

Implements propt.

Definition at line 346 of file cnf.cpp.

◆ lxor() [1/2]

literalt cnft::lxor ( const bvt bv)
overridevirtual

Tseitin encoding of XOR between multiple literals.

parameters: Any number of inputs to the XOR gate
Returns
Output signal of the XOR gate as literal

Implements propt.

Definition at line 246 of file cnf.cpp.

◆ lxor() [2/2]

literalt cnft::lxor ( literalt  a,
literalt  b 
)
overridevirtual
parameters: Two inputs to the XOR gate
Returns
Output signal of the XOR gate as literal

Implements propt.

Definition at line 297 of file cnf.cpp.

◆ new_variable()

literalt cnft::new_variable ( void  )
overridevirtual

Generate a new variable and return it as a literal.

Returns
New variable as literal

Implements propt.

Reimplemented in qbf_bdd_coret, and qbf_bdd_certificatet.

Definition at line 387 of file cnf.cpp.

◆ no_clauses()

virtual size_t cnft::no_clauses ( ) const
pure virtual

◆ no_variables()

virtual size_t cnft::no_variables ( ) const
inlineoverridevirtual

Implements propt.

Definition at line 41 of file cnf.h.

◆ process_clause()

bool cnft::process_clause ( const bvt bv,
bvt dest 
)
protected

filter 'true' from clause, eliminate duplicates, recognise trivially satisfied clauses

Definition at line 416 of file cnf.cpp.

◆ set_no_variables()

virtual void cnft::set_no_variables ( size_t  no)
inlinevirtual

Reimplemented in qbf_squolem_coret, and qbf_squolemt.

Definition at line 42 of file cnf.h.

Member Data Documentation

◆ _no_variables

size_t cnft::_no_variables
protected

Definition at line 56 of file cnf.h.


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