Stream: Coq users

Topic: Coqtop help


view this post on Zulip kumar (Apr 07 2022 at 16:55):

I'm trying to use coqtop to create a simple definition that creates a function sum

Definition sum (a b : int) : int := a + b.

but I'm getting the following error

Coq < Definition sum (a b : int) : int := a + b.
Toplevel input, characters 22-25:
> Definition sum (a b : int) : int := a + b.
>                       ^^^
Error: The reference int was not found in the current environment.

how do I import int or equivalent Integer library for coq, Thanks!

view this post on Zulip Pierre Castéran (Apr 07 2022 at 16:59):

The simplest way is to replace intwith nat(Peano natural numbers) or Z (library ZArith, integers)

view this post on Zulip Gaëtan Gilbert (Apr 07 2022 at 17:07):

coqtop is not recommended, use vscoq, coqide or proof general instead

view this post on Zulip kumar (Apr 07 2022 at 17:15):

Thanks @Pierre Castéran for the help, I'll try that!

Thanks @Gaëtan Gilbert I use vscode so I'll try and use vscoq, do I need some config files or starter template or I can just create a example.v file and run the code?

view this post on Zulip Paolo Giarrusso (Apr 07 2022 at 18:33):

For a single file, just example.v :-)

view this post on Zulip kumar (Apr 08 2022 at 11:21):

Thanks @Paolo Giarrusso !


Last updated: Jan 28 2023 at 05:02 UTC