An prolog generator that receive an expression (logic or arithmetic) and pass it to an output file. This file will be used by C program to convert it into pci.
Prolog: run(expr).
C: ./compiled
gcc -o teste pcode.c rpn2pci.c main.c
- This prolog implementation does not accept unnary operators.
- The logic prolog implementation accept other numbers than 0,1, but the pcode execution will not work properly in this cases.
- Open logic2rpn.pl to generate rpn for logic expressions or open expr2rpn to generate arithmetic expressions;
- Query: "run(['(',0,&,1,')'])." for logic or "run(['(',2,+,2,')'])." for math; (Note ' ' surrounding the brackets inside list)
- The expr.txt will be created;
- Run C program;
- The output.txt file with pcode execution trace will be generated.