77 321
Assignments Done
Successfully Done
In July 2019

Questions: 24

Free Answers by our Experts: 12

Ask Your question

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

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

Code here.

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!
write a prolog code that accepts input of CGPA from user and determine the level of that CGPA
There are 5 ships in a port:

1. The Greek ship leaves at six and carries coffee.
2. The Ship in the middle has a black chimney.
3. The English ship leaves at nine.
4. The French ship with blue chimney is to the left of a ship that carries coffee.
5. To the right of the ship carrying cocoa is a ship going to Marseille.
6. The Brazilian ship is heading for Manila.
7. Next to the ship carrying rice is a ship with a green chimney.
8. A ship going to Genoa leaves at five.
9. The Spanish ship leaves at seven and is to the right of the ship going to Marseille.
10. The ship with a red chimney goes to Hamburg.
11. Next to the ship leaving at seven is a ship with a white chimney.
12. The ship on the border carries corn.
13. The ship with a black chimney leaves at eight.
14. The ship carrying corn is anchored next to the ship carrying rice.
15. The ship to Hamburg leaves at six.

Which ship goes to Port Said? Which ship carries tea?
In this assignment, you are expected to implement a solution in Prolog to the N-Tiles Problem.N-Tiles
problem is problem of placing N copies of a tile T (TX/TY) on an SxS square grid so that no two copies
touch each other. Namely, N-Tiles problem takes three inputs:
• S: Grid Size
• N: Number of copies to place
• T : Tile definition in (TX,TY) form.
and produces an N-sized set of points on the grid satisfying the non-touching condition.

A call to ntiles predicate should fail if there exists no solution for the problem specified with parameters.
Below is given examples for a no-solution case and a case with 4 different solutions.

Which one of the following prolog
programs correctly implement “if G
succeeds then execute goal P else
execute goal θ ?”
(A) if-else (G, P, θ) :- !, call(G), call(P).
if-else (G, P, θ) :- call(θ).
(B) if-else (G, P, θ) :- call(G), !, call(P).
if-else (G, P, θ) :- call(θ).
(C) if-else (G, P, θ) :- call(G), call(P), !.
if-else (G, P, θ) :- call(θ).
(D) All of the above
I have to create a heuristic algorithm where it searches through a list of places and determines the best way to navigate from a - b by the shortest distance sorting the list into order of place & distance and displaying that list without duplicates.

I have already wrote some Prolog code where it displays the place and distance but now I need to remove the duplicates. Can anyone help?
Privacy policy Terms and Conditions