Chapter 9 - Inference in First-Order-Logic Flashcards
Themes
Inference for quantifiers
Reduce from FOL to Propositional logic
Construction of inference rules
Families of first order logic inference algorithms
What is the “simplest” way of doing inference on first order logic?
The simplest way is probably to convert FOL to propositional logic.
Vx King(x) AND Greedy(x) => Evil(x)
This we could convert to propositional logic by listing all the individual instances of x. Richard, John, Father(John) etc
This is essentially called “Universal Instantiation”
What is a universally quantified variable?
A universally quantified variable is a variable that goes through ALL objects in the domain, and is applied to a logical statement.
What is a ground term?
A ground term is a term that contains no variables. It will be a constant symbol, or a function symbol. The point is that we KNOW the object we are considering.
What is Universal Instantiation?
Universal instantiation is an inference rule that connects a specific object to a general/universal statement.
It is about being able to substitute the universally quantified variable with a constant symbol (object), also known as a ground term, and still get a result that is true.
Consider the substitution {x/John}, what does this mean?
It means that we replace occurence of x with John.
Elaborate on SUBST(theta, alfa)
SUBST(delta, alfa) is the result of applying the substitution “delta” to the sentence “alfa”.
Formally, the inference rule of Universal instantiation can be written like this:
Vx P / SUBST({x/g}, P)
Elaborate on this
It says that for all x, P is true. And in these cases, we get that the applying the substitution x/g gives us some result.
g is basically a ground term corresponding to each individual value of the variable x.
P is a statement that is true for all x.
IMPORTANT:
The rule basically says that for all instances of a universally quantified variable x, we can receive a new sentence by replacing/substituting a ground term in for the variable.
Recall what an existential statement actually is
Ex P
The statement says that “There exists at least one variable x in our domain, for which the statement P is correct/true”.
Elaborate on EI:
Ev a / SUBST({v/k}, a)
EI says that: There exists at least one v that makes the statemetn/sentence a true, which will give us the opportunity to substitute this specific instance with a NEW constant symbol that represent this specific case. IMPORTANT: k must be a NEW symbol, so that we dont infer shit about old terms in our KB.
Due to the nature of the existential quantifier, we only need a single instance.
In logic, we call the new name a “Skolem constant”
What is a “skolem constant”?
Skolem constant is what we call the new name used in EI
What is the point of EI and UI?
To remove the quantifiers so that we can apply inference to the statements.
In very broad terms, how do we convert a KB that use first order logic to a KB that is only propositional?
For UI, we instantiate all possible ground terms/objects we have in domain/KB.
For EI we need only one.
Then we replace atomic sentences, such as King(John), with propositional symbols like “JohnIsKing”.
Then we apply some complete inference algorithm to get a conclusion like “JohnIsEvil”, which is equivalent to Evil(John).
NOTE: If the knowledge base includes a function symbol, the set of possible ground terms become infinite. This is due to the nesting that may occur. For instance, Father(John), Father(Father(John)) etc.
There is a theorem that sort of avoids this though.
Elaborate on how to avoid the problem of inifnite ground terms/nests while using function symbols
There is a theorem that says the following:
If a sentence x is entailed by the original knowledge base, then it will involve just a finite subset of the propotionalized knowledge base. Therefore, we know that if the sentence is in fact entailed by KB, it will be within a finite nesting. Therefore, we can explore depths incrementally until we find the answer.
NB VERY IMPORTANT: We cannot actually tell if a sentence is entailed or not by this method, as if the sentence is not entailed, the algorithm would ocntinue infinitely long. This resemble the halting problem.
In other words, we have algorithms that can verify entailment, but not solve it.
Say we have the following rule in our KB:
King(x) AND Greedy(x) => Evil(x)
How can we answer the query Evil(x)?
We want to find x that are evil.
We want to use the rule, the implication. if we can manage to find some x that satisfy being king and being greedy, then this x will be our result.
In order for the conclusion of the implication to yield true, we need both conjuncts of the premise of the implication to yield true. To do this, we need to find some sentences in our KB that serve as substitutions for the conjuncts in the premise. The subsitution is key.
Say we already have in our KB that Greedy(John)
King(John)
Then we’d solve it immediatly. Therefor,e the substitution delta = {x/John} would achieve the aim.
Suppose we have the following rules in our KB:
King(x) AND Greedy(x) => Evil(x)
King(John)
Vy Greedy(y). “for all y, Greedy(y)”
How do we answer the query Evil(x)?
We would still like to conclude that Evil(John), because we know that John is a king and John is greedy, because all people are greedy.
We need to find a substituon delta for both variables in the implication sentence and the variables in the sentences that are in the knowledge base.
If we use the substitution delta={x/John, y/John}, we get the following:
RULE = King(John) AND Greedy(John)
KB = King(John), Greedy(John)
They become identical. Thus we can infer the consequent of the conclusion.
What we have done here, is to basically find some substitution for variable x and y that make the rule true based on facts from our kb.
Elaborate on generalized modus ponens
Generalized modus ponens is strictly speaking not reserved for first order logic. However, we are considering the “lifted” version, which takes substitutions into account.
For atomic sentences p_i, p_i* and q, where there is a substitution delta such that:
SUBST(delta, p_i*) = SUBST(delta, p_i) for all i, then:
(p_1, p_2, …, p_n*, (p_1 and p_2 and … and p_n => q)) / SUBST(delta, q)
What does this mean?
The atomic sentences, as we remember, are sentences without logical connectives. They are facts.
So, if we have a list of these facts, and a list of other facts that are involved in an implication rule, then we are looking for the following: We are looking for a substitution that make the conjuncts in the premise of the implication rule true by showing that the other facts we have in the KB can be substituted to the conjuncts facts by using the substitution.
If this happens to be the case, we get the result of SUBST(delta, q) which gives the sentence q when we apply substitution delta.
There are n atomic sentences (facts in KB), and one implication. The conclusion is the result of applying the substitution delta to the conclusion q.
Note that the substitution delta must apply to ALL i.
Generalized modus ponens is sound.
What does it mean that generalized modus ponens is lifted?
Lifted means that it has been transferred from variable-free propositional logic to be applicable to first-order logic.