Open msprotz opened 4 years ago
This works by annotating (t:string)
in unroll, which gets rids of the (implicit) universe polymorphism. Definitely a bug though.
(Sorry Zoe.. missed a few keystrokes from my terminal into here and somehow assigned you.)
Argh so this is an oversight on my part, these attributes are not typechecked and hence not elaborated, so the tactics crash. I've made them check at typechecking time, and the postprocess_for_extraction_with
variant can then just run the tactic as-is at extraction. However, this requires to call deep_compress
on the tactic term before passing it along or it will explode when it reaches a uvar node. That almost works, except that we would also need default unconstrained variables to zero, just as we do for top-levels, which begs the question of whether attributes should just always be elaborated... any opinion @nikswamy @aseemr ?
In any case, pushing the current status into master which should cover most uses. See the file below, the last example crashes but I wouldn't expect it to be common.
let unroll t1 t2 () : Tac unit =
T.trefl()
[@@ expect_failure [12];
postprocess_with (unroll (`%int))]
let test0 () : int = 42
[@@ expect_failure [12];
postprocess_for_extraction_with (unroll (`%int))]
let test1 () : int = 42
[@@ postprocess_with (unroll () (`%int))]
let test2 () : int = 42
[@@ postprocess_for_extraction_with (unroll () (`%int))]
let test3 () : int = 42
[@@ postprocess_for_extraction_with (unroll (raise_val ()) (`%int))]
let test4 () : int = 42
Steps to reproduce:
the testcase:
thanks!
Jonathan