Chapter 16 Flashcards
Other name for Logic programming languages
Declarative Programming languages
How are logic programs expressed?
Form of symbolic logic
Is it declarative or procedural?
Declarative: Only specify the form of results
What is a proposition?
Logical statement that can be true or false
What does a proposition consist of?
1+ objects and Relationships among objects
What are the 3 basic needs of formal logic?
Express propositions
Express relationships between propositions
Describe how new propositions can be inferred from other propositions
What is 1st order predicate calculus.
Form of symbolic logic that is used for logic programming
Object representation in predicate calculus
Represent objects in propositions.
What is a constant in predicate calculus?
A symbol that represents a particular object
What is a variable in predicate calculus?
A symbol that can represent different objects at different times
Is variables in imperative languages the same as in predicate calculus?
No
What are the 2 types of propositions?
Atomic propositions
Compound propositions
How does atomic propositions differ from compound propositions?
Compound propositions represent mathematical relations (written like mathematical functions)
Atomic propositions are represented by compound terms
What are the 2 parts of a compound term?
Functor (function symbol that names the relation)
Ordered list of parameters (tuples)
Example of a compound term:
student(jon)
like(seth, osx)
What are the 2 forms of propositions?
Fact: (assumed to be true)
Query: Truth of a proposition is to be determined
Example of fact and query
Fact = Jon is a student
Query = Can you prove that Jon is a student?
What are compound propositions?
2+ atomic propositions where atomic propositions are connected by operators
What are the 5 logical Operators?
negation
conjunction
disjunction
equivalence
implication
How many logical operators are there?
5
What are the quantifiers and and what do they mean?
Universal (upside down A) AX.P -> For all X, P is True
Existential (Backwards E) EX.P -> There exists a value of X such that P is true
How do we infer facts from known propositions?
Using resolution since resolution is an inference principle
What does the unification process do?
Finds values for variables in propositions that allow the matching process to succeed
What is instantiation?
Assigning temporary values to variables to allow unification to succeed
What happens if matching fails when instantiating a variable?
You backtrack and instantiate the variable with a different value
Steps of Proof by Contradiction
Hypotheses (set of assumed propositions)
Theorem (new proposition we want to infer)
Goal (Negation of theorem stated as a proposition)
Proof by contradiction (Theorem proved by finding an inconsistency with the goal)