layout: post
title: "KBAI 笔记 12 Logic"
date: "2019-01-01 08:36:51"
categories: 计算机科学
excerpt: "Preview Logic is a language allows to make association of the world in a..."
auth: conge
Preview
- Logic is a language allows to make association of the world in a precise way.
- it form the basis of planning
Why do we need formal logic?
Knowledge base: sentence in the language of logic; complete and correct
Rules of Inference engine:
Inferences About Birds
Exercise: Inferences About Foos
The sentences are language of logic
Predicates
":" means indicates.
If Feathers(animal): Then Bird(animal)
reads if animal has feathers, then animal is bird.
Conjunctions and Disjunctions
Implies
Notation Equivalency
Exercise: Practicing Formal Logic
Truth Tables
Exercise: Truth Tables I
Exercise: Truth Tables II (more complicated sentence)
In theory, we can calculate True or False values for very complicated sentences.
Exercise: Commutative Property
A & B is the same as B & A
Exercise: Distributive Property
- A &(B or C) is equivalent to (A and B) or (A and C)
Exercise: Associative Property
Exercise: Associative Property
- The associate property applies when there is only conjunction or disjunctions.
Exercise: De Morgan's Law
Truth of Implications
This is hard to understand: need to go back to the examples
But remember A=> B
is actually !A | B
.
Implication Elimination
Rules of Inference
- The rules here can be used for reasoning.
Prove Harry is a bird
Although the rules exist for a long times, it's hard to use these rules in AI agent because the computation is not feasible.
Universal Quantifiers and Existential Quantifier
- Propositional logic (zero-order logic): no variables.
- Existential and Universal Quantifier can be used with variables.
- Universal Quantifier mean given all values for the variable
- Existential Quantifier means at least one value
A Simple Proof
- convert every sentence into a conjunctive normal form.
not finished for this part. did not understand
exercise
- A efficient way to proof sentences
Wrap Up
The Cognitive Connection
- Formal and precise way to reason
- Human uses logic sometimes.. but its not a fundamental method.
- Human uses induction and abduction more for reasoning. logic is deductive.