This repository has been archived by the owner on Aug 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: move External and LRAT tests out of the core repo
- Loading branch information
Showing
6 changed files
with
42 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import Test.Sat | ||
import Test.ExternalDimacs | ||
import Test.LRAT | ||
import Test.LRATChecker | ||
import Test.PHPDemo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import LeanSAT.External.LRAT | ||
|
||
open LRAT Lean Parser Elab Command | ||
|
||
syntax (name := loadLRATCommand) "loadLRAT " strLit : command | ||
|
||
@[command_elab loadLRATCommand] def elabLoadLRAT : CommandElab := fun stx => do | ||
match stx with | ||
| `(loadLRAT $file) => | ||
match Syntax.isStrLit? file with | ||
| some file => | ||
let proof ← loadLRATProof file | ||
IO.println s!"{proof}" | ||
| _ => throwError "Expected strLit: {file}" | ||
| _ => throwError "Failed to parse loadLRAT command" | ||
|
||
loadLRAT "./pigeon-hole/hole6.lrat" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import LeanSAT.LRAT.LRATChecker | ||
|
||
open LRAT Lean Parser Elab Command Dimacs | ||
|
||
syntax (name := lratCheckCommand) "lratCheck" strLit strLit : command | ||
|
||
@[command_elab lratCheckCommand] def runLRATCheck : CommandElab := fun stx => do | ||
match stx with | ||
| `(lratCheck $problemFile $prfFile) => | ||
match Syntax.isStrLit? problemFile, Syntax.isStrLit? prfFile with | ||
| some problemFile, some prfFile => | ||
let ⟨n, formula⟩ ← loadProblem problemFile | ||
let formula : DefaultFormula n := DefaultFormula.ofArray formula | ||
let proof ← loadLRATProof prfFile | ||
IO.println s!"formula: {formula.dimacs}\n" | ||
-- O.println s!"proof: {proof}\n" | ||
let proof ← proof.mapM $ intActionToDefaultClauseAction n | ||
IO.println s!"lratChecker output: {lratChecker formula proof.toList}" | ||
| _, _ => throwError "Either {problemFile} or {prfFile} did not register as a string literal" | ||
| _ => throwError "Failed to parse loadLRAT command" | ||
|
||
lratCheck "./pigeon-hole/hole6.cnf" "./pigeon-hole/hole6.lrat" | ||
lratCheck "./pigeon-hole/hole7.cnf" "./pigeon-hole/hole7.lrat" |
This file was deleted.
Oops, something went wrong.