coq - 如何将符号范围绑定到类型
问题描述
考虑以下玩具开发:
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.
基于 Adam Chlipala 的Certified Programming with Dependent Types,我本以为它的一些变体可以解析A |- B
为entails A B
任何时候A
并且B
已知为nat
. 但这不会发生。知道为什么吗?
解决方案
您可能想要打开新引入的范围
Open Scope entails_scope.
Goal exists (A B: nat), A |- B.
或明确指定
Delimit Scope entails_scope with E.
Goal exists (A B: nat), (A |- B)%E.
推荐阅读
- math - DirectX 9 中的 D3DXMatrixRotationQuaternion:此函数如何操作
- c# - 在 Windows 窗体中用 C# 操作多数组中的数据
- r - 合并两个太大的地块
- python-3.x - 复制和格式化子字典
- python-3.x - 如何在不使用 json 和 python 酸洗的情况下将对象写入文件并将其读回?
- c# - 如何从另一种形式获取枚举
- excel - 防止特殊字符,但允许使用空格进行数据验证
- java - Java acm ComplexNumber 类无法实例化?
- html - 设置元素相对于父元素的高度 - 其中父元素是弹性框的一部分
- user-management - 在 express-gateway 中创建用户