Comments (7)
I think it's the program
from aya-dev.
The error is now
Error: Cannot check the expression of type
Path (λ _9 ⇒ Nat) (hfill2d {Nat} {suc (add n (mul' m (suc n)))} {suc (add
n (mul' m (suc n)))} {suc (add (add m n) (mul' m n))} {suc (add n (mul' m (suc
n)))} (idp {Nat} suc (add n (mul' m (suc n)))) (idp {Nat} suc (add n (mul'
m (suc n)))) (*'-suc-suc m n) right left) (hfill2d {Nat} {suc (add n (mul'
m (suc n)))} {suc (add n (mul' m (suc n)))} {suc (add (add m n) (mul' m n))}
{suc (add n (mul' m (suc n)))} (idp {Nat} suc (add n (mul' m (suc n)))) (idp
{Nat} suc (add n (mul' m (suc n)))) (*'-suc-suc m n) right right)
(Normalized: Path (λ _9 ⇒ Nat) (suc (add (add m n) (mul' m n))) (suc (add
n (mul' m (suc n)))))
against the type
Eq {Nat} (suc (add (add m n) (mul' m n))) (mul' (suc m) (suc n))
(Normalized: Path (λ i ⇒ Nat) (suc (add (add m n) (mul' m n))) (suc (add n
(mul' m (suc n)))))
from aya-dev.
The end points of the path now agree, but I'll continue to investigate the case.
from aya-dev.
The end points of the path now agree, but I'll continue to investigate the case.
I think the trace would be very helpful
from aya-dev.
During normalization, the end points don't actually agree (despite when reporting the error, they agree again...). One is still incorrectly reduced to (suc (add n (add m (mul' m n))))
instead of the correct (suc (add (add m n) (mul' m n)))
. Interesting. I'll try to find the real problem here tomorrow.
from aya-dev.
🤷♀️
from aya-dev.
Here is a simpler (non-working) example:
prim I
prim left
prim right
struct Path (A : I -> Type) (a : A left) (b : A right) : Type
| at (i : I) : A i {
| left => a
| right => b
}
def path {A : I -> Type} (p : Pi (i : I) -> A i)
=> new Path A (p left) (p right) { | at i => p i }
def `=` Eq {A : Type} (a b : A) : Type => Path (\ i => A) a b
def idp {A : Type} (a : A) : a = a => path (\ i => a)
bind = looser application
prim arcoe
def hfill2d {A : Type}
{a b c d : A}
(p : a = b)
(q : b = d)
(r : a = c)
(i j : I) : A
=> (arcoe (\ k => (r.at k) = (q.at k)) p i).at j
def hcomp2d {A : Type}
{a b c d : A}
(p : a = b)
(q : b = d)
(r : a = c) : c = d
=> path (hfill2d p q r right)
def pmap {A B : Type} (f : A -> B) {a b : A} (p : a = b)
: f a = f b => path (\ i => f (p.at i))
open data Nat : Type
| zero
| suc Nat
def `+` add (m n : Nat) : Nat
| zero, n => n
| n, zero => n
| suc m, n => suc (add m n)
| m, suc n => suc (add m n)
bind + tighter =
def +-comm (x y : Nat) : x + y = y + x
| zero, n => idp n
| suc n, m => pmap suc (+-comm n m)
def flip (m n : Nat) : Nat =>
(hcomp2d
(idp (m + n))
(idp (m + n))
(path (\ i => (+-comm m n).at i))).at left
def err_eq (m n : Nat) : (flip m n) = (n + m) => idp _
Notice if you change the definition of flip
into
def flip (m n : Nat) : Nat =>
(hcomp2d
(idp (m + n))
(idp (m + n))
(+-comm m n)).at left
The code compiles without error.
from aya-dev.
Related Issues (20)
- StackOverflow HOT 1
- Sigma projection check of `Prop` is incorrect HOT 2
- Support projection out of conCalls HOT 3
- Anonymous examples HOT 2
- NPE
- Predicativity of extension types (obviously) for terck HOT 3
- Literate output problems HOT 7
- Coverage checker bug HOT 3
- Unification bug
- We should use `enum X { Obj; }` for singletons! HOT 1
- Literate mode bug? HOT 2
- Fully predicative termination checker
- Type Infering HOT 1
- Bad Meta HOT 7
- We should develop our own IDE HOT 6
- Markdown backend bug HOT 1
- `atob` seems broken in vuepress HOT 7
- We need a better literate backend for academic writing HOT 4
- `aya-hidden` is printed to tex HOT 2
- InternalException about Generalized Variables HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aya-dev.