summaryrefslogtreecommitdiff
path: root/assignment-13/uFPL/Sim.dcl
diff options
context:
space:
mode:
Diffstat (limited to 'assignment-13/uFPL/Sim.dcl')
-rw-r--r--assignment-13/uFPL/Sim.dcl37
1 files changed, 12 insertions, 25 deletions
diff --git a/assignment-13/uFPL/Sim.dcl b/assignment-13/uFPL/Sim.dcl
index f30e107..b4d8528 100644
--- a/assignment-13/uFPL/Sim.dcl
+++ b/assignment-13/uFPL/Sim.dcl
@@ -2,8 +2,6 @@ definition module uFPL.Sim
from Data.Map import :: Map
-import iTasks
-
import uFPL
from uFPL.C import :: Signedness
@@ -11,12 +9,10 @@ from uFPL.C import :: Signedness
= LiftException String
| NoShareException ISharedRef
| WriteToROShare ISharedRef
+ | RunException
instance toString UFPLException
-class lift a :: a -> Task Dynamic
-class unlift a b :: b -> a
-
:: ReadOrWrite = ReadOnly | ReadWrite
:: IShared
@@ -60,26 +56,17 @@ class unlift a b :: b -> a
:: INamedRule = Rule String [IRule]
-:: IState =
- { isvalues :: Map String Int
- , uisvalues :: Map String Int
- , lsvalues :: Map String Int
- , ulsvalues :: Map String Int
- , bsvalues :: Map String Bool
+:: IShareState t =
+ { isval :: t
+ , isdirty :: Int
+ , issubscriptions :: Int
}
-derive class iTask Signedness, CType, ReadOrWrite, IShared, IExpr, ITrigger,
- IRule, INamedRule, IState
-
-instance lift [a] | lift a
-instance unlift [a] [b] | unlift a b
-instance lift IExpr
-instance unlift IExpr (Expr t rw) | Expr t
-instance lift ITrigger
-instance unlift ITrigger Trigger
-instance lift IRule
-instance unlift IRule Rule
-instance lift INamedRule
-instance unlift INamedRule NamedRule
+:: IState =
+ { isvalues :: Map String (IShareState Int)
+ , csvalues :: Map String (IShareState Char)
+ , bsvalues :: Map String (IShareState Bool)
+ , display :: Display
+ }
-simulate :: [NamedRule] -> Task ()
+simulate :: [NamedRule] -> *World -> *World