Advertisement
Guest User

satcore

a guest
Nov 16th, 2018
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. (ns sat.core
  2. (:gen-class)
  3. (:use satlib)
  4. )
  5.  
  6.  
  7. (defn -main
  8. "SAT solver"
  9. [& args]
  10. (let
  11. [
  12. raw-cnf (simplify (dimacs-cnf))
  13. infinity (+ 1 (get-size raw-cnf))
  14. options {:which-first {:first true :second false :jump :false-side}}
  15. cnf (make-cnf raw-cnf infinity)
  16. ]
  17. (display-cnf "input" cnf)
  18. (let
  19. [
  20. result (scan-cnf options infinity cnf 0 init-assert init-stats)
  21. sat (get result :sat)
  22. ]
  23. (if sat
  24. (println "SAT" (get result :answer))
  25. (println "UNSAT")
  26. )
  27.  
  28. (println (sort (get result :stats)))
  29. )
  30. )
  31. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement