Skip to Content.
Sympa Menu

coq-club - [Coq-Club] difficulty computing with integers in Ltac

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] difficulty computing with integers in Ltac


Chronological Thread 
  • From: Jonathan <jonikelee AT gmail.com>
  • To: Coq Club <coq-club AT inria.fr>
  • Subject: [Coq-Club] difficulty computing with integers in Ltac
  • Date: Mon, 01 Dec 2014 16:22:43 -0500

The following works:

Goal True.
let N := 3 in do N idtac 0.
Abort.

It produces 3 lines of "0".

So, why doesn't the following work?:

Goal True.
let N := eval compute in (1 + 2) in do N idtac 0.
Abort.

It produces the error: "Error: Ltac variable N is bound to a term which cannot be coerced to an integer.", with CoqIDE underlining the N in "do N idtac 0" as the source of the error.

How does one compute with integers in Ltac?

-- Jonathan




Archive powered by MHonArc 2.6.18.

Top of Page