From 89dcf0fe61154a9d93dd3b25b5144ad89d936547 Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Fri, 1 Dec 2017 10:03:02 -0800 Subject: [PATCH] Don't allow evaluating to Type after all Evaluating to types should always use evalCache rather than evaluate. Using evaluate will infinite loop on recursive programs. - @robrix --- src/Analysis/Abstract/Evaluating.hs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Analysis/Abstract/Evaluating.hs b/src/Analysis/Abstract/Evaluating.hs index 2a4a7dadb..b192cc248 100644 --- a/src/Analysis/Abstract/Evaluating.hs +++ b/src/Analysis/Abstract/Evaluating.hs @@ -6,8 +6,6 @@ import Control.Monad.Effect hiding (run) import Control.Monad.Effect.Address import Control.Monad.Effect.Env import Control.Monad.Effect.Fail -import Control.Monad.Effect.Fresh -import Control.Monad.Effect.NonDet import Control.Monad.Effect.Reader import Control.Monad.Effect.State import Control.Monad.Effect.Store @@ -21,16 +19,13 @@ import Data.Functor.Foldable (Base, Recursive(..)) import Data.Semigroup import Data.Set -type Interpreter v = '[Fail, State (Store (LocationFor v) v), Reader (Set (Address (LocationFor v) v)), NonDetEff, Fresh, Reader (Environment (LocationFor v) v)] +type Interpreter v = '[Fail, State (Store (LocationFor v) v), Reader (Set (Address (LocationFor v) v)), Reader (Environment (LocationFor v) v)] type MonadInterpreter v m = (MonadEnv v m, MonadStore v m, MonadFail m) type EvalResult v = Final (Interpreter v) v --- Evaluate an expression. --- Example: --- evaluate @Type --- evaluate @(Value (Data.Union.Union Language.Python.Assignment2.Syntax) (Record Location) Precise) +-- | Evaluate a term to a value. evaluate :: forall v term . ( Ord v , Ord (Cell (LocationFor v) v)