Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(Logic programming PROLOG) Write, run, and test a predicate abc(L) which succeeds if list L contains (for any list element) an atom a, followed directly

(Logic programming PROLOG) Write, run, and test a predicate abc(L) which succeeds if list L contains (for any list element) an atom a, followed directly by an atom b, followed directly by an atom c; and which fails otherwise. For example, abc( [d,a,b,c,e,f] ) should succeed, and abc( [d,a,b,g,c,e,f] ) should fail. Show screen shots of code and 10 test queries below in PROLOG.

abc( [d,a,b,c,e,f] ). abc( [d,a,b,g,c,e,f] ). abc( [ ] ). abc( [a,a,a,b,c] ). abc( [b,a,c,b,a,b,a,c,b,c,a,a,b,b,c] ). abc( [a,b] ). abc( [a],[b],[c] ). abc( [ [a,b,c],b,a,c] ). abc( [b,a,a,a,b,a,c,b,c,a,a,b,c] ). abc( [abc,[a],c,b,a,b,a,c,b,c,a,a,b,b,c] ).

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

Step: 3

blur-text-image

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

Database 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago