Marco Trillo


Documents

Experiments

The following are various software experiments I develop just for fun.

SILXPI: a simple logic programming interpreter

silxpi is an interpreter for a logic programming language which is a subset of Prolog.

It implements unification without ocurr-check and SLD resolution. In addition to the "pure Prolog" subset it also implements the Cut symbol with usual Prolog semantics, and extra-logical built-in predicates (such as consult/1, write/1 or fail/0).
It's written in C and should compile and work on any UNIX system.

In SILXPI 1.6, the engine has been completely rewritten and it is a lot faster than previous versions. It also features automatic memory management.

Example: queens.prl (N-queens problem).

Example of an interactive interpreter session:

$ ./silxpi 
SILXPI 1.6 - a simple logic program interpreter (a la Prolog).

?- consult(user).
/* user file. type ^L to return. */
takeout(X,[X|R],R).
takeout(X,[F|R],[F|S]) :- takeout(X,R,S).
perm([X|Y],Z) :- perm(Y,W), takeout(X,Z,W).   
perm([],[]).
^L

yes
?- perm([1,2,3],P).

P = [1,2,3] ? ;

P = [2,1,3] ? ;

P = [2,3,1] ? ;

P = [1,3,2] ? ;

P = [3,1,2] ? ;

P = [3,2,1] ? ;
no
?- ^D

SLSIC: a really simple functional language

slsic is a very simple interpreter for a functional language. It is implemented in just 1000 lines of C89 source code and contains support for lambda expressions , (recursive) ordered pairs, definitions, atoms (any arbitrary symbolic identifier can be used), pattern matching ...

This interpreter is not available currently.

Example: bina.sic.

BSD stuff

This is stuff I use in my BSD systems:

Mac OS applications

Other stuff


Last updated: August 31, 2009

marcotrillo () gmail ! com

valid HTML 4.01