L10 Logic Programming Language

This is a source repository for the L10 programming language. Currently, the repository contains a working version of the interpreter, for L10; a compiler to Standard ML and the X10 parallel programming language are in development.

For information on L10 see the preliminary design document, or the examples page.

Running the SML Interpreter (smlten)

The following is an example of loading two different L10 programs in the SML interpreter for L10. For the first example, a standard edge/path example, we run the program to saturation and use PredSet.printSet to print out the entire database. For the second example, a regular expression matcher, we use PredSet.match to selectively query the resulting database of facts.

bash-3.2$ cd l10
bash-3.2$ sml -m sml/smlten.cm   
- Read.file "examples/EdgePath1.l10";
- val db1 = Deduce.deduceStored "db1";
- PredSet.printSet db1;
- Reset.reset ();
- Read.files ["examples/Regexp.l10", 
- fun matches db = 
        open Ast
        open Symbol
        print "Regexp matches for the full string:\n";
        app (fn x => print (Subst.to_string x ^ "\n")) 
           (PredSet.match (db, Subst.empty,
              (symbol "match", [ Var (SOME (symbol "RE")), 
                                 NatConst 0,
                                 NatConst 3 ])))
- matches (Deduce.deduceStored "db1");
- matches (Deduce.deduceStored "db2");
- matches (Deduce.deduceStored "db3c");
- matches (Deduce.deduceStored "db4c");
- Reset.reset ();
- Read.files ["examples/ProgAnalysisA.l10",