15 views

Uploaded by Matthew Everett

- CSC_226_002_syllabus_Barnes_002
- Chapter1 Cheat Sheet
- Formal Proofs of Validity Di-And-Ni by COPI AND COHEN
- Some Solutions to Enderton Logic
- No US Troop Survives if Iran is Attacked
- Logic For Computer Science
- Logic WithoutTruth Klima
- Knowledge Representation and Reasoning
- Girle - Modal Logics and Philosophy
- Peter Suber, _Glossary of First-Order Logic.pdf
- Thirty - Eight Ways to Win an Argument
- Lecture 15-16 - KR Schemes
- Logic of Phantasy 13
- Action Theory Revision in Dynamic Logic
- Mathematical Logic
- Maybe You Should Talk to Someone: A Therapist, HER Therapist, and Our Lives Revealed
- Shoe Dog: A Memoir by the Creator of Nike
- Never Split the Difference: Negotiating As If Your Life Depended On It
- Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
- The Library Book

You are on page 1of 24

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 . . .

Problem = Solver = Solution Problem: The age of John is 3 times the age of Peter. In 10 years, it will be only 2 times. How old are John and Peter? Expressed as: J = 3P ; J + 10 = 2(P + 10) Solver: Gauss-Jordan (Variable Elimination) Solution: P = 10 ; J = 30

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 . . .

Problem = Solver = Solution Constraint Satisfaction/SAT: nd values for variables to satisfy constraints E.g., Sudoku, N-Queens, Graph Coloring, Magic Square, . . . Planning: nd action sequence to drive system from initial state to goal state Rubiks Cube, 15-puzzle, Blocks-World, Logistics, . . . Bayesian Networks, General Game Playing, Planning with feedback ... Solvers for these models are general; not tailored to specic domains Models are all intractable, and some extremely powerful Main challenge is computational: how to scale up Methodology is empirical: benchmarks and competitions We will focus mainly on SAT and Planning

Hector Gener, Intro to AI, Kings College, 2014 3

Logic is the study of valid forms of inference More than 2000 years old More recently, led to development of modern computers (Turing) Many other applications in Computer Science and AI representation languages programming languages verication systems inference in intelligent systems

Stench Breeze PIT

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?

John, Peter, and Tom order pizzas in a restaurant. The waiter eventually comes back with the pizzas, and asks Who ordered Margarita? and hands the Margarita pizza to John. Then he asks Who ordered Pepperoni? and hands the Pepperoni pizza to Tom. The waiter nally does not ask Who ordered Gorgonzola?; rather he hands the Gorgonzola pizza directly to Peter.

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.

Propositional language dened inductively as set of expressions P such that propositional symbols p, q , r, . . . are in P , if A in P , A is in P if A in P and B in P , then (A op B ) in P for op {, , }

Expressiones in P called formulas Operators in {, , , } called connectives, unary or binary. Often parentheses omitted when no ambiguity created (precedence rules as in arithmetic)

(p q ): read p or q (p q ): read p and q (p q ): read p implies not q (p q ): read its not the case that p and q , .. Logical structure of English sentences encoded by suitable formulas: If John goes to the party, Peter will go as well: p q If Peter goes, then neither Mary nor Anne will go: p (m a) The machine is on but not working: on w Light is red only when machine is on and not working: (red (on w)) ((on w) red) Its not true that both Peter and Tom came: (p t) Only one of them came: (p t) (p t)

Hector Gener, Intro to AI, Kings College, 2014 9

Its useful to visualize the structure of a formula as a tree whose leaves are the symbols in the formula, and whose internal nodes represent the connectives: The tree associated with symbol p has just pas only node The tree associated with A has root node connected to root of tree for A The tree associated with (A op B ) has root node op connected to roots of trees for A and B Syntactic tree for formula (p (q r)) is: p

Hector Gener, Intro to AI, Kings College, 2014

q r

10

Semantics determines when inference of formula B from A1, . . . , An is valid B is then said to follow from A1, . . . , An or to be deducible If inference is valid, written as A1, . . . , An |= B ; if not, as A1, . . . , An |= B Formulas Ai called premises and formula B conclusion E.g., is inference from (p (q r)) and (q r) to p r valid? i.e., is it (p (q r)), (q r) |= p r or (p (q r)), (q r) |= p r As we see next, semantics determines validity of inference in terms of the truth of tentative conclusion B in the truth valuations that satisfy all the premises A1 , . . . , A n

11

A truth valuation v over language P is an assignment of truth values (true, false) to the symbols in P A truth valuation over the symbols in P determines a truth valuation V over all formulas in P by virtue of truth tables associated with the connectives For example, if v such that v (p) = v (q ) = true, then V (p q ) = V (p q ) = true Formally, given truth valuation v over symbols, V (A) is true i A A A A A is is is is is symbol p and v (p) is true B and V (B ) is false (B C ) and V (B ) or V (C ) is true (B C ) and both V (B ) and V (C ) are true (B C ) and its not the case that V (B ) is true and V (C ) is false

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

Inference of formula B from A1, . . . , An is valid, written A1, . . . , An |= B , i all the valuations that satisfy all premises A1, . . . , An, satisfy conclusion B Examples: p q |= p p q, q |= p p q, q r |= p r p q |= q p p q |= q p Brute force procedure for testing validity: check truth of premises and conclusion in each of the 2n possible valuations, where n is the number of symbols involved in these formulas In the worst case, one cannot do better, but on average yes . . .

14

A formula A is a tautology if |= A A is a contradiction if it is not satisable, which means if |= A A and B are logically equivalent if satised by the same valuations Some properties: A |= B i |= (A B ) A |= B i (A B ) is a contradiction A and B logically equivalent i |= ((A B ) (B A)) Some examples; A and B logically equivalent abbreviated as A B : A A is a tautology A A is a contradiction p and p logically equivalent (double negation) (p q ) and (p q ) logically equivalent (distribution) (p q ) and (p q ) logically equivalent (distribution) (p q ) and (p q ) logically equivalent (material implication)

15

Semantics characterizes valid inference, but provides no rules for constructing valid inferences Proof theory provides rules for capturing all and only valid inferences A proof theory P denes derivations in terms of axioms and rules of inference A derivation is a nite sequence of formulas, in which each formula is an axiom in P , a premise, or follows from earlier formulas in the sequence by a rule of inference in P B is derivable from A1, . . . , An in P , written A1, . . . , An derivation for B in P with premises A1, . . . , An A proof theory P is sound if A

P P

B if there is a

B implies A |= B

P

Hector Gener, Intro to AI, Kings College, 2014

B

16

Axiomatic Systems: based on a few axiom schemas and one or two rules of inference (e.g., modus ponens with the form if H A B and H A, then H B ). Derivations often long and not natural. Natural Deduction: based on no axioms and a several rules of inference. Natural derivations can be constructed by hand, but dicult to control automatically. Resolution based on no axioms and a single (resolution) rule of inference that works on clauses only (disjunction of possibly negated atoms, also called literals).

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

Model the following argument in propositional logic and prove the conclusion both semantically and using resolution.

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

DPLL is sound and complete proof procedure for SAT DPLL uses resolution but in restricted form called unit resolution in which one parent clause is unit clause Unit resolution is very ecient (linear) but not complete (Example: q p, q p, q p, q p) When Unit Resolution gets stuck, DPLL picks undetermined variable, and splits the problem in two: one where the variable must be true; the other where it must be false DPLL(clauses) Unit-resolution(clauses) if Empty Clause in Clauses, Return False else if all Variables are determined in Clauses, Return True else pick Non-determined Variable VAR, and Return DPLL(clauses + VAR) OR DPLL(clauses + NEG VAR)

Hector Gener, Intro to AI, Kings College, 2014 22

CSPs provide generalization of SAT In CSPs, the (main) task is to nd an assignment to a set of variables that satises a set of constraints However, variables do not need to be boolean (true, false), and constraints do not have to be clauses. Other nite domains and constraints accommodated. Examples: Sudoku, N-Queens, Magic Square, Graph Coloring, ... All these problems can be mapped into SAT, although often convenient to use methods that are similar to DPLL in richer CSP context Indeed, it is not easy to express some constraints as clauses (e.g., that sum of rows, columns, and main diagonals must be equal in Magic-Square, etc).

23

Scenario: Peter or Tom may show up at work. If both are in, the light is green. If one of them is in, the light is yellow. If none is in, the light is red. Model the scenario in propositional logic and show that: If the light is red, Peter is not in If the light is yellow and Peter is not in, then Tom is in. Show this: Semantically, by showing that conclusion is true in valuations that satisfy the premises Proof-theoretically by resolution, by reducing premises and negation of conclusion to clauses, and deriving 2 Computationally, by executing DPLL over such clauses Do the same with the pizza problem above: state the premises, conclusion, etc.

24

- CSC_226_002_syllabus_Barnes_002Uploaded byRobb Tapp
- Chapter1 Cheat SheetUploaded byLuIs I. GuTi
- Formal Proofs of Validity Di-And-Ni by COPI AND COHENUploaded byTRANSLATED LIFE CHANNEL
- Some Solutions to Enderton LogicUploaded byJason
- No US Troop Survives if Iran is AttackedUploaded byJbingfa Jbingfa X
- Logic For Computer ScienceUploaded bymmrmathsiubd
- Logic WithoutTruth KlimaUploaded byDaniel De Vito
- Knowledge Representation and ReasoningUploaded byEk Rah
- Girle - Modal Logics and PhilosophyUploaded byelias
- Peter Suber, _Glossary of First-Order Logic.pdfUploaded bylimuvi
- Thirty - Eight Ways to Win an ArgumentUploaded bykostas
- Lecture 15-16 - KR SchemesUploaded byimrana_jabeen25
- Logic of Phantasy 13Uploaded byChun-hsiung Chen
- Action Theory Revision in Dynamic LogicUploaded byIvan José Varzinczak
- Mathematical LogicUploaded byasdawanwuwi

- Chapter 01 the Gamma and Beta Functions (01)Uploaded byMuhammad Ashfaq Ahmed
- MBT Lecture 01Uploaded byAyaz
- Understanding Turbo CodesUploaded byapi-3747046
- LA TRANFORMADA DE DARBOUXUploaded byGuillermo Aleman
- Joule ThoUploaded byMDLULIARTHUR
- FPWin Pro GuideUploaded byValdinei Oliveira
- RtdUploaded byRavi Teja
- TradersWorld 51Uploaded byMassimo Raffaele
- Asymmetric Behavior of Propeller–Rudder SystemUploaded bysumardiono10
- A.Thomas Perceptual Presence, Representation and ImaginationUploaded byKasia Szymańska
- chapter 14 - heatUploaded byapi-285146233
- Aggregation operators of neutrosophic linguistic numbers for multiple attribute group decision makingUploaded byMia Amalia
- Intelligent System Based Car Collision PreventionUploaded bySolomon Genene
- FW Lawvere - State Categories and Response Functors 1986Uploaded bymatt
- BusinessUploaded bysuehanna1987
- Vidya t Tama 2013Uploaded bydooeelh
- (1)Statistics in QbD Stats WS 09-06Uploaded byepalo
- Application of Spatial Statistics to Latent PrintUploaded byGabriela Mogos
- Line SizingUploaded bynagaraj108
- BET Model NptelUploaded byAshwin Sudhakaran
- Grade VI - Budget of Work 1stUploaded byMelinda Rafael
- Linear AlgebraUploaded bylelu8210
- Control ValveUploaded bySumner Ting
- 2008_Chapuisetal_MolEcolUploaded byAli Can
- On the Numerical Solution of Volterra-Fredholm Integral Equations with Exponential Kernel using Chebyshev and Legendre Collocation MethodsUploaded byAHMED
- Cyclic Direct Simple Shear Test to Measure Strain-Depandent Dynamic Properties of Unsaturated SandUploaded byNaveen Kanwat
- 04 PF#4 Product, Process and Schedule DesignUploaded byIram Chavira
- scipy-ref-0.18.1Uploaded byDelson Jose
- Cadbury ProblemUploaded byManoj Prabhakar
- Evaluating the Damage in Steel MRF under Near Field Earthquakes from a Performance Based Design Viewpoint (Rofooei, et al. 2011).pdfUploaded byJose Manuel