语言环境定义产生两个解析树

Locale definition produces two parse trees

这是我在 Isabelle 中的简单语言环境定义:

locale sig =
  fixes le:: "'a ⇒ 'a ⇒ bool" (infixl "≤" 50)
  assumes refl: "x ≤ x"

现在,我收到一条错误消息:

Ambiguous input⌂ produces 2 parse trees:
  ("\<^const>HOL.Trueprop"
    ("\<^const>Orderings.ord_class.less_eq" ("_position" x) ("_position" x)))
  ("\<^const>HOL.Trueprop" ("\<^fixed>le" ("_position" x) ("_position" x)))
Ambiguous input
2 terms are type correct:
  (x ≤ x)
  (x ≤ x)
Failed to parse prop

我与内置的小于或等于运算符有冲突吗?

我该如何解决这个问题?

运算符在 ord 类型 class 中定义,因此您可以扩展此 class:

class sig = ord +
  assumes refl: "x ≤ x"

其他选择:

  • 不导入 ord
  • 的定义
  • no_notation Orderings.ord_class.less_eq ("(_/ ≤ _)" [51, 51] 50) 隐藏现有符号(参见
  • 使用不同的名称或符号