Académique Documents
Professionnel Documents
Culture Documents
By using right data-structures, heuristic search algorithms, and heuristic functions, its possible to write programs for solving problems like: Rubiks Cube 15-puzzle Blocks-World Route Finding, etc. Intelligence, however, is tied to the ability to solve new problems Can we actually write such general programs; i.e., programs capable of solving an innite collection of problems not anticipated by programmmer? Such programs called solvers; well move in that direction now . . .
Solver is general as deals with any problem expressed as an instance of model Linear Equations Model, however, is easy (polynomial); AI models are not . . .
Breeze
The Wumpus World is game used in main AI textbook (Russell and Norvig) Agent must grab gold while avoding little monster and pits Gold, monster, and pits locations, however, unknown Agent has sensors to detect stench, breeze, brightness Stench and breeze sensed next to monster and pit; brightness sensed where there is gold
Where agent should move next? What are the following moves? Why?
Questions: What is the inference made by the waiter? Is the inference correct? Why? Is it about pizzas or something more general? How can this be done in general? Logic provides an answer to all these questions . . . and more
Hector Gener, Intro to AI, Kings College, 2014 6
Logic
A formal system covering three dimensions: Formal Language: denes the formulas Formal Semantics: denes what is a valid inference Proof Theory: denes rules for making valid inferences. Logics come in many forms and shapes, like propositional and predicate logic, modal logics, conditional logics, and so on, according to form of inferences that want to be captured. We will focus on propositional logic.
Expressiones in P called formulas Operators in {, , , } called connectives, unary or binary. Often parentheses omitted when no ambiguity created (precedence rules as in arithmetic)
q r
10
11
12
Example
Determine truth value V (A) of formula A = (p q ) (r q ) given valuation v such that v (p) = v (q ) = v (r) = true Find truth valuation v that makes the formula true, i.e., V (A) = true Its common to write true as 1 and false as 0 Also, a valuation is said to satisfy a formula if it makes it true A formula is satisable if there is a valuation that satises it
13
14
15
B if there is a
B implies A |= B
P
B
16
17
Resolution: Clauses
Resolution works over formulas of a special type called clauses A clause is a set literals where a literal is a prop. symbol p or its negation p The clause with no literals is called the empty clause, 2, which is unsatisable E.g., p q r is a clause, p is a clause; p q and p are not clauses Any set of formulas can be converted into a logically equivalent set of clauses E.g., p (q r) is logically equivalent to {p q, p r}
18
Resolution Rule
The resolution rule takes two clauses such that one contains a literal p and the other contains the complementary literal p, and produces a third clause; more precisely: if p C and p C , then C C , where C and C are (potentially empty) clauses This is resolution on the literal p that produces the resolvent C C As another example, the resolution of two clauses q r p and t r on the literal r produces the resolvent q p t; while the resolution of clauses p and p yields 2 Resolution is refutation complete, meaning that a set of clauses is unsatisable i empty clause 2 derivable by repeated applications of the resolution rule Thus, A1, . . . , An |= B i empty clause derivable from resolution from clauses encoding A1, . . . , An and B . Why?
Hector Gener, Intro to AI, Kings College, 2014 19
John killed Louis or Peter did it. If it was John, then Mary must have seen the killing and she must be shocked. Thus, if Mary is not shocked, Peter must have done it.
20
SAT Solvers
SAT is the problem of determining whether a set of clauses is satisable, and if so, determining a satisfying valuation. Many problems can be mapped into SAT such as Planning, Scheduling, CSPs, Verication problems etc. SAT is an intractable problem (exponential in the worst case unless P=NP) yet very large SAT problems can be solved in practice Best SAT (DPLL) algorithms not based on either pure case analysis (model theory) or resolution (proof theory), but a combination of both Currently very large SAT problems can be solved in this way SAT engines used for formally verifying designs in industry
21
23
24