1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
pashok25 [27]
3 years ago
15

Write the following statements as Prolog clauses, in the order given: If it is raining or snowing, then there is precipitation.

If it is freezing and there is precipitation, then it is snowing. If it is not freezing and there is precipitation, then it is raining. It is snowing. What answer does Prolog give to the following queries: Is it freezing
Engineering
1 answer:
Anika [276]3 years ago
8 0

Answer:

a. See Explanation Below

b. No

Explanation:

a.

Interpreting the statements line by line.

First, the prolog clauses need to be initialised, as follows:

:- dynamic freezing/0, precipitation/0, snowing/0, raining/0.

If it is raining or snowing, then there is precipitation.

The statement is splited in two.

1st, if it is raining then there is precipitation

Or

2nd, if it is raining, then there is precipitation.

So, both statements are given as:

precipitation :- raining.

precipitation :- snowing.

If it is freezing and there is precipitation, then it is snowing.

This is a conditional statement that checks if it is freezing AND there's is precipitation.

If true, then it is snowing.

The above statement is given as:

snowing :- freezing, precipitation.

If it is not freezing and there is precipitation, then it is raining.

This is a conditional statement that checks if it is not freezing AND there's is precipitation.

If true, then it is raining.

The not clause is represented as \+

The above statement is the given as:

raining :- \+ freezing, precipitation.

It is snowing.

This is represented as follows

snowing.

So, the full prolog clause is as follows

:- dynamic freezing/0, precipitation/0, snowing/0, raining/0.

precipitation :- raining.

precipitation :- snowing.

snowing :- freezing, precipitation.

raining :- \+ freezing, precipitation.

snowing.

b. What answer does Prolog give to the following queries:

Is it freezing

No

Reason;

All of the conditions above point to raining or snowing; none points to freezing.

Hence, it is no.

You might be interested in
Can be used to eliminate rubbing friction of wheel touching frame. 1.Traction 2.Thrust washer
Vilka [71]

Answer:

thrust washer

can be used to eliminate rubbing friction of wheel touching frame

5 0
3 years ago
Please write the following code in Python 3. Also please show all output(s) and share your code.
maksim [4K]

Answer:

sum2 = 0

counter = 0

lst = [65, 78, 21, 33]

while counter < len(lst):

   sum2 = sum2 + lst[counter]

   counter += 1

Explanation:

The counter variable is initialized to control the while loop and access the numbers in <em>lst</em>

While there are numbers in the <em>lst</em>,  loop through <em>lst</em>

Add the numbers in <em>lst</em> to the sum2

Increment <em>counter</em> by 1 after each iteration

6 0
3 years ago
Which of the following positions would be responsible for attaching I-beams to a crane?
prohojiy [21]

Answer:

Rigger

Explanation:

<em> work as one</em>

4 0
2 years ago
Can the MOXIE created by NASA be used on earth
Alisiya [41]

Answer:

MOXIE is designed to generate up to 10 grams of oxygen per hour. This technology demonstration was designed to ensure the instrument survived the launch from Earth, a nearly seven-month journey through deep space, and touchdown with Perseverance on Feb

4 0
3 years ago
Many households in developing countries prepare food over indoor cook stoves with no ducting system to exhaust the combustion pr
lorasvet [3.4K]

Answer:

   C = 0.22857 ng / m³

Explanation:

Let's solve this problem for part the total time in the kitchen is

          t = 2h (60 min / 1h) = 120 min

The concentration (C) quantity of benzol pyrene is the initial quantity plus the quantity generated per area minus the quantity eliminated by the air flow. The amount removed can be calculated assuming that an amount of extra air that must be filled with the pollutant

amount generated

         C = co + time_generation rate / (area_house + area_flow)

         C = 0.2 + 0.01 120 / (40+ 2)

         C = 0.22857 ng / m³

7 0
3 years ago
Other questions:
  • The pressure in an automobile tire depends on thetemperature of the air in the tire. When the air temperature is25°C, the pressu
    11·1 answer
  • The solid cylinders AB and BC are bonded together at B and are attached to fixed supports at A and C. The modulus of rigidity is
    6·1 answer
  • In your Reader/Writer Notebook, write a short first-person narrative from the perspective of the bank clerk, describing her phys
    12·1 answer
  • Write a function called pyramid(height) that acceptsa parameter ""height"". It then prints a pyramid of that height
    10·1 answer
  • All sized companies are required to have a written fire prevention plan true or false
    14·2 answers
  • Importance of civil engineering in nepal?​
    10·1 answer
  • Describe the relationship between atomic structure and Youngs' modulus?
    15·1 answer
  • The difference in potential energy between an electron at the negative terminal and one at the positive terminal is called the _
    11·1 answer
  • The production of carbon dioxide makes it unwise and unsafe to operate a tractor or any motor vehicle inside enclosed spaces suc
    13·1 answer
  • A new approval process is being adapted by Ursa Major Solar. After an opportunity has been approved, the contract is sent to the
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!