On Thu, 2014-09-18 at 11:25 -0700, douglas schroeder wrote:
> Hello.
> So, I am analysing the DIMACS output.
> When I try to output the CNF of a small function like:
> char foo(char a){
> return a;
> }
>
> I got no output.
CBMC generates the CNF of the SAT encoding of the verification
conditions. If there are no verification conditions, i.e. there is
nothing you are trying to prove, then no CNF will be generated.
> I made this, because I was wondering what are the variables that have
> not relation with the C program variables.
> for example:
> p cnf 915 2536
> 1 3 0
> 2 3 0
> 1 2 3 0
> 1 5 0
> 2 5 0
> 4 5 0
> 1 2 4 5 0
> 1 7 0
>
> I know that these first variables (1,2,3,4,5...) are not directly
> linked to the C program. Where they come from, and
> what is their purpose?
There are various other variables that encode global variables and our
models of process state including threads, heap, etc. There will also
be variables used to reason about flow of control. Using --show-vcc
might give you some idea of what is being encoded. --slice-formula will
remove things that can be trivially shown to not influence the
verification conditions that are being proven.
One word of caution -- the DIMACS output is not intended to be human
readable and the comments that link variables in the CNF and the program
are mainly for debugging. What are you aiming to do? There may well be
a better way of doing it.
Cheers,
- Martin