Questions: 26

Free Answers by our Experts: 14

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

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 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. 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
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: &bull; S: Grid Size &bull; N: Number of copies to place &bull; 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. &gt;ntiles(2/1,3,3,P). No &gt;ntiles(2/1,3,2,P). P=[1/1,1/3]?; P=[1/1,2/3]?; P=[2/1,1/3]?; P=[2/1,2/3]?; No.
Which one of the following prolog programs correctly implement &ldquo;if G succeeds then execute goal P else execute goal &theta; ?&rdquo; (A) if-else (G, P, &theta;) :- !, call(G), call(P). if-else (G, P, &theta;) :- call(&theta;). (B) if-else (G, P, &theta;) :- call(G), !, call(P). if-else (G, P, &theta;) :- call(&theta;). (C) if-else (G, P, &theta;) :- call(G), call(P), !. if-else (G, P, &theta;) :- call(&theta;). (D) All of the above
New on Blog