Question

(b) Define the PROLOG predicate poweroftwo(K,P) 2 where K is a natural number to calculate P Example: poweroftwo (5,P)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Predicate’ is the name given to the word occurring before the bracket in a fact or rule: parent(jane,alan).

By defining a predicate you are specifying which information needs to be known for the property denoted by the predicate to be true.

power of two is a function in prolog that is use to fine 2n value here (K,P) where K being the n value of two power and being the value saver.

the poweoftwo will calulate 2n value

Add a comment
Know the answer?
Add Answer to:
(b) Define the PROLOG predicate poweroftwo(K,P) 2 where K is a natural number to calculate P...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT