I am working through the exercises in Chapter 3 in 'Prolog Programming for Artificial Intelligence' by Ivan Bratko.
Exercise 3.13 states:
Suggest an appropriate definition of operators ('was', 'of', 'the') to be able to write clauses like:
diana was the secretary of the department.
and then ask Prolog:
?- Who was the secretary of the department.
Who = diana
?- diana was What.
What = the secretary of the department.
The answer to this exercise is:
:- op(300, xfx, was).
:- op(200, xfx, of).
:- op(100, fx, the).
However, I am not sure what the structure of the term 'diana was the secretary of the department' would look like. I know that the operator with the highest precedence is the principal functor of the expression, so in this case the principal functor would be 'was'.
My answer for what the structure of the term is:
was(diana, of(the(secretary, the(department))).
I don't know if my answer is correct, so I was wondering if anyone could help clarify this.