### Fix the asserts in translation.v

parent 4bfe6d95
 ... @@ -30,13 +30,13 @@ Definition a_free : val := λ: "x", ... @@ -30,13 +30,13 @@ Definition a_free : val := λ: "x", let: "l" := Fst "v" in let: "l" := Fst "v" in let: "i" := Snd "v" in let: "i" := Snd "v" in match: !"l" with match: !"l" with NONE => assert #false (* double free *) NONE => assert: #false (* double free *) | SOME "l" => | SOME "l" => (* We need to make sure `i = 0` and that all `0 ... length of block` are (* We need to make sure `i = 0` and that all `0 ... length of block` are unlocked. TODO: this means we need to change the spec of `alloc` back so unlocked. TODO: this means we need to change the spec of `alloc` back so that we can actually establish we initially have the pointer to the first that we can actually establish we initially have the pointer to the first element of the array. *) element of the array. *) assert ("i" = #0);; assert: ("i" = #0);; let: "n" := llength "l" in let: "n" := llength "l" in a_free_check "env" "l" #0 "n" a_free_check "env" "l" #0 "n" "l" <- NONE "l" <- NONE ... @@ -51,7 +51,7 @@ Definition a_store : val := λ: "x1" "x2", ... @@ -51,7 +51,7 @@ Definition a_store : val := λ: "x1" "x2", let: "v" := Snd "vv" in let: "v" := Snd "vv" in mset_add ("l", "i") "env" ;; mset_add ("l", "i") "env" ;; match: !"l" with match: !"l" with NONE => assert #false (* store after free *) NONE => assert: #false (* store after free *) | SOME "ll" => "l" <- SOME (linsert "i" "v" "ll") ;; "v" | SOME "ll" => "l" <- SOME (linsert "i" "v" "ll") ;; "v" end end ). ). ... @@ -64,7 +64,7 @@ Definition a_load : val := λ: "x", ... @@ -64,7 +64,7 @@ Definition a_load : val := λ: "x", let: "i" := Snd "v" in let: "i" := Snd "v" in assert: (mset_member ("l", "i") "env" = #false);; assert: (mset_member ("l", "i") "env" = #false);; match: !"l" with match: !"l" with NONE => assert #false (* load after free *) NONE => assert: #false (* load after free *) | SOME "ll" => llookup "i" "ll" | SOME "ll" => llookup "i" "ll" end end ). ). ... ...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!