CakeML / CakeML/cakeml

xlet_auto should work with literals

Open
#1,313 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Standard ML
Stars
1.2k
Forks
104
Avg merge
2d 21h
Merged PRs (30d)
16

Description

xlet_auto doesn't work with literals.
e.g. given a goal like this
```
cf_let (SOME «a») (cf_lit (IntLit 3)) (cf_var (Short «a»))
(extend_env_rec [«example_let0»] [example_let0_v] [«n»] [nv]
(merge_env empty_env init_env)) emp (POSTv v. &INT 3 v)
```
applying xlet_auto fails
the examples folder has a example which shows the manual spec being written
```
fun xcf' s = xcf_with_def (DB.fetch "-" (s ^ "_v_def"))

Quote add_cakeml:
fun example_let0 n = let val a = 3; in a end
End

val example_let0_v_def = DB.fetch "-" "example_let0_v_def"

Theorem example_let0_spec[local]:
!nv. app (p:'ffi ffi_proj) example_let0_v [nv] emp (POSTv v. & INT 3 v)
Proof
strip_tac \\ xcf' "example_let0" \\ xlet `POSTv a. & INT 3 a`
THEN1 (xret \\ xsimpl) \\
xret \\ xsimpl
QED
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.