0

Consider the sample code:

Require Import BinNat.
Open Scope N.

Check (N.ones).
(* Error: The reference ones
   was not found in the current environment. *)
Check (ones).

How do I import BinNat in such a way that I don't have to resolve ones to N.ones?

Siddharth Bhat
  • 823
  • 5
  • 15

1 Answers1

1

The Import command can help:

From Coq Require Import BinNat.
Import N.
About ones.
Anton Trunov
  • 15,074
  • 2
  • 23
  • 43
  • Ah, So, what *are* the precise semantics of `Import` versus `Require Import`, and what is this called? "name resolution"? "scopes"? I couldn't find this in the Coq manual – Siddharth Bhat Aug 22 '18 at 13:31
  • 1
    Please take a look at [this anwer](https://stackoverflow.com/a/47973622/2747511) or [this one](https://stackoverflow.com/a/33857656/2747511). HTH – Anton Trunov Aug 22 '18 at 13:33
  • 1
    For future reference of anyone who stumbles on this: Semantics of Import: https://coq.inria.fr/refman/language/gallina-extensions.html#coq:cmd.import Semantics of Require: https://coq.inria.fr/refman/proof-engine/vernacular-commands.html?highlight=import#coq:cmd.require – Siddharth Bhat Aug 22 '18 at 14:16