arith	-  translate Prolog clauses with arithmetic functions

Files in this directory:

arith.nl     - code to translate a ".ari" file into a ".nl" file
arith_gr.gr  - the grammar rules
test.ari     - a sample program for testing


To Run
------

% ../../ptn				% load ptn

NU-Prolog 1.6.4
1?- gr2nl(arith_gr).			% translate grammar rules
true.					% create ".nl" file - once only

2?- consult(arith_gr).			% consult grammar rules
Consulting arith_gr.nl.			% (ignore warning)	
Warning: descendent/2 redefined
true.					  

3?- consult(arith).			% consult arithmetic translator
Consulting arith.nl.
true.

4?- arith(test).			% perform translation on file test.ari
true.					% new file test.nl created

5?-


				% Inspect the file test.nl

Some Explanation
----------------

This example of using PTN is to translate Prolog
predicates which contain an arithmetic function as an argument
in the head of a predicate and replace that argument with a variable
and add an extra "is" goal in the body.

For example,

minus( X, Y, X-Y).

will be replaced by:

minus( X, Y, Z) :-
	Z is X - Y.

{Liz Haywood May 1994}

