You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 1, 2025. It is now read-only.
@@ -28,6 +28,7 @@ import qualified Data.IntSet as IntSet
28
28
importData.Loc
29
29
importqualifiedData.MapasMap
30
30
importData.Name
31
+
importData.Semigroup (Last (..))
31
32
importqualifiedData.SetasSet
32
33
importData.Term
33
34
importData.Text (Text, pack)
@@ -47,6 +48,8 @@ data Concrete
47
48
| StringText
48
49
| RecordEnv
49
50
deriving (Eq, Ord, Show)
51
+
-- NB: We derive the 'Semigroup' instance for 'Concrete' to take the second argument. This is equivalent to stating that the return value of an imperative sequence of statements is the value of its final statement.
-- NB: Combining the results of the evaluations allows us to model effects in abstract domains. This in turn means that we can define an abstract domain modelling the types-and-effects of computations by means of a 'Semigroup' instance which takes the type of its second operand and the union of both operands’ effects.
46
+
--
47
+
-- It’s also worth noting that we use a semigroup instead of a semilattice because the lattice structure of our abstract domains is instead modelled by nondeterminism effects used by some of them.
48
+
a :>> b ->(<>)<$> eval a <*> eval b
45
49
Named (Ignored n) a :>>= b ->do
46
50
a' <- eval a
47
51
addr <- alloc n
48
52
assign addr a'
49
-
bind n addr (eval (instantiate1 (pure n) b))
53
+
bind n addr ((a' <>) <$>eval (instantiate1 (pure n) b))
50
54
Lam (Named (Ignored n) b) -> abstract eval n (instantiate1 (pure n) b)
-- FIXME: Union the effects/annotations on the operands.
49
+
50
+
--| We derive the 'Semigroup' instance for types to take the second argument. This is equivalent to stating that the type of an imperative sequence of statements is the type of its final statement.
0 commit comments