Answer to Question #31007 in Prolog for Sujata Roy

Question #31007
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
0
Expert's answer

Answer in progress...

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS