Coder Social home page Coder Social logo

Comments (6)

ice1000 avatar ice1000 commented on June 1, 2024

Does not check for me as well:
image

I'm investigating.

from minitt-rs.

ice1000 avatar ice1000 commented on June 1, 2024

I've found the problem. It's because when I'm generating a Val to instantiate the pi type's closure:

let generated = generate_value(index);

When generating an instance of One, we're still "generating" a variable (instead of using the only possible instance Unit).

Same problem also occurs in:

let generated = generate_value(index);

let generated = generate_value(index + 1);

from minitt-rs.

ice1000 avatar ice1000 commented on June 1, 2024

It checks in my implementation now:

let elimBool
: \Pi c : bool → Type
. \Pi _ : c False
. \Pi _ : c True
. \Pi b : bool
. c b
= λ c . λ h0 . λ h1 . split
{ True => h1
| False => h0
};

from minitt-rs.

xieyuheng avatar xieyuheng commented on June 1, 2024

Your fix is smart!

  1. But why it is enough to only do it for Unit ?
  2. Is it also right (or sound) to use unification to compare readbacked norm exps?

from minitt-rs.

ice1000 avatar ice1000 commented on June 1, 2024

But why it is enough to only do it for Unit ?

'cus in Mini-TT your Sum { True | False } are desugared to Sum { True 1 | False 1 }, note the 1.

from minitt-rs.

ice1000 avatar ice1000 commented on June 1, 2024

Is it also right (or sound) to use unification to compare readbacked norm exps?

It is, but not necessary. Theoretically, we're supposed to eject beta-normal eta-long normal forms. By eta-long I mean terms like (\ x -> x) : Record { label: Ty } -> Record { label: Ty } are translated to (\ { label } -> { label }), in case the record is empty it becomes \ {} -> {}. The readback function in Mini-TT is not aware of the eta-long property.

from minitt-rs.

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.