larrytheliquid / generic-reuse Goto Github PK
View Code? Open in Web Editor NEWSource code accompanying the draft paper "Generic Zero-Cost Reuse for Dependent Types"
Home Page: https://arxiv.org/abs/1803.08150
License: MIT License
Source code accompanying the draft paper "Generic Zero-Cost Reuse for Dependent Types"
Home Page: https://arxiv.org/abs/1803.08150
License: MIT License
Also change it in the examples, and in the Tex.
Currently x and xs are used, when sometimes y and ys makes more sense.
Also update index-index branch.
In the paper, AssocV
is defined very concisely:
AssocV ◂ AppV → ★ = λ appV.
∀ A : ★. ∀ n : Nat. Π xs : Vec A n.
∀ m : Nat. Π ys : Vec A m. ∀ o : Nat. Π zs : Vec A o.
appV (appV xs ys) zs ≃ appV xs (appV ys zs)).
In the code, however, it depends on four auxiliary definitions:
AssocV4 ◂ AppV ➔ Π A : ★.
Π n : Nat. Vec · A n ➔ Π m : Nat. Vec · A m ➔ Π o : Nat. Vec · A o ➔ ★ =
λ appV : AppV. λ A : ★. λ n : Nat. λ xs : Vec · A n.
λ m : Nat. λ ys : Vec · A m. λ o : Nat. λ zs : Vec · A o.
{appV (appV xs ys) zs ≃ appV xs (appV ys zs)}.
AssocV3 ◂ AppV ➔ Π A : ★. Π n : Nat. Vec · A n ➔ Π m : Nat. Vec · A m ➔ ★ =
λ appV : AppV. λ A : ★. λ n : Nat. λ xs : Vec · A n. λ m : Nat. λ ys : Vec · A m.
∀ o : Nat. Π zs : Vec · A o. AssocV4 appV · A n xs m ys o zs.
AssocV2 ◂ AppV ➔ Π A : ★. Π n : Nat. Vec · A n ➔ ★ =
λ appV : AppV. λ A : ★. λ n : Nat. λ xs : Vec · A n.
∀ m : Nat. Π ys : Vec · A m. AssocV3 appV · A n xs m ys.
AssocV1 ◂ AppV ➔ ★ ➔ ★ = λ appV : AppV. λ A : ★.
∀ n : Nat. Π xs : Vec · A n. AssocV2 appV · A n xs.
AssocV ◂ AppV ➔ ★ = λ appV : AppV. ∀ A : ★. AssocV1 appV · A.
Is this because the version in the code is more generic than the one in the paper, or are these four auxiliary definitions strictly necessary to make it work? Also, could you share some intuition on what they're good for?
Is there a typechecker which can verify all these examples? Is it this one: https://github.com/MaiaVictor/cedille-core ? If yes, how can I use it? A few lines about this in the README would be appreciated 😉
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.