%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INSTALATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% The following software has been developed and tested under SWI-PROLOG 5.6.20. If you dont have SWI-PROLOG installed in your system, you can download it from http://www.swi-prolog.org. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % DISTRIBUTION %%%%%%%%%%%%%%%%%%%%%%%%%%%% The distribution includes two 'pl' files: inversion.pl: contains the source code of the inverter. examples.pl: contains a program example. README: this file %%%%%%%%%%%%%%%%%%%%%%%%% RUNNING THE SYSTEM %%%%%%%%%%%%%%%%%%%%%%%%% 1.- Run swi-prolog in a terminal: host> pl 2.- Load in the partial inverter: ?- [inversion]. % It should show something like: % library(lists) compiled into lists 0.00 sec, 11,588 bytes % inversion compiled 0.01 sec, 39,784 bytes 3.- Load in the example file (using 'loadf/1'): ?- loadf(examples). 4.- Try a (partial) function inversion, e.g: ?- invert(member,[1]). This call partially inverts the function member w.r.t. the first argument (i.e., the first argument will reamain as an input of the inverted function). Some more examples: ?- invert(member,[]). This will produce the total inversion of function member. In general, one can call inver/2 as follows ?- invert(funName,paramList). where funName is the name of a function defined in the file loaded in with loadf/1 and paramList is a list of input parameters for inversion (NOTE: this list should be ordered, i.e., [1,2] works but [2,1] does not!) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SHOWING THE RESULT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% You can just use the listing/1 facility of Prolog: ?- listing(=:). NOTE: The original rules use ":=", the inverted ones use "=:" instead.