The patch seems to be a little non-trivial however. Jasmin uses a lot of Let _ := blah
in their code, however the vernacular command Let
seems to take in an ident whilst let
takes in a name which can be an underscore.
Ident was changed to not allow underscores
Changing the Let to let doesn't quite workout in Jasmin however
Should I change Let to take a name rather than an ident?
I guess for now I can patch Jasmin to give a name. It seems strange that we don't want Let _ := foo
as valid syntax however.
Perhaps for the best.
Ali Caglayan said:
Should I change Let to take a name rather than an ident?
y
I've done this but now I have an issue
Which is name shadowing
Unnamed_thm already exists.
How can I freshen this name?
Looks like we have in vernacentries:
let default_thm_id = Id.of_string "Unnamed_thm"
let fresh_name_for_anonymous_theorem () =
Namegen.next_global_ident_away default_thm_id Id.Set.empty
Am I reading this wrong or is this quite useless?
it's freshened at the start of the proof instead of at the end so this error can happen with nested proofs
are they using nested proofs?
I am not even at Jasmin yet
I tried this in let_universe:
Section S.
Let bla@{} := Prop.
Let bli@{u} := Type@{u}.
Fail Let blo@{} := Type.
Let _@{} := Prop.
Let _@{u} := Type@{u}.
Fail Let blo@{} := Type.
End S.
this isn't nested
We fail on the second let _ since the name was given before
I can push a draft PR if you want to take a look
https://github.com/coq/coq/pull/15900
No issues when done inside a nested proof
Seems to be a section issue
But that seems to be different since the semantics of Let changes then.
Which means my patch allows somebody to do an anonymous definition using Let _ being turned into "Definition _"
:/
I thought Let was some jasmin notation
No this is the vernacular Let
Unless I missed it in the Jasmin code
that's no vernacular
vernacular Let should continue rejecting _
OK, but where is this defined then
(Goal is parsed as Lemma _
so it's getting confused)
don't know, run it and do Print Notation
Found it
178 of utils.v
Changed ident to name everything works now
That confused me way more than it should have
:upside_down:
Sorry about that, thanks a lot for the fix.
Last updated: Sep 15 2024 at 12:01 UTC