Let us take our input data from a file called ``in''.
go:-see(in),
test,
seen.
We wrap the test/0 predicate into a predicate go/0 which takes input from the specified file ``in''. This file should contain legal Prolog terms ---for the predicate double/2 we want something like:
2.23.
-1.
Now to redirect output to a file named ``out'':
go:-Using the same file ``in'' as previously, ``out'' will contain:tell(out),
see(in),
test,
seen,
told.
446