cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
prop.cpp
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module:
4
5
Author: Daniel Kroening, kroening@kroening.com
6
7
\*******************************************************************/
8
9
#include "
prop.h
"
10
12
void
propt::set_equal
(
literalt
a,
literalt
b)
13
{
14
if
(b.
is_constant
())
15
{
16
if
(b.
is_true
())
17
lcnf
({a});
18
else
19
lcnf
({!a});
20
21
return
;
22
}
23
24
lcnf
(a, !b);
25
lcnf
(!a, b);
26
}
27
30
bvt
propt::new_variables
(std::size_t width)
31
{
32
bvt
result;
33
result.reserve(width);
34
for
(std::size_t i=0; i<width; i++)
35
result.push_back(
new_variable
());
36
return
result;
37
}
38
39
propt::resultt
propt::prop_solve
()
40
{
41
static
const
bvt
empty_assumptions;
42
++
number_of_solver_calls
;
43
return
do_prop_solve
(empty_assumptions);
44
}
45
46
propt::resultt
propt::prop_solve
(
const
bvt
&assumptions)
47
{
48
++
number_of_solver_calls
;
49
return
do_prop_solve
(assumptions);
50
}
51
52
std::size_t
propt::get_number_of_solver_calls
()
const
53
{
54
return
number_of_solver_calls
;
55
}
literalt
Definition
literal.h:26
literalt::is_true
bool is_true() const
Definition
literal.h:156
literalt::is_constant
bool is_constant() const
Definition
literal.h:166
propt::number_of_solver_calls
std::size_t number_of_solver_calls
Definition
prop.h:135
propt::get_number_of_solver_calls
std::size_t get_number_of_solver_calls() const
Definition
prop.cpp:52
propt::do_prop_solve
virtual resultt do_prop_solve(const bvt &assumptions)=0
propt::lcnf
void lcnf(literalt l0, literalt l1)
Definition
prop.h:58
propt::set_equal
virtual void set_equal(literalt a, literalt b)
asserts a==b in the propositional formula
Definition
prop.cpp:12
propt::prop_solve
resultt prop_solve()
Definition
prop.cpp:39
propt::new_variables
virtual bvt new_variables(std::size_t width)
generates a bitvector of given width with new variables
Definition
prop.cpp:30
propt::resultt
resultt
Definition
prop.h:101
propt::new_variable
virtual literalt new_variable()=0
bvt
std::vector< literalt > bvt
Definition
literal.h:201
prop.h
solvers
prop
prop.cpp
Generated by
1.17.0