aboutsummaryrefslogtreecommitdiff
path: root/ABC
diff options
context:
space:
mode:
Diffstat (limited to 'ABC')
-rw-r--r--ABC/Program.icl9
1 files changed, 3 insertions, 6 deletions
diff --git a/ABC/Program.icl b/ABC/Program.icl
index 4a34ec6..28416bb 100644
--- a/ABC/Program.icl
+++ b/ABC/Program.icl
@@ -18,13 +18,10 @@ pc_end :: InstrId -> Bool
pc_end i = i < 0
:: Location = I Instruction
-:: ProgramStore :== [Location]
+:: ProgramStore :== {Location}
ps_get :: InstrId ProgramStore -> Instruction
-ps_get 0 [I p:_] = p
-ps_get _ [] = abortn "ps_get: index too large"
-ps_get i [_:ps] = ps_get (i-1) ps
+ps_get n p = let (I i) = p.[n] in i
ps_init :: [Instruction] -> ProgramStore
-ps_init [] = []
-ps_init [i:is] = [I i:ps_init is]
+ps_init is = {I i \\ i <- is}