1

Consider the following toy development:

Declare Scope entails_scope.
Bind Scope entails_scope with nat.

Reserved Notation "A |- B" (at level 60, no associativity).
Inductive entails: nat -> nat -> Prop :=
| id {A}: A |- A

where "A |- B" := (entails A B) : entails_scope.

(* Fails with message: 'Unknown interpretation for notation "_ |- _".' *)
Fail Goal exists (A B: nat), A |- B.

Based on Adam Chlipala's Certified Programming with Dependent Types, I would have expected some variant of this to parse A |- B as entails A B whenever A and B are known to be nat. But this doesn't happen. Any idea why?

Carl Patenaude Poulin
  • 6,238
  • 5
  • 24
  • 46

1 Answers1

1

You might want to either open the newly introduce scope

Open Scope entails_scope.
Goal exists (A B: nat), A |- B.

or specify it explicitly

Delimit Scope entails_scope with E.
Goal exists (A B: nat), (A |- B)%E.
Anton Trunov
  • 15,074
  • 2
  • 23
  • 43
  • If I open the scope then it clashes with the notation for Ltac goal matching, which is what I was trying to avoid by tying this notation to a scope. The alternative would be to use Delimit Scope, but then I don't understand what the point of Bind Scope is. – Carl Patenaude Poulin Apr 09 '20 at 22:54
  • FWIW, `Bind Scope entails_scope with nat.` just changes the scope of the arguments of `entails`: `Arguments entails _%entails_scope _%entails_scope`. Without `Bind Scope` it would be `Arguments entails _%nat_scope _%nat_scope`. – Anton Trunov Apr 10 '20 at 19:43