Which one of the following prolog programs

Assignment Help Basic Computer Science
Reference no: EM131013039

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: EM131013039

Questions Cloud

Show how the basic eps you calculated should be reported : Calculate diluted earnings per share for 2013 and the incremental EPS of the preferred stock and convertible bonds. If required, round your answers to the nearest cent.
In your own words define standard deviation : The standard deviation is one of the most important concepts in the area of statistics. In your own words, define standard deviation. Give an example of how you have used the concept of standard deviation in your life
Show that the area under the curve is infinite : Show that the area under the curve is infinite. Show that the volume of the solid of revolution enclosed by the curve is finite, and compute it. [This solid of revolution is known as Gabriel's Horn.]
Jess transfers the note for value to pam : Gil makes out a $900 negotiable promissory note payable to Ben. By special indorsement, Ben transfers the note for value to Jess. By blank indorsement, Jess transfers the note for value to Pam.
Which one of the following prolog programs : 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).
The area of a right-angled triangle is computed : The area of a right-angled triangle is computed by multiplying the length of side a by the length of side b and then multiplying the result by 0.5. Define a function that accepts two arguments of an appropriate data type for the length of side a and ..
Determine the speed of the collar after the applied force : The collar has a mass of 30 kg and is supported on the rod having a coefficient of kinetic friction mu k = 0.4. The attached spring has an unstretched length of 0.2 m and a stiffness k = 50 N/m. Determine the speed of the collar after the applied ..
Write expression to represent total number of graphic novels : Alexis, Brian, and Carli collect graphic novels. Brian has 5 more graphic novels than Alexis and Carli has twice as many as Alexis. Define a variable and write an expression to represent the total number of graphic novels for the three people
Based on the statement you have prepared : Based on the statement you have prepared, do you agree with the decision to eliminate the cocoa powder? Explain your answer.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What advantages does using software

What advantages does using software have over just using the hardware circuits to program the computer?

  Program to print astericks for every number that user enters

One interesting application of computers is drawing of graphs and bar charts (sometimes called histograms). Write down script which reads five numbers between 1 and 30.

  Customer with attributes customerid

TNB electric want to create a database with the following entities- Customer with attributes CustomerID, CName, CAddress(Street, City, State, ZipCode) and CTelephone- Location with attributes LocationID, Address (Street, City, State, ZipCode) and Typ..

  Research and discuss applications in a specific device

Discuss further thoughts on the importance of path finding to devices like GPSs. Conduct some research and discuss applications in a specific device

  Poductive discussion on your findings related to the human

At the next meeting, you and the team had a very productive discussion on your findings related to the human resource planning and related team management processes. Everyone feels that it is time to present your findings to Sam and Gloria.

  A boolean matrix has the parity property

A Boolean matrix has the parity property when each row and each column has an even sum, i.e. contains an even number of bits which are set. Here's a 4 x 4 matrix which has the parity property:

  Style is require but comments are not

Style is require but comments are NOT required.  ? Include appropriate import statements for your file.

  Explaining sites appropriate for mobile devices

What do you think are some of the types of sites that would be appropriate for mobile devices? What types of sites do you think are inappropriate?

  Prove that s has infinite cardinality

1. Suppose that S is the set of all strings of one or more a's and b's. For example, S contains the strings "a", "b", "aa",  "ab", "ba", "bb",  "aaa",  "aab"  ..., etc.

  Complete the migration

A few months after you complete the migration you are contacted because one of the employees has had persistent issues logging on to the network and believes that you may have made an error during the migration. You need to check the workstation to v..

  Draw dfsa for identifiers contain only letters and digits

Draw a DFSA for identifiers that contain only letters and digits, where the identifier must have at least one letter, but it need not be the first character. Hint: everything to the left of the leftmost letter must be a digit.

  Enable the user to input a series of non-negative numbers

Write a program that will enable the user to input a series of non-negative numbers via an input statement. At the end of the input process, the program will display: the number of odd numbers and their average; the number of even numbers and their a..

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