Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
97b8a34
intTests/test2242_2243: Update README.
sauclovian-g Oct 29, 2025
a5d3041
Interpreter: interpretFile is internal; don't export it.
sauclovian-g Oct 23, 2025
db5f068
REPL: SAWScript.REPL.Trie is a data type; normalize imports and naming.
sauclovian-g Oct 23, 2025
3025a36
REPL: Textify.
sauclovian-g Oct 23, 2025
2780ebc
Trie: tidy, simplify, improve naming, add comments.
sauclovian-g Oct 23, 2025
4598489
Trie: move to saw-support.
sauclovian-g Oct 23, 2025
43448ee
Trie: build changes for the move.
sauclovian-g Oct 23, 2025
8f6b432
Interpreter: Simplify buildTopLevelEnv signature.
sauclovian-g Oct 23, 2025
f537158
REPL: Add missing export list to Logo.hs and remove unused type.
sauclovian-g Oct 23, 2025
a1b8e95
REPL: Don't export stuff not used downstream and prune dead code.
sauclovian-g Oct 23, 2025
c32e4df
REPL: Use StateT for the REPL monad, instead of handrolled.
sauclovian-g Oct 24, 2025
73196a8
REPL: Don't disable easily fixed compiler warnings.
sauclovian-g Oct 24, 2025
6291a70
REPL: It's confusing to have both "io" and "liftIO".
sauclovian-g Oct 24, 2025
cdd4ab1
REPL: call the REPL state "REPLState" rather than "Refs".
sauclovian-g Oct 24, 2025
9ca8b73
REPL: Remove the IORefs from the REPL state.
sauclovian-g Oct 25, 2025
8da71fc
REPL: Simplify the interface for Main to start and enter the REPL.
sauclovian-g Oct 25, 2025
e3926de
REPL / Interpreter: Rationalize the way subshells are started.
sauclovian-g Oct 25, 2025
337e7e0
REPL: Remove unused cases of REPLException.
sauclovian-g Oct 28, 2025
ea1e680
REPL: Only one case left in REPLException, so remove it entirely.
sauclovian-g Oct 28, 2025
0662ae1
REPL: Keep only monad widgetry in SAWScript.REPL.Monad.
sauclovian-g Oct 29, 2025
5388b63
SAWScript.REPL.Monad: sort contents of file.
sauclovian-g Oct 29, 2025
dd1c24c
SAWScript.REPL.Monad: fix up section dividers.
sauclovian-g Oct 29, 2025
1e4b446
SAWScript.REPL.Command: Move code around.
sauclovian-g Oct 29, 2025
23bf22b
REPL: Tidy the :env and :tenv commands.
sauclovian-g Oct 29, 2025
33fc49f
SAWScript.Import: tsort contents of file.
sauclovian-g Oct 29, 2025
d4efbb7
SAWScript.Import: Return in Maybe instead of throwing.
sauclovian-g Oct 29, 2025
0680fc8
SAWScript: Move everything that loads SAWScript text to Import.hs.
sauclovian-g Oct 30, 2025
b662b61
SAWScript.Import: Simplify, unify logic.
sauclovian-g Oct 30, 2025
8289189
SAWScript.Import: Typecheck after parsing schema patterns.
sauclovian-g Oct 31, 2025
947d123
SAWScript.Import: Typecheck after parsing expressions.
sauclovian-g Oct 31, 2025
7d57089
SAWScript: Correct the type of "sharpSAT".
sauclovian-g Oct 31, 2025
f61fb90
SAWScript.Import: Typecheck after parsing type schemas.
sauclovian-g Oct 31, 2025
cb8cde9
SAWScript.Import: Flip the sense of the naming.
sauclovian-g Oct 31, 2025
8f63729
SAWScript.Import: Rename to SAWScript.Loader.
sauclovian-g Oct 31, 2025
8ab6191
Build changes for renaming SAWScript.Import -> SAWScript.Loader.
sauclovian-g Oct 31, 2025
90bf20a
REPL: Simplify and clarify code more.
sauclovian-g Oct 31, 2025
372643e
REPL: Rework execution and completion in the Haskeline code.
sauclovian-g Oct 31, 2025
c5794c4
REPL: Now rework the way things execute in Command.hs.
sauclovian-g Oct 31, 2025
0fe9e5a
REPL: a few more minor cleanups
sauclovian-g Oct 31, 2025
9485aac
REPL: Normalize file headers.
sauclovian-g Oct 31, 2025
8b6c2c2
REPL: Edit width should be 80. NFCI
sauclovian-g Oct 31, 2025
8f1c9fb
More haddocks (review comments + other adjacent bits)
sauclovian-g Oct 31, 2025
4db4a29
Remove obsolete explicit Typeable references.
sauclovian-g Oct 31, 2025
1087bb5
SAWScript.Loader: Avoid writing "Options.Options"
sauclovian-g Oct 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ This release supports [version

## Bug Fixes

* Under some combinations of circumstances you would sometimes get
messages of the form "Subshells not supported" or "Proof subshells
not supported" when trying to start an interactive subshell /
sub-REPL.
This no longer happens.

* `jvm_verify` and `mir_verify` now honor their respective parameters that
enable or disable path satisfiability checking. As discovered in #2740, these
parameters had been ignored.
Expand Down
2 changes: 1 addition & 1 deletion intTests/test1646/test15.log.good
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ set_memoization_incremental : TopLevel ()
set_min_sharing : Int -> TopLevel ()
set_solver_cache_path : String -> TopLevel ()
set_solver_cache_timeout : Int -> TopLevel ()
sharpSAT : Term -> TopLevel Integer
sharpSAT : Term -> TopLevel Int
show : {a} a -> String
show_cfg : CFG -> String
show_term : Term -> String
Expand Down
12 changes: 3 additions & 9 deletions intTests/test2242_2243/README
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
Examples from #2242 (scoping regression in proof_subshell) and #2243
(bindings escape proof_subshell).

It might be better to use test-and-diff.sh here so as to capture the
output; however, it doesn't work. For a TopLevel subshell, the input
for the subshell needs to be on stdin, even if you use .isaw files
with saw -B, and test-and-diff.sh can't do that. For a ProofScript
subshell, it's even worse: for some reason one gets "Proof subshells
not supported".
Examples from #2242 (scoping regression in proof_subshell), #2243
(bindings escape proof_subshell), and #2306 (bizarre environment
capturing in the subshell / proof_subshell commands)
5 changes: 4 additions & 1 deletion intTests/test_parse_errors/lexer005.log.good
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Loading file "lexer005.saw"
Parse error at lexer005.saw:3:20-3:21: Unexpected `}'
Stack trace:
(builtin) (at top level)
Parse error at lexer005.saw:3:20-3:21: Unexpected `}'

FAILED
5 changes: 4 additions & 1 deletion intTests/test_parse_errors/lexer006.log.good
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Loading file "lexer006.saw"
Parse error at lexer006.saw:3:1-3:2: Unexpected `}'
Stack trace:
(builtin) (at top level)
Parse error at lexer006.saw:3:1-3:2: Unexpected `}'

FAILED
5 changes: 4 additions & 1 deletion intTests/test_parse_errors/parser001.log.good
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Loading file "parser001.saw"
Parse error at parser001.saw:2:13-2:23: Unexpected `rebindable'
Stack trace:
(builtin) (at top level)
Parse error at parser001.saw:2:13-2:23: Unexpected `rebindable'

FAILED
5 changes: 4 additions & 1 deletion intTests/test_parse_errors/parser002.log.good
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Loading file "parser002.saw"
Parse error at parser002.saw:2:36-2:38: Unexpected `in'
Stack trace:
(builtin) (at top level)
Parse error at parser002.saw:2:36-2:38: Unexpected `in'

FAILED
5 changes: 4 additions & 1 deletion intTests/test_parse_errors/parser003.log.good
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Loading file "parser003.saw"
Parse error at parser003.saw:2:36-2:38: Unexpected `in'
Stack trace:
(builtin) (at top level)
Parse error at parser003.saw:2:36-2:38: Unexpected `in'

FAILED
5 changes: 4 additions & 1 deletion intTests/test_parse_errors/parser004.log.good
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Loading file "parser004.saw"
Parse error at parser004.saw:2:22-2:24: Unexpected `in'
Stack trace:
(builtin) (at top level)
Parse error at parser004.saw:2:22-2:24: Unexpected `in'

FAILED
5 changes: 4 additions & 1 deletion intTests/test_parse_errors/parser005.log.good
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Loading file "parser005.saw"
Parse error at parser005.saw:2:5-2:15: Unexpected `rebindable'
Stack trace:
(builtin) (at top level)
Parse error at parser005.saw:2:5-2:15: Unexpected `rebindable'

FAILED
5 changes: 4 additions & 1 deletion intTests/test_parse_errors/parser006.log.good
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Loading file "parser006.saw"
Parse error at parser006.saw:3:5-3:15: Unexpected `rebindable'
Stack trace:
(builtin) (at top level)
Parse error at parser006.saw:3:5-3:15: Unexpected `rebindable'

FAILED
2 changes: 1 addition & 1 deletion intTests/test_search/search00.log.good
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ write_saig' : String -> Term -> Int -> TopLevel ()
6 more matches tagged experimental; use enable_experimental to see them
--------------------------------
-- (TopLevel Int)
No matches.
sharpSAT : Term -> TopLevel Int
1 change: 1 addition & 0 deletions intTests/test_search/search01.log.good
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ llvm_spec_solvers : LLVMSpec -> [String]
--------------------------------
-- (_ Int)
goal_num : ProofScript Int
sharpSAT : Term -> TopLevel Int
--------------------------------
-- JVMSetup
jvm_alloc_array : Int -> JavaType -> JVMSetup JVMValue
Expand Down
5 changes: 4 additions & 1 deletion intTests/test_type_errors/err025.log.good
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Loading file "err025.saw"
err025.saw:3:9-3:14: do block must include at least one expression
Stack trace:
(builtin) (at top level)
err025.saw:3:9-3:14: do block must include at least one expression

FAILED
5 changes: 4 additions & 1 deletion intTests/test_type_errors/err026.log.good
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Loading file "err026.saw"
err026.saw:3:9-5:2: do block must end with expression
Stack trace:
(builtin) (at top level)
err026.saw:3:9-5:2: do block must end with expression

FAILED
5 changes: 4 additions & 1 deletion intTests/test_type_errors/err027.log.good
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Loading file "err027.saw"
Parse error at err027.saw:7:10-7:11: Unexpected `]'
Stack trace:
(builtin) (at top level)
Parse error at err027.saw:7:10-7:11: Unexpected `]'

FAILED
5 changes: 1 addition & 4 deletions saw-central/src/SAWCentral/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import Control.Monad.State
import Control.Monad.Trans.Except
import Control.DeepSeq(rnf, NFData(..))
import Data.Char(isSpace)
import Data.Data
import Data.Function (on)
import Data.List (sortBy)
import qualified Data.List.NonEmpty as NE
Expand All @@ -43,8 +42,6 @@ import SAWCentral.Position
bullets :: Char -> [PP.Doc ann] -> PP.Doc ann
bullets c = PP.vcat . map (PP.hang 2 . (PP.pretty c PP.<+>))

data SSMode = Verify | Blif | CBlif deriving (Eq, Show, Data, Typeable)

-- | Convert a string to a paragraph formatted document.
ftext :: String -> Doc ann
ftext msg = fillSep (map pretty $ words msg)
Expand All @@ -64,7 +61,7 @@ mapLookupAny keys m = listToMaybe $ catMaybes $ map (\k -> Map.lookup k m) keys
data ExecException = ExecException Pos -- Position
(Doc Void) -- Error message
String -- Resolution tip
deriving (Show, Typeable)
deriving (Show)

instance Exception ExecException

Expand Down
19 changes: 17 additions & 2 deletions saw-central/src/SAWCentral/Value.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ module SAWCentral.Value (
-- used by SAWCentral.Builtins, SAWScript.ValueOps, SAWScript.Interpreter,
-- SAWScript.REPL.Command, SAWScript.REPL.Monad, SAWServer.SAWServer
Environ(..),
-- used by SAWScript.Import
RebindableEnv,
-- used by SAWScript.Interpreter
pushScope, popScope,
-- used by SAWCentral.Builtins, SAWScript.ValueOps, SAWScript.Interpreter,
Expand All @@ -73,6 +75,8 @@ module SAWCentral.Value (
rwSetCryptolEnvStack,
-- used by SAWScript.REPL.Monad, SAWServer.SAWServer, SAWServer.Yosys
rwModifyCryptolEnv,
-- used by SAWScript.Interpreter, and implicitly by SAWScript.REPL and Main
TopLevelShellHook, ProofScriptShellHook,
-- used by SAWScript.Automatch, SAWScript.REPL.*, SAWScript.Interpreter,
-- SAWServer.SAWServer
TopLevelRO(..),
Expand Down Expand Up @@ -942,6 +946,17 @@ cryptolPop (CryptolEnvStack _ ces) =
[] -> panic "cryptolPop" ["Cryptol environment scope stack ran out"]
ce : ces' -> CryptolEnvStack ce ces'

-- | Type for the function to start a new REPL in TopLevel.
--
-- Passed down from the REPL code to avoid circular references.
type TopLevelShellHook = TopLevelRO -> TopLevelRW -> IO TopLevelRW

-- | Type for the function to start a new REPL in ProofScript.
--
-- Passed down from the REPL code to avoid circular references.
type ProofScriptShellHook =
TopLevelRO -> TopLevelRW -> ProofState ->
IO (TopLevelRW, ProofState)

-- | TopLevel Read-Only Environment.
data TopLevelRO =
Expand All @@ -952,12 +967,12 @@ data TopLevelRO =
, roProxy :: AIGProxy
, roInitWorkDir :: FilePath
, roBasicSS :: SAWSimpset
, roSubshell :: TopLevel ()
, roSubshell :: TopLevelShellHook
-- ^ An action for entering a subshell. This
-- may raise an error if the current execution
-- mode doesn't support subshells (e.g., the remote API)

, roProofSubshell :: ProofScript ()
, roProofSubshell :: ProofScriptShellHook
-- ^ An action for entering a subshell in proof mode. This
-- may raise an error if the current execution
-- mode doesn't support subshells (e.g., the remote API)
Expand Down
3 changes: 1 addition & 2 deletions saw-core/src/SAWCore/Prim.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module SAWCore.Prim where

import qualified Control.Exception as X
import Data.Bits
import Data.Typeable (Typeable)
import Data.Vector (Vector)
import qualified Data.Vector as V
import Numeric.Natural (Natural)
Expand Down Expand Up @@ -308,7 +307,7 @@ data EvalError
| DivideByZero
| UnsupportedPrimitive String String
| UserError String
deriving (Eq, Typeable)
deriving (Eq)

instance X.Exception EvalError

Expand Down
3 changes: 1 addition & 2 deletions saw-core/src/SAWCore/Term/Raw.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import Data.Hashable
import Data.IntMap (IntMap)
import qualified Data.IntMap as IntMap
import Data.IntSet (IntSet)
import Data.Typeable (Typeable)

import Instances.TH.Lift () -- for instance TH.Lift Text

Expand Down Expand Up @@ -68,7 +67,7 @@ data Term
-- ^ The underlying 'TermF' that this 'Term' wraps. This field "ties the
-- knot" of the 'Term'/'TermF' recursion scheme.
}
deriving (Show, Typeable)
deriving (Show)

instance Hashable Term where
-- The hash of an 'STApp' depends on its not-necessarily-unique
Expand Down
74 changes: 0 additions & 74 deletions saw-script/src/SAWScript/Import.hs

This file was deleted.

Loading
Loading