G succeeds then execute goal p else execute goal q

Assignment Help Basic Computer Science
Reference no: EM131013051

Which one of the following prolog programs correctly implement "if G succeeds then execute goal P else execute goal q ?"

(A) if-else (G, P, q) :- !, call(G), call(P).

if-else (G, P, q) :- call(q).

(B) if-else (G, P, q) :- call(G), !, call(P).

if-else (G, P, q) :- call(q).

(C) if-else (G, P, q) :- call(G), call(P), !.

if-else (G, P, q) :- call(q).

(D) All of the above

Reference no: EM131013051

Questions Cloud

Sum of the numbers shown uppermost : A pair of fair dice is rolled. What is the probability of each of the following? (Round your answers to three decimal places.) (a) The sum of the numbers shown uppermost is less than 4
Determine the reaction forces at e and d : The booms BE and CD are also pinned to the cross-link BC using smooth pins at B and C. The length of boom BE = CD = 6.5 m. The weight of BE, CD and BC are very small and can be ignored in the analysis. Determine the reaction forces at E and D.
Give three types of computer networks topology : Give three types of computer networks topology and suggest the best topology
Determine the price of a bond issue : Determine the price of a $200,000 bond issue under each of the following independent assumptions: 20 years semi-annually 12% & 12%
G succeeds then execute goal p else execute goal q : Which one of the following prolog programs correctly implement "if G succeeds then execute goal P else execute goal q ?" (A) if-else (G, P, q) :- !, call(G), call(P). if-else (G, P, q) :- call(q).
Design and write an assembly language program : Design and write an assembly language program for the MARIE processor that counts the number of occurrences of a particular word value in an array of words.
What is the height of the trapezoid : A trapezoid has base lenghts of 19.5 and 24.5 centimeters with an area of 154 cm squared. What is the height of the trapezoid
What is the critical slope for channel : You are building a new channel and the local guidelines say that the critical slope and the bed slope can not be the same. Assuming a rectangular channel with 10ft base width and roughness of 0.015, what is the critical slope for the channel if th..
When inflation is not considered : a. When inflation is not considered. b. When inflation is considered

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What is the probability that he is actually guilty

And how can you explain this puzzling result? (First of all, you may need to explain why it is puzzling. Then explain why it really makes sense even though it seems to be puzzling.)

  What are the benefits of using tangible interfaces

What are the benefits of using tangible interfaces compared with other interfaces like GUI, pen-based or gesture?

  Evaluating the website of manchester united

Evaluate the features of Manchester United website in terms of its usability, legal requirements and ease of search by search engines. You need to make use of relevant usability evaluation techniques, knowledge of how a search engine works and leg..

  Find the error in the following pseudocode

Find the error in the following pseudocode

  These function prototypes lack parameters

These function prototypes lack parameters; add whatever parameters you feel are necessary so that the program works without global variables. The program's output should reflect the bus's actions by reporting each change in state, along with the n..

  Numbers as 4-bit words in 2''s complement form

Q. Assume the following numbers are represented as 4-bit words in 2's complement form. Perform the following operations and identify, in each case, whether or not an overflow occurs

  Collaborate about this discussion

collaborate about this discussion? I agree that either an external style sheet or embedded style sheet are the best options.

  Writing solution for the case

For many years, you have had a computer in your 100 year old plaster-walled 10 foot high ceiling home for all members of the family to use. Recently, however, you added a second computer.

  Write the truth table for a device

The output should be in Binary Coded Decimal representation. 4. Use Full Adders and logic gates to design a device which will multiply a given 4-bit signed input x by -2.

  Create a class called word

Create a function display(string) which prints to the file with name equal to the string parameter, an alphabetical list of all words contained in the list along with the number of times they appeared in the input file.

  What is a data warehouse and what are the benefits

What is a data warehouse and what are the benefits provided to management at all levels in your organization?

  Avl trees and unbalanced binary search trees

Write a program to perform random operations on splay trees. Count the total number of rotations performed over the sequence. How does the running time compare to AVL trees and unbalanced binary search trees?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd