Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lia does not work again (for a different reason) #201

Closed
corwin-of-amber opened this issue Sep 13, 2020 · 6 comments
Closed

lia does not work again (for a different reason) #201

corwin-of-amber opened this issue Sep 13, 2020 · 6 comments
Milestone

Comments

@corwin-of-amber
Copy link
Member

corwin-of-amber commented Sep 13, 2020

This code:

Require Import Lia.

Example silly_presburger_example : forall m n o p,
  m + n <= n + o /\ o + 3 = p + 3 ->
  m <= p.
Proof.
  intros. lia.
Qed.

Works fine until the Qed, but then throws:

Anomaly
"Uncaught exception Error: vm trap: 'coq_set_bytecode_field' not implemented."
Please report at http://coq.inria.fr/bugs/.

Somehow the bytecode compiler is invoked here. Not sure why.

@corwin-of-amber
Copy link
Member Author

I think I traced it (or at least part of it): it looks like coq_mircromega.ml checks term in the environment Refiner.pf_env.

https://github.com/coq/coq/blob/282bf5806ca861ca7649bdd8555cba2b2130a3d7/plugins/micromega/coq_micromega.ml#L1673

Which is defined here.

https://github.com/coq/coq/blob/282bf5806ca861ca7649bdd8555cba2b2130a3d7/proofs/refiner.ml#L25

This last let is called before we Global.set_VM false, so probably this environment has enable_VM set.

@ejgallego
Copy link
Member

Where is enable_VM set? IIRC configure should totally disable it.

Did you build that jscoq version with the right configure magic? If so, that'd be an upstream bug.

@ejgallego
Copy link
Member

I see, indeed introduced in #196 , 5a2c448

@corwin-of-amber
Copy link
Member Author

Thanks to @ppedrot for providing valuable counsel on Zulip 😄

@corwin-of-amber
Copy link
Member Author

BTW he confirms that indeed there is a bug upstream: bytecode compiler should not have been invoked even with the mess I made, due to the configure flag -- but Vconv does not test for that flag.

corwin-of-amber added a commit to corwin-of-amber/jscoq that referenced this issue Sep 14, 2020
Lib.init() resets the global env. So all the flags etc. must be set after it.

Fixes jscoq#201.
@ejgallego
Copy link
Member

Real problem is that we Coq doesn't provide the right API for toplevels to perform initialization, hopefully that will change soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants