0

I'm new to Prolog and need some guidance *(not answers) to get in the right direction. Firstly, I'm trying to solve a logic puzzle. There are triples in the logic. I know how to create negations and members like the following:

member ([_, X, _], Triples ),
\+ member([_, X, Y], Triples).

Where I am stuck and not quite understanding Prolog is how to compare members (using inequalities) based on their relationships. For example, X was eaten later in the week than the Y.

Given an unknown "_" [_,X,_], I want to make sure [_,X,_] is greater than [_,Y,_]. 

So I have tried

([_,X,_], Triple) > ([_,Y,_], Triple),

But it doesn't seem to work?

Thanks for the guidance!

false
  • 10,264
  • 13
  • 101
  • 209
  • Not quite sure what you want to achieve. There should be an ordering on the triples, but what is `([_,X,_], Triple)` and how does term like ([_,X,_], Triple) > ([_,Y,_], Triple),` and why is there a comma at the end? Post some code. – David Tonhofer Feb 21 '20 at 19:45
  • Please refer to [tag:zebra-puzzle], you will find there various ways to model this dependence. – false Feb 21 '20 at 22:41

0 Answers0