@@ -89,6 +89,8 @@ import qualified Control.Monad.Fail as Fail
8989import Control.Monad.Trans.Except
9090import Control.Monad.Trans.Class
9191import Control.Monad.IO.Class
92+ import qualified Data.IntMap as IntMap
93+ import Data.IntMap (IntMap )
9294import qualified Data.Map as Map
9395import Data.Map (Map )
9496import Data.Maybe (fromMaybe )
@@ -147,8 +149,8 @@ data OverrideState' sym ext = OverrideState
147149 { -- | Substitution for memory allocations
148150 _setupValueSub :: Map AllocIndex (MS. Pointer' ext sym )
149151
150- -- | Substitution for SAW Core external constants
151- , _termSub :: Map VarIndex Term
152+ -- | Substitution for SAW Core external constants, keyed by 'VarIndex'
153+ , _termSub :: IntMap Term
152154
153155 -- | Equalities of SAW Core terms. The four elements of each tuple are:
154156 --
@@ -193,7 +195,7 @@ initialState ::
193195 sym {- ^ simulator -} ->
194196 Crucible. SymGlobalState sym {- ^ initial global variables -} ->
195197 Map AllocIndex (Pointer' ext sym ) {- ^ initial allocation substituion -} ->
196- Map VarIndex Term {- ^ initial term substituion -} ->
198+ IntMap Term {- ^ initial term substitution -} ->
197199 Set VarIndex {- ^ initial free terms -} ->
198200 W4. ProgramLoc {- ^ location information for the override -} ->
199201 OverrideState' sym ext
@@ -433,7 +435,7 @@ runOverrideMatcher ::
433435 sym {- ^ simulator -} ->
434436 Crucible. SymGlobalState sym {- ^ initial global variables -} ->
435437 Map AllocIndex (Pointer' ext sym ) {- ^ initial allocation substitution -} ->
436- Map VarIndex Term {- ^ initial term substitution -} ->
438+ IntMap Term {- ^ initial term substitution -} ->
437439 Set VarIndex {- ^ initial free variables -} ->
438440 W4. ProgramLoc {- ^ override location information -} ->
439441 OverrideMatcher' sym ext md m a {- ^ matching action -} ->
@@ -531,7 +533,7 @@ enforceCompleteSubstitution loc ss =
531533
532534 let -- predicate matches terms that are not covered by the computed
533535 -- term substitution
534- isMissing tt = ecVarIndex (tecExt tt) `Map .notMember` sub
536+ isMissing tt = ecVarIndex (tecExt tt) `IntMap .notMember` sub
535537
536538 -- list of all terms not covered by substitution
537539 missing = filter isMissing (view MS. csFreshVars ss)
@@ -545,8 +547,8 @@ refreshTerms ::
545547 MS. StateSpec ext {- ^ current phase spec -} ->
546548 OverrideMatcher ext w ()
547549refreshTerms sc ss =
548- do extension <- Map . fromList <$> traverse freshenTerm (view MS. csFreshVars ss)
549- OM (termSub %= Map . union extension)
550+ do extension <- IntMap . fromList <$> traverse freshenTerm (view MS. csFreshVars ss)
551+ OM (termSub %= IntMap . union extension)
550552 where
551553 freshenTerm (TypedExtCns _cty ec) =
552554 do ec' <- liftIO $ scFreshEC sc (toShortName (ecName ec)) (ecType ec)
0 commit comments