Answer to Question #31007 in Prolog for Sujata Roy
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
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!
Learn more about our help with Assignments:
Prolog
Comments
Leave a comment