Last active
July 5, 2018 06:29
-
-
Save xrchz/6d981bcf4bcb3ebaae33b6bdcf931e04 to your computer and use it in GitHub Desktop.
A simple CakeML CF spec involving references
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open preamble basis | |
val _ = translation_extends "basisProg"; | |
val ex2 = process_topdecs` | |
fun ex2 x r = let val r' = ref r in r := x; !r' end`; | |
val () = append_prog ex2; | |
val st2 = get_ml_prog_state(); | |
val ex2_spec = Q.prove(` | |
!xv rv. | |
app (p:'ffi ffi_proj) ^(fetch_v "ex2" st2) [xv; rv] | |
(REF rv x'v) (POSTv v. SEP_EXISTS r'v. & (v = rv) * REF rv xv * REF r'v rv)`, | |
xcf "ex2" st2 \\ | |
xlet `POSTv r'v. REF rv x'v * REF r'v rv` THEN1 (xref \\ xsimpl) \\ | |
xlet `POSTv uv. &UNIT_TYPE () uv * REF rv xv * REF r'v rv` | |
>- ( xapp \\ xsimpl ) | |
\\ xapp | |
\\ xsimpl | |
\\ qexists_tac`r'v` | |
\\ xsimpl); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment