Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for GHC 8.10.7 and more modern libraries #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions Language/Boogie/Environment.hs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ data Memory = Memory {
makeLenses ''Memory

-- | Lens that selects a store from memory
type StoreLens = Simple Lens Memory Store
type StoreLens = Lens' Memory Store

-- | Empty memory
emptyMemory = Memory {
Expand Down Expand Up @@ -357,7 +357,7 @@ lookupMapConstraints = lookupGetter (envConstraints.conMaps) []

-- Environment modifications
addProcedureImpl name def env = over envProcedures (M.insert name (lookupProcedure name env ++ [def])) env
addNameConstraint :: Id -> Simple Lens (Environment m) NameConstraints -> Expression -> Environment m -> Environment m
addNameConstraint :: Id -> Lens' (Environment m) NameConstraints -> Expression -> Environment m -> Environment m
addNameConstraint name lens c env = over lens (M.insert name (nub $ c : lookupGetter lens [] name env)) env
addUniqueConst t name env = over (envConstraints.conUnique) (M.insert t (name : lookupUnique t env)) env
addMapConstraint r c env = over (envConstraints.conMaps) (M.insert r (nub $ c : lookupMapConstraints r env)) env
Expand Down
6 changes: 3 additions & 3 deletions Language/Boogie/Interpreter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import Debug.Trace
-- Execute program @p@ in type context @tc@ with solver @solver@ and non-deterministic value generator @generator@, starting from procedure @entryPoint@;
-- concretize passing executions iff @solvePassing@;
-- return the outcome(s) embedded into the solver's monad.
executeProgram :: (Monad m, Functor m) => Program -> Context -> Solver m -> Maybe Int -> Maybe Int -> Bool -> Bool -> Generator m -> Id -> m (TestCase)
executeProgram :: (MonadFail m, Functor m) => Program -> Context -> Solver m -> Maybe Int -> Maybe Int -> Bool -> Bool -> Generator m -> Id -> m (TestCase)
executeProgram p tc solver recMax loopMax concretize_ solvePassing generator entryPoint = result <$> runStateT (runErrorT programExecution) (initEnv tc solver generator recMax loopMax concretize_)
where
programExecution = do
Expand Down Expand Up @@ -878,7 +878,7 @@ checkPostonditions sig def exitPoint = mapM_ (exec . attachPos exitPoint . Predi
{- Evaluating constraints -}

-- | 'extendNameConstraints' @lens c@ : add @c@ as a constraint for all free variables in @c@ to @envConstraints.lens@
extendNameConstraints :: (MonadState (Environment m) s, Finalizer s) => Simple Lens ConstraintMemory NameConstraints -> Expression -> s ()
extendNameConstraints :: (MonadState (Environment m) s, Finalizer s) => Lens' ConstraintMemory NameConstraints -> Expression -> s ()
extendNameConstraints lens c = mapM_ (\name -> modify $ addNameConstraint name (envConstraints.lens) c) (freeVars c)

-- | 'extendMapConstraints' @r c@ : add @c@ to the constraints of the map @r@
Expand Down Expand Up @@ -1179,7 +1179,7 @@ generate f = do
{- Preprocessing -}

-- | Collect procedure implementations, and constant/function/global variable constraints
preprocess :: (Monad m, Functor m) => Program -> SafeExecution m ()
preprocess :: (MonadFail m, Functor m) => Program -> SafeExecution m ()
preprocess (Program decls) = do
mapM_ processDecl decls
fs <- use envFunctions
Expand Down
4 changes: 2 additions & 2 deletions Language/Boogie/TypeChecker.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import qualified Data.Map as M
import Control.Monad.Trans.Error
import Control.Applicative hiding (empty)
import Control.Monad.State
import Control.Lens hiding (Context)
import Control.Lens hiding (Context, locally)

{- Interface -}

Expand Down Expand Up @@ -863,4 +863,4 @@ checkLefts vars n = if length vars /= n
if not (null invalidGlobals)
then throwTypeError (text "Assignment to a global variable that is not in the enclosing procedure's modifies clause:" <+> commaSep (map text invalidGlobals))
else return ()

2 changes: 1 addition & 1 deletion Language/Boogie/Z3/Solver.hs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ newConstraint soln = enot (conjunction (logicEqs ++ customEqs))
neqFold expr = interPair neqOp expr

-- Equality relation on customs.
customEqRel = Map.foldWithKey go Map.empty soln
customEqRel = Map.foldrWithKey go Map.empty soln
where
go ref expr m =
case valueType expr of
Expand Down