Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

All I want are questions a,b,c. ot te above and Left t ue h predicate using the just before predicate. 6. Write Prolog clauses that

All I want are questions a,b,c. image text in transcribed
ot te above and Left t ue h predicate using the just before predicate. 6. Write Prolog clauses that define each of the following predicates: a. exactly-3(x) is true if x is a list with exactly three elements. b. at least-3(x) is true if x is a list with at least three elements. c. at_most 3(x) is true if x is list with at most three elements. Hint: Use four clauses. d. intersect(x, y) is true if x and y are lists with an element in common. intersect([1,2,3,4], [5,4,1,6]) holds, but intersectC[1,2,3,4], [5,6]) does not hold. Hint: Use member but no recursion. e. all intersect(z,y) is true if every element of list z is a list x such that intersect (x, y) holds. all_intersect(I[1,2,3], [5,4,611, 03,4]) holds, and all_intersect([], [3,4]) holds, but all-intersect ( [ [1, 2 , 3] , [1, 2 , 5], [5, 4 , 6] ] , [3, 4] ) does not hold. Hint: Use intersect and recursion

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions