Giter Site home page Giter Site logo

jvanbruegge / binder_datatypes Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 26.14 MB

A new foundational package for Isabelle/HOL that implements binding-aware datatypes

License: Other

Isabelle 67.40% Standard ML 32.57% Shell 0.03%
binders hacktoberfest isabelle

binder_datatypes's People

Contributors

dtraytel avatar jamesmckinna avatar jvanbruegge avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

binder_datatypes's Issues

Allow to specify a predicate for the parameters in the recursor

Currently you have to use a typedef to restrict the type of the parameters in the recursor. This is e.g. necessary to allow only small support functions in vvsubst.
It would be nice if the user could specify a predicate that is threaded through all the recursor proofs that can be used to proof the axioms.

Implement the corecursor

Currently the package only defines a recursor. This makes it impossible to have infinitely deep types. Defining the corecursor would fix that.

Create a parser for the custom binder_datatype syntax

Currently, datatypes have to be created from ML. Similar to normal datatypes, binder_datatypes should have custom syntax to define datatypes easily. The idea at the moment is to support syntax like this:

binder_datatype (FVars: 'a, 'b) foo =
  Var 'a
| Ann 'b
| Lam x::'a t::"('a, 'b) foo" binds x in t
| App "('a, 'b) foo" "('a, 'b) foo"
| LetRec "(xs::'a * ts::(('a, 'b) foo)) list" t::"('a, 'b) foo" binds xs in ts t
for
  map: vvsubst

Open questions about syntax:

  • It would be convenient for the user to work with a concrete variable type. Should we automate this and how should we specify this? Current idea: separate command
  • Should we automate singular substitution and multi- (list) substitution? Would be more convenient for the user as this could discharge all cardinality assumptions.

Prerequisites:

Generalize the recursor to allow passive positions and mutually recursive types

Currently all positions have to be part of the fixpoint. Most of the complexity is in defining the map/set/rel constants using the recursor such that the passive positions are accounted for.
Additionally, types cannot be mutually recursive at the moment. Doing this generalization at the same time as passive variables is probably easier than afterwards

Provide FFVars_tvsubst again

This theorem was removed because of difficulties proving it, but the solution is to generate a theorem on the fly that re-associates the set unions as needed.

Make tvsubst compose

Currently, using a nested binder_datatype does not compose the substitution functions. This is needed to e.g. substitute types in term of System F.
Prerequisites:

Do not generate a new class at every step of the composition or mrbnf definition

In general we usually deal with either natLeq or card_suc natLeq. Instead of creating the same class over and over again we should create it once (probably even in normal Isar) and then use it when appropriate.
This has several advantages:

  • Performance: There are a lot of theorems that are proven again and again for no reason
  • Clutter: Currently using print_theorems after creating a binder type shows a ton of class theorems that are irrelevant for the user
  • Readability: If we define the two common classes by hand, we can give them sensible names like var_finite and var_countable

Create a binder_(co)primrec to define primitive recursive functions on binder_datatypes

Currently the only way to define a function on a binder_datatype is to drop down to ML and call the recursor axiomatization directly. There should be an easier way for the user to do this by transforming primitve recursive equations into the fold that is the recursor.

Open questions:

  • How to specify parameters and how should the user prove the axioms about the parameters?
  • How to deal with monomorphic functions? At the moment the recursor expects to work abstractly.

Automate singular/list substitution

For most syntaxes singular or list substitution is enough. This would have the advantage that all cardinality assumptions could be discharged automatically making it easier to use.

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.