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
32
void
cnf_clause_list_assignmentt::copy_assignment_from
(
const
propt
&prop)
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
}
cnf_clause_list_assignmentt::assignment
assignmentt assignment
Definition:
cnf_clause_list.h:126
cnf_clause_list_assignmentt::copy_assignment_from
virtual void copy_assignment_from(const propt &prop)
Definition:
cnf_clause_list.cpp:32
cnf_clause_list_assignmentt::print_assignment
void print_assignment(std::ostream &out) const
Definition:
cnf_clause_list.cpp:26
cnf_clause_listt::clauses
clausest clauses
Definition:
cnf_clause_list.h:85
cnf_clause_listt::lcnf
void lcnf(const bvt &bv) override
Definition:
cnf_clause_list.cpp:16
cnft::process_clause
bool process_clause(const bvt &bv, bvt &dest) const
filter 'true' from clause, eliminate duplicates, recognise trivially satisfied clauses
Definition:
cnf.cpp:424
cnft::no_variables
virtual size_t no_variables() const override
Definition:
cnf.h:42
literalt
Definition:
literal.h:26
literalt::set
void set(var_not _l)
Definition:
literal.h:93
propt
TO_BE_DOCUMENTED.
Definition:
prop.h:25
propt::l_get
virtual tvt l_get(literalt a) const =0
cnf_clause_list.h
CNF Generation.
bvt
std::vector< literalt > bvt
Definition:
literal.h:201
src
solvers
sat
cnf_clause_list.cpp
Generated by
1.9.1