Giter Site home page Giter Site logo

Comments (25)

ice1000 avatar ice1000 commented on May 29, 2024

Don't trust the route error messages, they're cursed. I'll try to improve it!

from aya-dev.

ice1000 avatar ice1000 commented on May 29, 2024

It's not printing all equations, and the reason is that some equations are generated at overlapped source range, which are overwritten during printing.

from aya-dev.

ice1000 avatar ice1000 commented on May 29, 2024

I asked you about mkVerb some time ago but you replied with a definition of Verb, saying that it's okay.

from aya-dev.

ice1000 avatar ice1000 commented on May 29, 2024

#22

from aya-dev.

refparo avatar refparo commented on May 29, 2024

I asked you about mkVerb some time ago but you replied with a definition of Verb, saying that it's okay.

The code in #19 never included mkVerb, and I wasn't paying attention when you asked… Sorry.

from aya-dev.

ice1000 avatar ice1000 commented on May 29, 2024

image

Have you seen Event.u <= Verb.v?

from aya-dev.

refparo avatar refparo commented on May 29, 2024

Yeah, and Verb.v == v, so I concluded that Event.u <= v.

from aya-dev.

ice1000 avatar ice1000 commented on May 29, 2024

There is a way to do it, but it's gonna be very complicated, which is to introduce assumptions on level relations. I think that will require an overhaul of the level system.

from aya-dev.

ice1000 avatar ice1000 commented on May 29, 2024

Yeah, and Verb.v == v, so I concluded that Event.u <= v.

And apparently Verb.v = v, and Event.u = u, so you're asking two parameters to have a relation. But we don't support that (say, take two level arguments with a known relation) at the moment.

from aya-dev.

ice1000 avatar ice1000 commented on May 29, 2024

I mean you're asking u <= v. For now you can pass arbitrary level arguments so they should be independent

from aya-dev.

refparo avatar refparo commented on May 29, 2024

Yeah, I understand that. But after changing the type of mkVerb the code still doesn't tyck. I think the changed code doesn't involve any assumptions.

from aya-dev.

ice1000 avatar ice1000 commented on May 29, 2024

Oh I didn't read the entire post. I'm running test now. Java compilation has become disastrously slow lately and I dunno why. Maybe it's the doom of this 5000RMB laptop...

from aya-dev.

ice1000 avatar ice1000 commented on May 29, 2024

This is what I got:

         Verb.u == u
         Verb.v == (lmax u v)
         u <= Verb.u
         Event.u == u
         u <= Event.u
         Event.u <= Verb.v
         Event.u <= u
         (lmax u v) <= Verb.v
         Event.u <= Verb.u
         Verb.v <= Verb.v

from aya-dev.

ice1000 avatar ice1000 commented on May 29, 2024

Still requiring v >= u, man.

from aya-dev.

refparo avatar refparo commented on May 29, 2024

It's Event.u <= Verb.v, but Event.u == u and Verb.v == lmax u v, so u <= lmax u v, which is obvious.

from aya-dev.

ice1000 avatar ice1000 commented on May 29, 2024

With the latest commit you'll be able to see the complete list of level constraints

from aya-dev.

ice1000 avatar ice1000 commented on May 29, 2024

Well I think you're right. This needs more investigation

from aya-dev.

refparo avatar refparo commented on May 29, 2024

My another failed attempt:

(The problem is also u <= (lmax u v))

universe u v

open data EventT : Type (lsuc u)
  | CarrierT (A : Type u)

def GetAgentT (T : EventT {universe u}) : Type u
  | CarrierT A => A

struct Event (T : EventT {universe u}) : Type u
  | agent : GetAgentT T

def Quantifier (A : Type (lsuc u)) : Type (lsuc (lmax u v))
  => (A -> Type v) -> Type (lmax u v)

def Verb (T : EventT {universe (lsuc u)}) : Type (lsuc (lmax u v))
  => Quantifier {universe u, v} (Event T)

def mkVerb {T : EventT {universe (lsuc u)}} (p : Event {universe (lsuc u)} T -> Type v)
  : Verb {universe u, v} T
  => \f => Sig (e : Event {universe (lsuc u)} T) (s : p e) ** (f e)

from aya-dev.

refparo avatar refparo commented on May 29, 2024

A minimum test:

The following tycks:

universe u v

open data Event : Type u

def Quantifier (A : Type (lsuc u)) : Type (lsuc (lmax u v))
  => (A -> Type v) -> Type (lmax u v)

def Verb : Type (lsuc (lmax u v))
  => Quantifier {universe u, v} Event

def mkVerb (p : Event {universe u} -> Type v)
  : Quantifier {universe u, v} Event
  => \f => Sig (e : Event {universe u}) (s : p e) ** (f e)

But this doesn't:

universe u v

open data Event : Type u

def Quantifier (A : Type (lsuc u)) : Type (lsuc (lmax u v))
  => (A -> Type v) -> Type (lmax u v)

def Verb : Type (lsuc (lmax u v))
  => Quantifier {universe u, v} Event

def mkVerb (p : Event {universe u} -> Type v)
  : Verb {universe u, v}
  => \f => Sig (e : Event {universe u}) (s : p e) ** (f e)

from aya-dev.

ice1000 avatar ice1000 commented on May 29, 2024

Later we should test against all these

from aya-dev.

refparo avatar refparo commented on May 29, 2024

This extra explicit universe level would fix the failing code in #57 (comment) :

 universe u v

 open data Event : Type u

 def Quantifier (A : Type (lsuc u)) : Type (lsuc (lmax u v))
   => (A -> Type v) -> Type (lmax u v)

 def Verb : Type (lsuc (lmax u v))
-  => Quantifier {universe u, v} Event
+  => Quantifier {universe u, v} (Event {universe u})

 def mkVerb (p : Event {universe u} -> Type v)
   : Verb {universe u, v}
   => \f => Sig (e : Event {universe u}) (s : p e) ** (f e)

from aya-dev.

refparo avatar refparo commented on May 29, 2024

The universe annotation in #57 (comment) actually has some errors, which should be fixed as follows:

 universe u v

 open data EventT : Type (lsuc u)
   | CarrierT (A : Type u)

 def GetAgentT (T : EventT {universe u}) : Type u
   | CarrierT A => A

 struct Event (T : EventT {universe u}) : Type u
   | agent : GetAgentT T

 def Quantifier (A : Type (lsuc u)) : Type (lsuc (lmax u v))
   => (A -> Type v) -> Type (lmax u v)

-def Verb (T : EventT {universe (lsuc u)}) : Type (lsuc (lmax u v))
+def Verb (T : EventT {universe u}) : Type (lsuc (lmax u v))
   => Quantifier {universe u, v} (Event T)

-def mkVerb {T : EventT {universe (lsuc u)}} (p : Event {universe (lsuc u)} T -> Type v)
+def mkVerb {T : EventT {universe u}} (p : Event {universe u} T -> Type v)
   : Verb {universe u, v} T
-  => \f => Sig (e : Event {universe (lsuc u)} T) (s : p e) ** (f e)
+  => \f => Sig (e : Event {universe u} T) (s : p e) ** (f e)

It's my fault, sorry.

from aya-dev.

refparo avatar refparo commented on May 29, 2024

Strangely, removing some universe annotation would make the original code tyck:

 universe u v

 open data EventT : Type (lsuc u)
   | CarrierT (A : Type u)

 def GetAgentT (T : EventT {universe u}) : Type u
   | CarrierT A => A

 struct Event (T : EventT {universe u}) : Type u
   | agent : GetAgentT T

 def Quantifier (A : Type u) : Type (lmax u (lsuc v)) => (A -> Type v) -> Type v

 def Verb (T : EventT {universe u}) : Type (lmax u (lsuc v))
   => Quantifier {universe u, v} (Event T)

-def mkVerb {T : EventT {universe u}} (p : Event {universe u} T -> Type (lmax u v))
+def mkVerb {T : EventT {universe u}} (p : Event {universe u} T -> Type)
-  : Verb {universe u, lmax u v} T
+  : Verb T
   => \f => Sig (e : Event {universe u} T) (s : p e) ** (f e)

Please note that all the code in this issue are different from each other plus the code in #11.

The code in #11 would also fail with explicit universe levels added in mkVerb. I don't know why.

from aya-dev.

refparo avatar refparo commented on May 29, 2024

I still believe the original code is right, resending here with as much universe information specified as possible:

universe u v

open data EventT : Type (lsuc u)
  | CarrierT (A : Type u)

def GetAgentT (T : EventT {universe u}) : Type u
  | CarrierT A => A

struct Event (T : EventT {universe u}) : Type u
  | agent : GetAgentT T

def Quantifier (A : Type u) : Type (lmax u (lsuc v)) => (A -> Type v) -> Type v

def Verb (T : EventT {universe u}) : Type (lmax u (lsuc v))
  => Quantifier (Event T {universe u}) {universe u, v}

def mkVerb {T : EventT {universe u}} (p : Event T {universe u} -> Type (lmax u v))
  : Verb T {universe u, lmax u v}
  -- = Quantifier (Event T {universe u}) {universe u, lmax u v}
  -- = ((Event T {universe u}) -> Type (lmax u v)) -> Type (lmax u v)
  => \(f : (Event T {universe u}) -> Type (lmax u v))
    => Sig (e : Event T {universe u}) (s : p e) ** (f e)
    -- Event T : Type u
    -- p e : Type (lmax u v)
    -- f e : Type (lmax u v)
    -- --------------------------------
    -- Sig (e : Event T) (p e) ** (f e)
    --   : Type (lmax u (lmax u v) (lmax u v)) = Type (lmax u v)

Please tell me if I got anything wrong.

from aya-dev.

ice1000 avatar ice1000 commented on May 29, 2024

Universe polymorphism mechanism is completely replaced by McBride universes (https://mazzo.li/epilogue/index.html%3Fp=857&cpage=1.html).

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.