Giter Site home page Giter Site logo

Comments (7)

ice1000 avatar ice1000 commented on June 10, 2024

I think it's the program

from aya-dev.

ice1000 avatar ice1000 commented on June 10, 2024

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.

wsx-ucb avatar wsx-ucb commented on June 10, 2024

The end points of the path now agree, but I'll continue to investigate the case.

from aya-dev.

ice1000 avatar ice1000 commented on June 10, 2024

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.

wsx-ucb avatar wsx-ucb commented on June 10, 2024

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.

ice1000 avatar ice1000 commented on June 10, 2024

🤷‍♀️

from aya-dev.

wsx-ucb avatar wsx-ucb commented on June 10, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.