Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Prolog rule get _ odds / 2 where the first argument is a list and the second argument is a list of the

Write a Prolog rule get_odds/2 where the first argument is a list and the second argument is a list of the odd numbers in that list.
For example:
?- get_odds([1,2,3,4,5], Odds).
Odds =[1,3,5].
?- get_odds([4,8,15,16,23,42],[15,23]).
true.

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 Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions

Question

Explain the role of evidence in criminal investigations.

Answered: 1 week ago

Question

=+Are you interested in working on global teams?

Answered: 1 week ago

Question

=+Do you want to work from home?

Answered: 1 week ago

Question

=+ What skills and competencies will enable someone

Answered: 1 week ago