This is perfect, the interpreter now unfolds exactly as we unexpected and we end up with a residual that is isomorphic to our target language.
Great!
Now I need to control what is left in the residual, currently I just have some dummy predicates for the PIC instructions like:
movf(F) :- write(movf),nl,write(F),nl.
These are are unfolded in the body of the interpreter, in logen we marked these as rescall so that the calls would stay in the residual program. How do I apply a similar assertion / property in ciaopp?
The easiest thing is that you move the definition of this predicates to a separate module, say dummy_defs.pl and write in your main module :- use_module(dummy_defs).
In the residual program that is generated there is a lot of dead code that is not reachable from the entry points. Is there an option to remove this code automatically or should I perform slicing on the generated code afterwards?
Hmm, partial deduction should already eliminate dead-code.
Where are your programs? Are they in CVS so that we can take a look?
German