Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please provide all codes using Prolog. 6. Given the fact, rules, and queries below % Facts & Rules fib (1,1). fib(2,1) fib (LR) :-N =
please provide all codes using Prolog.
6. Given the fact, rules, and queries below % Facts & Rules fib (1,1). fib(2,1) fib (LR) :-N = 3, N1 % Goals (queries) is N-1,N2 is N-2, fib (N1, RI), fib (N2 , R2),R is R1+R2. 2- fib (9,R).2 fib (9,9) a) Write English statement for the facts and rule. b) Describe step by step how the fib (3) is calculated. c What is the answer of the two queries listed in blue. Explain them. 7. For below English sentences write applicable Prolog facts, rules & goals a) John reads a book. b) Anyone likes sundevils if he/she is an ASU student. c) Who likes sundevils? d) Jane likes any village if it is small and sparse. 8. Write the facts and rules, that compute the product of the first n numbers. For example, 2 prod (3,x) prod (5,x) X-120 prod (7,x) X-5040
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started