mardi 20 mars 2018

Prolog- Pattern matching strings connected by operators

Still kind of new to prolog and have run into an issue. I understand in prolog you can reprsent data like so : name+date+time . If I had a list of data structred like this how could I use pattern matching with in that list? For example if I wanted a predicate to evaulate to true if it takes two "name+date+time" values and is only true if the name of the first does not equal the name of the second. Ive tried:

 notEqual([A+B+C, D+E+F]) :-
      A \= B.

But this doesnt pattern match as I expected. How would I work with values in this form?

Aucun commentaire:

Enregistrer un commentaire