Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Trestle.Solver.Dimacs.formatClause { toList := lits } = " ".intercalate (List.map (fun (x : Trestle.ILit) => Trestle.Solver.Dimacs.formatLit x) lits ++ ["0"])
Instances For
Equations
- Trestle.Solver.Dimacs.formatComment s = "\n".intercalate (List.map (fun (x : String) => "c " ++ x) (s.splitOn "\n"))
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Trestle.Solver.Dimacs.toFile file cnf = IO.FS.withFile file IO.FS.Mode.write fun (handle : IO.FS.Handle) => Trestle.Solver.Dimacs.printICnf handle.putStr cnf
Instances For
Equations
- Trestle.Solver.Dimacs.toFileRich file cnf = IO.FS.withFile file IO.FS.Mode.write fun (handle : IO.FS.Handle) => Trestle.Solver.Dimacs.printRichCnf handle.putStr cnf
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Trestle.Solver.Dimacs.printRes
{m : Type → Type u_1}
{ε : Type u_2}
[Monad m]
[MonadExcept ε m]
[Inhabited ε]
(print : String → m Unit)
:
Equations
- Trestle.Solver.Dimacs.printRes print (Trestle.Solver.Res.sat assn) = do print "s SATISFIABLE" print (Trestle.Solver.Dimacs.formatAssn assn)
- Trestle.Solver.Dimacs.printRes print Trestle.Solver.Res.unsat = print "s UNSATISFIABLE"
- Trestle.Solver.Dimacs.printRes print Trestle.Solver.Res.error = throw default
Instances For
Equations
- Trestle.Solver.Dimacs.parseClause maxVar s = Trestle.Solver.Dimacs.parseClause.aux maxVar s (List.filter (fun (x : String) => !x.isEmpty) s.splitOn) #[]
Instances For
def
Trestle.Solver.Dimacs.parseClause.aux
(maxVar : ℕ)
(s : String)
(L : List String)
(acc : Array ILit)
:
Equations
- Trestle.Solver.Dimacs.parseClause.aux maxVar s [] acc = throw (toString "Line was empty? `" ++ toString s ++ toString "`")
- Trestle.Solver.Dimacs.parseClause.aux maxVar s [last] acc = if last = "0" then pure acc else throw (toString "Expected last entry of line to be zero; got: `" ++ toString s ++ toString "`")
- Trestle.Solver.Dimacs.parseClause.aux maxVar s (lit :: rest) acc = do let lit ← Trestle.Solver.Dimacs.parseLit maxVar lit Trestle.Solver.Dimacs.parseClause.aux maxVar s rest (acc.push lit)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
auxiliary for getting an EncCNF.State from a DIMACS cnf file
Equations
- One or more equations did not get rendered due to their size.