szynwelski / nlambda

Nλ is a simple functional programming language aimed at manipulating infinite, but first-order definable structures, such as the countably infinite clique graph or the set of all intervals with rational endpoints.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nλ is a simple functional programming language aimed at manipulating infinite, but first-order definable structures, such as the countably infinite clique graph or the set of all intervals with rational endpoints. Internally, such sets are represented by logical formulas that define them, and an external satisfiability modulo theories (SMT) solver is regularly run by the interpreter to check their basic properties.

For more information, visit NLambda website.

Installation guide

  1. There are two ways to get a source code:
  1. The language is implemented in a Haskell and installation of GHC (at least 7.10) is required.

  2. Move into nlambda directory and perform the following commands:

    cabal v2-configure -fTOTAL_ORDER
    cabal v2-build
    cabal v2-install
    

    The flag TOTAL_ORDER is required to install the package with ordered atoms (otherwise equality atoms will be used).

    More information on how to install a Cabal package can be found here.

  3. You can also use dedicated scripts:

  • for ordered atoms

    $ ./intall-total-order.sh

  • for equality atoms

    $ ./install-equality.sh

  1. Additionally, you should install the Z3 Theorem Prover and add it to the PATH environment variable.

Interactive environment

Nλ expressions can be interpreted and evaluated on the fly using the interactive GHCi environment. For easier use of the environment, one can use the .ghci configuration file, which imports the module with the language, hides Prelude functions that conflict with Nλ, and sets useful options.

:set -XNoImplicitPrelude
:set -XRebindableSyntax
:m NLambda
:set prompt "Nλ> "
import Prelude hiding (or, and, not, sum, map, filter, maybe)
let [a,b,c,d,e] = fmap atom ["a","b","c","d","e"]

About

Nλ is a simple functional programming language aimed at manipulating infinite, but first-order definable structures, such as the countably infinite clique graph or the set of all intervals with rational endpoints.

License:Other


Languages

Language:Haskell 99.9%Language:Shell 0.1%