cakeml icon indicating copy to clipboard operation
cakeml copied to clipboard

The translator accepts constants with preconditions

Open oskarabrahamsson opened this issue 6 years ago • 0 comments

The translator accepts constants with preconditions, and duplicates preconditions:

> val foo_def = Define` foo = 5 DIV 0`;

Definition has been stored under "foo_def"
val foo_def =  [] ⊢ foo = 5 DIV 0: thm
> val th = translate foo_def;

Translating foo

WARNING: foo has a precondition.

val th =  [foo_side, PRECONDITION foo_side] ⊢ NUM foo foo_v: thm

What's worse, the precondition also leaks into the theorem produced by ml_progLib:

> get_ml_prog_state() |> ml_progLib.get_thm;
val it =  [foo_side] ⊢ ... ... [... ] (scratch_st ffi): thm

oskarabrahamsson avatar Nov 18 '19 11:11 oskarabrahamsson