I'm learning how to define custom operators in Prolog, but the second exercise on the first page seems a bit complicated for me.
Given a formula analyze if it's correct.
E.g. : if you define operators: op1 and op2, and variables: a, b, c one input to verify would be:
?- formula(op1 a op2 b).
And based on how you've defined the operators it should say true or false.
I've got absolutely no clue how to approach this, because even the op1 a op2 b part scares me. I don't know how I can extract the operators and variables from that, and I don't even know if that's the way to go.
Any help is appreciated!
edit: My operators specifications are:
:- op(630, xfy, op1).
:- op(610, fy, op2).