Questions: 69

Answers by our Experts: 50

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Prolog Questions
1: write prolog program to search book by book_title ,by book_author, by book_edition Using
recursion.
Hint: your input must be from above mentions, your rule must recursively find the book and
display the complete book information as provided in facts.
Facts: book(b_name,b_authmb_edition)
search_book() :-
write(\"Enter book author name : \"),
readln(BOOK_AUTH),
data(name(Z),company(BOOK_AUTH)),
nl, write(Z),
fail.
http://pages.cpsc.ucalgary.ca/~robin/class/449/assignments/sol_2019.pdf
Consider the problem taken from life insurance expert (RULE 1 if age is old and gender is male and smoker is no then risk is low; RULE 2 if age is middle and gender is male and smoker is yes then risk is high; RULE 3 if age is young and gender is female and smoker is no then risk is low;). Write a complete PROLOG program that could support the decision of a life insurance expert. Add necessary facts and rules to produce a well designed knowledge base.
Write a Prolog program that can answer
<S> → <A> a <B> b
<A> → <A> b | b
<B> → a <B> | a
Which of the following sentences are in the language generated by this grammar? a. baab
b. bbbab
c. bbaaaaa
d. bbaab.
Submit your code and screen shots of the results.
Define the relation jump( Square1, Square2) according to the knight jump on the chessboard. Assume that Square1 is always instantiated to a square while Square2 can be uninstantiated. For example:
?- jump( 1/1,S).
S= 3/2;
S= 2/3;
No
Translate the following sentences into a Prolog program smart.pro:

Messi teaches Prolog language.
Prolog is a programming subject.
Nabil teaches Algebra.
Algebra is a Mathematics subject.
Everyone who teaches a programming subject is smart.

Consult the above program and query Prolog: "Who are smart"? Print screen and submit the output.
member2(H, [_, H | _]):- !.
member2(H, [_, _ | T]) :- member2(H, T).

How many solutions - member2(X, [1, 2, 3, 4])?
num(Y, Y).
num(X, Y) :- X > 0, X1 is X - 2, num(X1, Y).

How many solutions - num(5, X)?
Doing a wait or not wait for restaurant seat
The Decision Tree
http://oi62.tinypic.com/rr850n.jpg

Code here.
http://pastebin.com/KVuUTBGk

Question:
I want to add a summary of the results output like
example(yes, [Pat=full, WaitEstimate=30-60, Alt=no, Reservation=no, Bar=yes]).

If I enter the results as below

?- patrons.
What is the size of the Patrons?
|: full.
What is the estimate waiting time?(write in minutes, ex:50)
|: 60.
Is there any alternative?
|: no.
Have you made any reservation?
|: no.
Do they offer a comfortable bar area for customer to wait in?
|: yes.
Your decision is to wait!
true.
write a prolog code that accepts input of CGPA from user and determine the level of that CGPA
LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS