Types Idris中是否存在宇宙不一致的非平凡例子?
我问了一个关于伊德里斯的宇宙类型检查方法的问题。现在我正在尝试一些可能导致宇宙不一致的例子。这是我能想到的最简单的一个Types Idris中是否存在宇宙不一致的非平凡例子?,types,idris,Types,Idris,我问了一个关于伊德里斯的宇宙类型检查方法的问题。现在我正在尝试一些可能导致宇宙不一致的例子。这是我能想到的最简单的一个 foo : Type foo = Type bar : Main.foo bar = Main.foo 输出错误为: test.idr:2:5:Universe inconsistency. Working on: z Old domain: (4,4) New domain: (4,3) Involved c
foo : Type
foo = Type
bar : Main.foo
bar = Main.foo
输出错误为:
test.idr:2:5:Universe inconsistency.
Working on: z
Old domain: (4,4)
New domain: (4,3)
Involved constraints:
ConstraintFC {uconstraint = z <= w, ufc = test.idr:2:5}
ConstraintFC {uconstraint = y < z, ufc = test.idr:2:5}
ConstraintFC {uconstraint = z <= w, ufc = test.idr:2:5}
test.idr:2:5:Universe不一致性。
工作地点:z
旧域:(4,4)
新域:(4,3)
涉及的限制:
ConstraintFC{uconstraint=z我能想到的是Girard悖论,它会导致宇宙不一致。然而,我想不出任何真实世界中使用宇宙不一致atm的例子。测试套件中有一个:
我觉得很难偶然地做这种事情:)。在我的一个durp时刻,我想到了一个
equalTypesCommute -> x=y -> (x=y)=(y=x)
equalTypesCommute Refl = Refl
这个,当然,爆炸了:)我刚刚偶然发现了这个。这是一个很自然的定义,所以它真的很令人惊讶
Subset : Type -> Type
Subset a = a -> Type
Family : Type -> Type
Family a = Subset (Subset a)
familyIntersection : Family a -> Subset a
familyIntersection {a} f x = (u : Subset a) -> f u -> u x
这将给出输出(对于idris--check
):
test.idr:2:12-20:
|
2 |子集a=a->类型
| ~~~~~~~~~
宇宙不一致。
处理:./test.idr.l1
旧域:(4,4)
新域:(4,3)
涉及的限制:
ConstraintFC{uconstraint=./test.idr.l1<./test.idr.m1,ufc=test.idr:2:12-20}
ConstraintFC{uconstraint=./test.idr.l1<./test.idr.m1,ufc=test.idr:2:12-20}
ConstraintFC{uconstraint=./test.idr.v2
test.idr:2:12-20:
|
2 | Subset a = a -> Type
| ~~~~~~~~~
Universe inconsistency.
Working on: ./test.idr.l1
Old domain: (4,4)
New domain: (4,3)
Involved constraints:
ConstraintFC {uconstraint = ./test.idr.l1 < ./test.idr.m1, ufc = test.idr:2:12-20}
ConstraintFC {uconstraint = ./test.idr.l1 < ./test.idr.m1, ufc = test.idr:2:12-20}
ConstraintFC {uconstraint = ./test.idr.v2 <= ./test.idr.l1, ufc = test.idr:8:30-57}