geolog-zeta-fork/examples/geolog/iso_instance_test.geolog

30 lines
492 B
Plaintext
Raw Normal View History

2026-02-26 11:50:51 +01:00
// Multi-parameter theory instantiation test
theory (X : Sort) (Y : Sort) Iso {
fwd : X -> Y;
bwd : Y -> X;
fb : forall x : X. |- x fwd bwd = x;
bf : forall y : Y. |- y bwd fwd = y;
}
theory A { a : Sort; }
theory B { b : Sort; }
instance As : A = {
a1 : a;
a2 : a;
}
instance Bs : B = {
b1 : b;
b2 : b;
}
// Can we create an Iso instance with sort parameters?
instance AB_Iso : As/a Bs/b Iso = {
a1 fwd = Bs/b1;
a2 fwd = Bs/b2;
b1 bwd = As/a1;
b2 bwd = As/a2;
}