CBMC
cnf_clause_list.cpp
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: CNF Generation
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
11 
12 #include "cnf_clause_list.h"
13 
14 #include <ostream>
15 
16 void cnf_clause_listt::lcnf(const bvt &bv)
17 {
18  bvt new_bv;
19 
20  if(process_clause(bv, new_bv))
21  return;
22 
23  clauses.push_back(new_bv);
24 }
25 
26 void cnf_clause_list_assignmentt::print_assignment(std::ostream &out) const
27 {
28  for(unsigned v=1; v<assignment.size(); v++)
29  out << "v" << v << "=" << assignment[v] << "\n";
30 }
31 
33 {
34  assignment.resize(no_variables());
35 
36  // we don't use index 0, start with 1
37  for(unsigned v=1; v<assignment.size(); v++)
38  {
39  literalt l;
40  l.set(v, false);
41  assignment[v]=prop.l_get(l);
42  }
43 }
virtual void copy_assignment_from(const propt &prop)
void print_assignment(std::ostream &out) const
void lcnf(const bvt &bv) override
bool process_clause(const bvt &bv, bvt &dest) const
filter 'true' from clause, eliminate duplicates, recognise trivially satisfied clauses
Definition: cnf.cpp:424
virtual size_t no_variables() const override
Definition: cnf.h:42
void set(var_not _l)
Definition: literal.h:93
TO_BE_DOCUMENTED.
Definition: prop.h:25
virtual tvt l_get(literalt a) const =0
CNF Generation.
std::vector< literalt > bvt
Definition: literal.h:201