Answer to Question #1241 in Prolog for tangos

Question #1241
Give the following predicates:

A) precede_list (X, Y) is true when the list X precedes Y list. Example:

?-precede_list ([1,2], [1, 2, 3]).
Yes

B) proceed_list (X, Y) is true when the X-list following the CC list. Example:

?-procede_list ([1,2], [2]).
Yes

C) included_list (X, Y) is true when X is a non-empty sub-list of CC list. Example:

?-included_list ([1,2], [0, 1, 2, 3]).
Yes

D) common_list (X, Y) is true when the two lists have at least one common element. Example:

?-common_list ([1,2, 3], [0, 3, 4]).
Yes

E) pair_list (X, Y) in a computer returns to the data pairs of X List. Example:

?-pair_list ([1,2, 3, 4, 5, 6], [[1, 2], [3, 4], [5, 6]]).
Yes
0
Expert's answer

Answer in progress...

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

Assignment Expert
20.12.16, 17:14

Dear charalampos, please use panel for submitting new questions.

charalampos
18.12.16, 19:24

precede_list (X, Y) is true when the list X precedes Y list. Example: ?-precede_list ([1,2], [1, 2, 3]). Yes So what predicate should i exactly write in order to work

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS