andreasabel / helf

Haskell implementation of the Edinburgh Logical Framework

Home Page:http://www2.tcs.ifi.lmu.de/~abel/projects.html#helf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

helf

A Haskell implementation of the Edinburgh Logical Framework.

helf parses and typechecks .elf files written for the Twelf implementation of the Logical Framework. helf is mainly a laboratory to experiment with different representation of lambda-terms for bidirectional typechecking.

Limitations

helf only understands a subset of the Twelf language and implements only a small subset of Twelf's features.

  • helf does not parse the backarrow <- notation for function space.
  • helf only understands the fixity pragmas for operators. It ignores all other pragmas.
  • helf only implements bidirectional type checking. It does not have unification or type reconstruction.
  • helf does not give nice error messages.

Installation

Requires GHC and cabal, for instance via the Haskell Platform. In a shell, type

  cabal install helf

Examples

File eval.elf:

% Untyped lambda calculus.

tm   : type.
abs  : (tm -> tm) -> tm.
app  : tm -> (tm -> tm).

% cbn weak head evaluation.

eval : tm -> tm -> type.

eval/abs : {M : tm -> tm}
  eval (abs M) (abs M).

eval/app : {M : tm} {M' : tm -> tm} {N : tm} {V : tm}
  eval M (abs M') ->
  eval (M' N) V   ->
  eval (app M N) V.

Type check with:

  helf eval.elf

For more examples, see test/succeed/.

About

Haskell implementation of the Edinburgh Logical Framework

http://www2.tcs.ifi.lmu.de/~abel/projects.html#helf

License:MIT License


Languages

Language:Haskell 58.0%Language:TeX 37.6%Language:Makefile 2.2%Language:Lex 0.8%Language:Yacc 0.7%Language:Shell 0.6%