-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.lean
More file actions
21 lines (20 loc) · 710 Bytes
/
Main.lean
File metadata and controls
21 lines (20 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import SatChecker.LRat
def main (args:List String) : IO Unit := do
match args with
| [] =>
IO.println "Provide a command (dimacs or lrat)"
| ["dimacs", dimacsFile] => do
let h ← ByteStream.fromPath dimacsFile
let cnf ← Dimacs.read h
| "dimacs" :: _ => do
IO.println "Expected dimacsfile."
| ["lrat", dimacsFile, lratFile] => do
let h ← ByteStream.fromPath dimacsFile
let cnf ← Dimacs.read h
let h ← ByteStream.fromPath lratFile
readLRat h cnf.varCount (ClauseDB.fromDimacs cnf)
IO.println s!"Verified {dimacsFile} is unsat."
| "lrat" :: _ => do
IO.println "Expected dimacsfile and lratfile."
| cmd :: _ =>
IO.println "Unknown command {cmd}."