Giter Club home page Giter Club logo

fpl-exploration-tool's Introduction

This is pretty much a work-in-progress.

The project is aimed at defining dependently typed languages via specifying their inference and reduction rules.

The program then generates our target language's parser and typechecker, so we can play around with the language.

Think of it as a high level yacc+lex.

To launch:

  • stack install alex happy
  • stack exec alex src/specLang/parsLex/Lexer.x
  • stack exec happy alex src/specLang/parsLex/Parser.y
  • stack install

~/.local/bin/fpl-exploration-tool-exe "examples/langSpecs/depTypedLC.fpl" > my_src.hs

There are 2 modules: SortCheck and CodeGen, and two functions codeGenIO and sortCheckIO you can use those if you prefer.

Notes about spec language:

  • May have depsorts and simplesorts or only depsorts
  • May have reductions or/and axioms
  • axiom names are alphaNum starting with a numeric, may contain "_", "-", "'"
  • subst binds closer than binders (x y.T[z:=ttt] == x y.(T[z:=ttt]))

Restrictions imposed:

  • conclusion of an axiom/reduction may not have a ctx (axioms always look like this .... |--- |- funSym())

  • only funsyms are allowed in axiom conclusions (no equations)

  • only metavars are allowed in funsyms in conclusions

  • if an axiom conclusion is a term it must have a type (can't just say |--- |- false def, must say |--- |- false : bool)

  • no substitutions are allowed for the left hand of a reduction

  • may subst only into metavars

  • if variables of metavariables (X) have type of metavars, they may use only metavars that come before X in funsym in conclusion (Eg: |--- |- f(A, x.B, z.Y, r.T) -- here z may use only A and B as its' type, x may use only A, while r may use A, B, and Y)

  • so if we have f(..., xy.T) we demand a premise looking like this ctx |- T !

  • only parts of reductions used are these a => b (context, types or premises are not taken into account yet)

  • in reductions a => b all(!) metavars of b must be present in a

  • c-stability - reductions are always stable. Others are concatenated with the types on top


fpl-exploration-tool's People

Contributors

esengie avatar

Stargazers

Rahul Muttineni avatar Ashley Woodard avatar Artem Ohanjanyan avatar  avatar Sean Jensen-Grey avatar Zhuyang Wang avatar Eric Bailey avatar Jonathan Fischoff avatar karim amer  avatar Juan Bono avatar Dmitrii Kovanikov avatar Wang avatar Belleve avatar

Watchers

James Cloos avatar  avatar

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.