Question: Formal logic, knowledge representation and symbolic reasoning Prolog is a declarative programming language that allows you to create a knowledge base by writing first-order logic
Formal logic, knowledge representation and symbolic reasoning
Prolog is a declarative programming language that allows you to create a knowledge base by writing first-order logic sentences, and then pose queries to that knowledge base. The language itself takes care of performing the necessary inference; your role is primarily that of correctly specifying the problem and the query you need answered.
You may use any implementation of Prolog for this question. SWI-Prolog is recommended as it is very straightforward to install and use. A current stable version for your platform can be freely downloaded from www.swi-prolog.org/, where you will also find comprehensive documentation.
a) Explain, in your own words, what is meant by the following terms, in the context of formal logic:
-
Soundness.
-
Completenes.
-
Consistency.
-
Validity.
b) For this question you should use reasoning patterns which are either explicitly listed in the subject guide, pp.2022, or can be produced using the logical equivalences in Figure 4.1. Show which literals can be inferred from the following knowledge bases, using both reasoning patterns and truth tables. Show all steps in your reasoning and explain your answers.
-
P Q
Q (R S)
P S
-
(P Q) P v Q
Q R
R
-
(A v B) C
(B C)
c) Represent the following statements as formulas in Predicate Calculus, stating the intended interpretation of any predicates and constants that you use. You should give two versions of each formula, one using the existential quantifier and one using the universal quantifier
(plus any Boolean connectives required in each case).
-
A musician is someone who plays a musical instrument or sings.
-
Pianos, trumpets, guitars, saxophones and trombones are musical instruments.
-
Trumpets, saxophones and trombones are kinds of horn. [note: jazz parlance]
-
Not all musical instruments are horns.
-
Some singers play the trumpet.
d) Encode the following facts about jazz and blues performers as Prolog clauses. Note: you may need to code more than one clause for each numbered sentence. You should keep the queries (ivi) below in mind when deciding how to structure your clauses.
-
Billie Holiday, Bessie Smith, Chet Baker and Louis Armstrong were all singers.
-
Chet Baker, Louis Armstrong and Dizzy Gillespie played the trumpet.
-
Count Basie, Thelonious Monk, Duke Ellington and Mary Lou Williams played the piano.
-
Count Basie, Duke Ellington and Chick Webb were big-band leaders.
-
Charlie Parker, John Coltrane and Lester Young played the saxophone.
-
Chick Webb was a drummer.
-
Django Reinhardt, Wes Montgomery, Robert Johnson and BB King played guitar.
-
Robert Johnson, BB King, Bessie Smith and Billie Holiday were blues artistes.
-
Charlie Parker, Dizzy Gillespie, Thelonious Monk and Mary Lou Williams played in the bebop style.
Use your Prolog implementation to derive answers to the following queries, based on the information given in (19) above. You may need to encode some additional common sense inferences and/or other reasonable general statements as Prolog clauses. Explain your results.
-
List all the musicians in your knowledge base.
-
Give the name of a bebop trumpeter.
-
Was Count Basie a trumpeter?
-
List all non-bebop saxophonists.
-
List all big-band leaders who played the piano.
-
Give the names of singers who played an instrument.
Answers will be marked on the following criteria:
-
Clear and correct solutions returned to queries.
-
Compact, well-structured and readable code.
-
Clear and accurate explanations.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
