Open ohad opened 5 years ago
Oh yes, you'll need to increase the stack size by building with the appropriate flag on Windows (see #117 ) or something like ulimit -s 16000
on Linux.
I haven't checked if it affects this issue, but recently I found and fixed a problem with 'import public', so maybe this is okay now?
$ idris2 --version
Idris 2, version 0.0.0-22a779bc8
$ idris2 -c CMonoids.idr
1/15: Building PreorderReasoning (PreorderReasoning.idr)
2/15: Building VectReasoning (VectReasoning.idr)
3/15: Building Carriers (Carriers.idr)
4/15: Building Signatures (Signatures.idr)
5/15: Building Algebras (Algebras.idr)
6/15: Building Presentations (Presentations.idr)
7/15: Building Models (Models.idr)
8/15: Building Frex (Frex.idr)
9/15: Building Monoids (Monoids.idr)
10/15: Building CMonoids.Axioms (CMonoids/Axioms.idr)
11/15: Building CMonoids.Nat (CMonoids/Nat.idr)
12/15: Building Powers (Powers.idr)
13/15: Building CMonoids.Semiring (CMonoids/Semiring.idr)
14/15: Building CMonoids.Free (CMonoids/Free.idr)
15/15: Building CMonoids (CMonoids.idr)
CMonoids.idr:31:39--32:1:While processing type of CMonoids.CMonoid_free_up_uniqueness at CMonoids.idr:23:1--32:1:
When unifying U (Alg b) and U (Alg b)
Mismatch between:
S (S Z)
and
Z
And in case this is helpful (I added a newline, for readability)
CMonoids> :show_implicits
Parse error: Unrecognised command (next tokens: [identifier show_implicits, end of input])
CMonoids> :set showimplicits
CMonoids> :r
15/15: Building CMonoids (CMonoids.idr)
CMonoids.idr:31:39--32:1:While processing type of CMonoids.CMonoid_free_up_uniqueness at CMonoids.idr:23:1--32:1:
When unifying
U {sig = MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))} (Alg {pres = PRESENTATION MONOID (S (S (S (S Z)))) (:: {len = S (S (S Z))} {elem = Equation (Sig Monoid_Th)} (Eq {sig = MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))} (S (S Z)) (Call {x = Fin (S (S Z))} {sig = MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))} .* (:: {len = S Z} {elem = Term (MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))) (Fin (S (S Z)))} (Done {sig = MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))} {x = Fin (S (S Z))} (FZ {k = S Z})) (:: {len = Z} {elem = Term (MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))) (Fin (S (S Z)))} (Done {sig = MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))} {x = Fin (S (S Z))} (FS {k = S Z} (FZ {k = Z}))) ([] {elem = Term (MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))) (Fin (S (S Z)))})))) (Call {x = Fin (S (S Z))} {sig = MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))} .* (:: {len = S Z} {elem = Term (MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))) (Fin (S (S Z)))} (Done {sig = MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))} {x = Fin (S (S Z))} (FS {k = S Z} (FZ {k = Z}))) (:: {len = Z} {elem = Term (MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))) (Fin (S (S (S (S Z)))))} (Done {sig = MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))} {x = Fin (S (S (S (S Z))))} (FZ {k = S (S (S Z))})) ([] {elem = Term (MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))) (Fin (S (S (S (S Z)))))}))))) (Ax Monoid_Th))} b)
and
U {sig = MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))} (Alg {pres = PRESENTATION MONOID (S (S (S (S Z)))) (:: {len = S (S (S Z))} {elem = Equation (Sig Monoid_Th)} (Eq {sig = MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))} (S (S Z)) (Call {x = Fin (S (S Z))} {sig = MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))} .* (:: {len = S Z} {elem = Term (MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))) (Fin (S (S Z)))} (Done {sig = MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))} {x = Fin (S (S Z))} (FZ {k = S Z})) (:: {len = Z} {elem = Term (MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))) (Fin (S (S Z)))} (Done {sig = MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))} {x = Fin (S (S Z))} (FS {k = S Z} (FZ {k = Z}))) ([] {elem = Term (MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))) (Fin (S (S Z)))})))) (Call {x = Fin (S (S Z))} {sig = MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))} .* (:: {len = S Z} {elem = Term (MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))) (Fin (S (S Z)))} (Done {sig = MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))} {x = Fin (S (S Z))} (FS {k = S Z} (FZ {k = Z}))) (:: {len = Z} {elem = Term (MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))) (Fin (S (S Z)))} (Done {sig = MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))} {x = Fin (S (S Z))} (FZ {k = S Z})) ([] {elem = Term (MkDPair {a = Nat} {p = \n : Nat => Vect n Nat} (S (S Z)) (:: {len = S Z} {elem = Nat} Z (:: {len = Z} {elem = Nat} (S (S Z)) ([] {elem = Nat})))) (Fin (S (S Z)))}))))) (Ax Monoid_Th))} b)
Mismatch between:
S (S Z)
and
Z
Also, commenting out the import CMonoids.Semiring
compiles fine, as in the report above.
(You can see where the two lines start to differ --- I'm not sure whether that's a problem or not, but the import shouldn't affect this, I think.
I'm not sure this is a bug, it's possible my types are not quite right, or that I've used access modifiers the wrong way.
Steps to Reproduce
Download the attached unstable-import.zip and unpack, and build it.
Expected Behavior
Build should complete successfully:
Observed Behavior
so far so good, but if you edit
CMonoids.idr
and change line 16 onward as follows, moving the import ofCMonoids.Semiring
two imports down:then everything type-checks fine:
This can also be expected if somehow these modules exported an ambiguity in definitions, but I think they don't.