Have to write some prolog rules to represent the geometrical properties about isosceles triangle.
First rule is to say
Second rule says
But the two rules together will cause a interdependency and prolog is looping forever if given facts such as
and query about
Any idea? Thanks very much.
First rule is to say
Code:
angleEqual(angle(A,B,C),angle(A,C,B)):-
triangle(A,B,C),
lineEqual(line(A,B),line(A,C)).
Second rule says
Code:
lineEqual(line(A,B),line(A,C)):-
triangle(A,B,C),
angleEqual(angle(A,B,C),angle(A,C,B)).
But the two rules together will cause a interdependency and prolog is looping forever if given facts such as
Code:
triangle(a,b,c).
lineEqual(line(a,b),line(a,c)).
and query about
Code:
?- angleEqual(A,B).
Any idea? Thanks very much.