Anyone know prolog?

  • Thread starter KataKoniK
  • Start date
  • #1
168
0
Does anyone here know Prolog? I'm using the SWI-Prolog interpreter.

Given this list: [[1, 2], [2, 3], [3, 4]] how do you make it say Yes if 2 (of the first list) = 2 (of second list) and 3 (of second list) = 3 (of third list)? I'm having trouble visualizing this fact as the elements in the lists are lists, so we are basically dealing/recursing a list within a list.
 

Answers and Replies

  • #2
4
0
How about this

Can't you just say this:

g([A,B],[B,C],[C,D]).

?
 

Related Threads on Anyone know prolog?

  • Last Post
Replies
9
Views
19K
  • Last Post
Replies
2
Views
3K
  • Last Post
Replies
2
Views
7K
  • Last Post
Replies
6
Views
6K
Replies
6
Views
2K
Replies
1
Views
2K
Replies
21
Views
1K
Replies
6
Views
3K
  • Last Post
Replies
3
Views
1K
Top