Question

For each of the following English statements write a prolog program. % Facts & Rules (1)...

For each of the following English statements write a prolog program.

% Facts & Rules
(1) jane is a woman.
(2) john is a man.
(3) john is healthy.
(4) jane is healthy.
(5) john is wealthy.
(6) anyone is a traveler if he is healthy and wealthy.
(7) anyone can travel if he is a traveler.

% Goals (queries).
(8) Who can travel?
(9) Who is healthy and wealthy?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here is the prolog program for above questions,

  1. woman(jane).
  2. man(john).
  3. healthy(john).
  4. healthy(jane).
  5. wealthy(john).
  6. traveller(x):- traveller(x,healthy,wealthy).
  7. travel(x):-travel(x,traveller).
  8. ?-travel(who).
  9. ?-healthy(x),wealthy(x).
Add a comment
Know the answer?
Add Answer to:
For each of the following English statements write a prolog program. % Facts & Rules (1)...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • CSE 240 Homework 5- Programming with PROLOG Due: Monday, April 22, 11:59 PM A. What This...

    CSE 240 Homework 5- Programming with PROLOG Due: Monday, April 22, 11:59 PM A. What This Assignment Is About: Facts, Rules, Goals Prolog execution model Arithmetic operations . Recursive Rules B. Use the following Guidelines Give identifiers semantic meaning and make them easy to read (examples numStudents, grossPay, etc.) Use tabs or spaces to indent code within blocks (code surrounded by braces). This includes classes, methods, and code associated with ifs, switches and loops. Be consistent with the number of...

  • 7. For below English sentences write applicable Prolog facts, rules & goals. a) John reads a...

    7. For below English sentences write applicable Prolog facts, rules & goals. a) John reads a book. b) Anyone likes sundevils if he/she is an ASU student. c) Who likes sundevils? d) Jane likes any village if it is small and sparse.

  • Represent each statement as a PROLOG statement: The population of Zambia is 13 million.     [1 mark]...

    Represent each statement as a PROLOG statement: The population of Zambia is 13 million.     [1 mark] Zambia is a landlocked country.          [1 mark] Soldiers are men who are over 170 m tall.       [2marks] You are British if you are Welsh, English, Scottish or Irish. [2 marks] Those who play football, hockey or rugby are sportspeople. [2marks] Two people are siblings if they have the same parents. [2 marks] Two people live in the same house if they have the same...

  • R$ ( pseudocode only, I just need the English written pseudocode) Write pseudocode for a program...

    R$ ( pseudocode only, I just need the English written pseudocode) Write pseudocode for a program that prints a calendar such as the following: Su M T W Th F Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

  • write a program in C++ Suppose that the alphabets are given the following values: a=1, b=2,...

    write a program in C++ Suppose that the alphabets are given the following values: a=1, b=2, c=3, ..., z=26. Using this rule, we define the value of a word as the sum of the values of its letters. Thus, the value of the word cat is c+a+t = 3+1+20 = 24. Furthermore, the value of the phrase "a cat" is a+c+a+t=1+3+1+20=25. The value of a sentence, paragraph, and any larger unit of writing is similarly defined. When we compute such...

  • Java: can also use “if else” statements Write a program that can convert an integer between...

    Java: can also use “if else” statements Write a program that can convert an integer between 0 and 15 into hex number (including 0 and 15). The user enters an integer from the console and the program displays the corresponding hex number. If the user enters an integer out of range, the program displays a warning message about the invalid input. Table. Conversion between Decimal and Hexadecimal Decimal Hexadecimal 0 0 1 1 2 2 3 3 4 4 5...

  • I am using C++ Write a program to determine if a gird follows the rules to...

    I am using C++ Write a program to determine if a gird follows the rules to be classified as a Lo Shu Magic Square. The Lo Shu Magic Square is a grid with 3 rows and 3 columns shown in figure below. The Lo Shu Magic Square has the following properties: The grid contains the numbers 1 through 9 exactly. The sum of each row, each column, and each diagonal all add up to the same number. This is shown...

  • 2. Using the given logic rules, write a proof sequence for the following assertion. (11 points)...

    2. Using the given logic rules, write a proof sequence for the following assertion. (11 points) pva 4 → pist st זר 74 → Us Statements 1. p Va 2.91 3.(p Ast 4. r 5.9 → (UA) 6. Reasons Given Given Given Given Given 7. 8. 9. 10. 11. t

  • USING PYTHON LANGUAGE. QUESTION I: Write a program that displays the following table: a a^2 a...

    USING PYTHON LANGUAGE. QUESTION I: Write a program that displays the following table: a a^2 a 3 a14 1 1 1 1 2 4 8 16 3 9 27 81 4 16 64 256 QUESTION II: An approximate value of a number can be computed using the following formula: 7 ) Write a program that displays the result of 4 X + 7 • H) and 4 X - 를 7 tis). 9 QUESTION III: Write a program that prompts...

  • in c++ please Write a program in c+ to do the following: 1.Save the data shown...

    in c++ please Write a program in c+ to do the following: 1.Save the data shown below (in the same format) to make a text file called "InputData. txt"; use the file as input to enter data into a hash table. Fname Lname 2019-01-31 First Last 2018-02-01 Jonh Doe 2017-03-28 Jane Doe 2016-04-01 as the data items in the file 2. Your hash table should have as many entries 3. The birthday should be used as the hash key by...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT