mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-09 12:45:48 -05:00
Fixed bug in sat example in readme
This commit is contained in:
parent
cdf8371394
commit
f6fbd874ec
1 changed files with 7 additions and 5 deletions
12
README.md
12
README.md
|
|
@ -30,16 +30,18 @@ as shown in the following code :
|
|||
let b = Sat.make 1 (* Atoms can be created from integers *)
|
||||
|
||||
(* Let's create some formulas *)
|
||||
let p = F.make_and [a; b]
|
||||
let q = F.make_or [F.make_not a; F.make_not b]
|
||||
let p = F.make_atom a
|
||||
let q = F.make_atom b
|
||||
let r = F.make_and [p; q]
|
||||
let s = F.make_or [F.make_not p; F.make_not q]
|
||||
|
||||
(* We can try and check the satisfiability of the given formulas *)
|
||||
Sat.assume (F.make_cnf p)
|
||||
Sat.assume (F.make_cnf r)
|
||||
let _ = Sat.solve () (* Should return Sat.Sat *)
|
||||
|
||||
(* The Sat solver has an incremental mutable state, so we still have
|
||||
* the formula 'p' in our assumptions *)
|
||||
Sat.assume (F.make_cnf q)
|
||||
* the formula 'r' in our assumptions *)
|
||||
Sat.assume (F.make_cnf s)
|
||||
let _ = Sat.solve () (* Should return Sat.Unsat *)
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue