Skip to content
Snippets Groups Projects
Commit 81c01a0e authored by Ralf Jung's avatar Ralf Jung
Browse files

typing/tests: make all the functions values as they should be

parent 97bb9b8b
No related branches found
No related tags found
No related merge requests found
...@@ -7,11 +7,11 @@ Set Default Proof Using "Type". ...@@ -7,11 +7,11 @@ Set Default Proof Using "Type".
Section get_x. Section get_x.
Context `{typeG Σ}. Context `{typeG Σ}.
Definition get_x := Definition get_x : val :=
(funrec: <> ["p"] := funrec: <> ["p"] :=
let: "p'" := !"p" in let: "p'" := !"p" in
letalloc: "r" := "p'" + #0 in letalloc: "r" := "p'" + #0 in
delete [ #1; "p"] ;; "return" ["r":expr])%E. delete [ #1; "p"] ;; "return" ["r":expr].
Lemma get_x_type : Lemma get_x_type :
typed_instruction_ty [] [] [] get_x typed_instruction_ty [] [] [] get_x
......
...@@ -7,12 +7,12 @@ Set Default Proof Using "Type". ...@@ -7,12 +7,12 @@ Set Default Proof Using "Type".
Section rebor. Section rebor.
Context `{typeG Σ}. Context `{typeG Σ}.
Definition init_prod := Definition init_prod : val :=
(funrec: <> ["x"; "y"] := funrec: <> ["x"; "y"] :=
let: "x'" := !"x" in let: "y'" := !"y" in let: "x'" := !"x" in let: "y'" := !"y" in
let: "r" := new [ #2] in let: "r" := new [ #2] in
"r" + #0 <- "x'";; "r" + #1 <- "y'";; "r" + #0 <- "x'";; "r" + #1 <- "y'";;
delete [ #1; "x"] ;; delete [ #1; "y"] ;; "return" ["r":expr])%E. delete [ #1; "x"] ;; delete [ #1; "y"] ;; "return" ["r":expr].
Lemma init_prod_type : Lemma init_prod_type :
typed_instruction_ty [] [] [] init_prod typed_instruction_ty [] [] [] init_prod
......
...@@ -7,8 +7,8 @@ Set Default Proof Using "Type". ...@@ -7,8 +7,8 @@ Set Default Proof Using "Type".
Section rebor. Section rebor.
Context `{typeG Σ}. Context `{typeG Σ}.
Definition rebor := Definition rebor : val :=
(funrec: <> ["t1"; "t2"] := funrec: <> ["t1"; "t2"] :=
Newlft;; Newlft;;
letalloc: "x" := "t1" in letalloc: "x" := "t1" in
let: "x'" := !"x" in let: "y" := "x'" + #0 in let: "x'" := !"x" in let: "y" := "x'" + #0 in
...@@ -16,7 +16,7 @@ Section rebor. ...@@ -16,7 +16,7 @@ Section rebor.
let: "y'" := !"y" in let: "y'" := !"y" in
letalloc: "r" := "y'" in letalloc: "r" := "y'" in
Endlft ;; delete [ #2; "t1"] ;; delete [ #2; "t2"] ;; Endlft ;; delete [ #2; "t1"] ;; delete [ #2; "t2"] ;;
delete [ #1; "x"] ;; "return" ["r":expr])%E. delete [ #1; "x"] ;; "return" ["r":expr].
Lemma rebor_type : Lemma rebor_type :
typed_instruction_ty [] [] [] rebor typed_instruction_ty [] [] [] rebor
......
...@@ -7,11 +7,11 @@ Set Default Proof Using "Type". ...@@ -7,11 +7,11 @@ Set Default Proof Using "Type".
Section unbox. Section unbox.
Context `{typeG Σ}. Context `{typeG Σ}.
Definition unbox := Definition unbox : val :=
(funrec: <> ["b"] := funrec: <> ["b"] :=
let: "b'" := !"b" in let: "bx" := !"b'" in let: "b'" := !"b" in let: "bx" := !"b'" in
letalloc: "r" := "bx" + #0 in letalloc: "r" := "bx" + #0 in
delete [ #1; "b"] ;; "return" ["r":expr])%E. delete [ #1; "b"] ;; "return" ["r":expr].
Lemma ubox_type : Lemma ubox_type :
typed_instruction_ty [] [] [] unbox typed_instruction_ty [] [] [] unbox
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment