Skip to content

Commit

Permalink
Merge pull request #1443 from GaloisInc/at-external-aig-slash
Browse files Browse the repository at this point in the history
Allow slashes in `write_aig_external` filenames

Closes #1438
  • Loading branch information
Aaron Tomb authored Sep 1, 2021
2 parents 354cda0 + 6b51c13 commit 91c5148
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions intTests/test_external_abc/test.saw
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ let q_unsat = {{ \(x:[8]) -> x != 0 /\ x+x == x }};

write_verilog "write_verilog_unsat.v" q_unsat;
write_smtlib2_w4 "write_smtlib2_w4_unsat.smt2" q_unsat;
write_aig_external "write_aig_external_unsat.aig" q_unsat;
write_cnf_external "write_aig_external_unsat.cnf" q_unsat;
write_aig_external "./write_aig_external_unsat.aig" q_unsat;
write_cnf_external "./write_aig_external_unsat.cnf" q_unsat;

// A formula that is satisfiable.
let q_sat = {{ \(x:[8]) -> x+x == x }};

write_verilog "write_verilog_sat.v" q_sat;
write_smtlib2_w4 "write_smtlib2_w4_sat.smt2" q_sat;
write_aig_external "write_aig_external_sat.aig" q_sat;
write_cnf_external "write_aig_external_sat.cnf" q_sat;
write_aig_external "./write_aig_external_sat.aig" q_sat;
write_cnf_external "./write_aig_external_sat.cnf" q_sat;

fails (prove_print sbv_abc q_sat);
fails (prove_print w4_abc_smtlib2 q_sat);
Expand Down
5 changes: 3 additions & 2 deletions src/SAWScript/Prover/Exporter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import qualified Data.Map as Map
import Data.Set (Set)
import qualified Data.SBV.Dynamic as SBV
import System.Directory (removeFile)
import System.FilePath (takeBaseName)
import System.IO
import System.IO.Temp(emptySystemTempFile)
import Data.Text (pack)
Expand Down Expand Up @@ -148,8 +149,8 @@ writeAIG f t = do
io $ AIG.writeAiger f aig

withABCVerilog :: FilePath -> Term -> (FilePath -> String) -> TopLevel ()
withABCVerilog baseName t buildCmd =
do verilogFile <- io $ emptySystemTempFile (baseName ++ ".v")
withABCVerilog fileName t buildCmd =
do verilogFile <- io $ emptySystemTempFile (takeBaseName fileName ++ ".v")
sc <- getSharedContext
write_verilog sc verilogFile t
io $
Expand Down

0 comments on commit 91c5148

Please sign in to comment.