Reactive Agents and Propositional Logic
PSU CS441/541
Lecture 2
October 4, 2001
- Logical Problem Representation
- Solving a problem with a computer (c.f. Ginsberg 6.1)
- accurately describe problem
- choose instance representation in computer
- select algorithm to manipulate representation
- execute
- What properties of representations are important?
- compactness: must be able to represent big instances
efficiently
- utility: must be compatible with good solution
algorithms
- soundness: should not report untruths
- completeness: should not lose information
- generality: should be able to represent all
or most instances of interesting problems
- transparency: reasoning about/with representation
is efficient, easy
- What instance representations do people choose?
- database: collection of facts
- neural net: collection of "neuron weights"
- functional: collection of functions
- logical: collection of sentences
- Nilsson's Environment
- ``Grid world''
- Stackable objects
- Constraints
- Finite, discrete
- Reactive Agents
- React to environment
- No notion of planning, reasoning
- State machines: reactive agents with memory
- Implementing Reactive Agents
- Map input to environment
- ad-hoc methods
- C functions
- ``potential fields'': book environment
- ``production system''
- rules of form cond -> action(s) |
prod-system
- book example: wall-following robot
- soundness via priorities (yuk)
- completeness?
- digital circuit
- booleanize inputs, outputs
- represent each output as Boolean function of
inputs
- soundness and completeness are easy
- correctness not so easy: SAT
- propositional logic and boolean circuits
- Adding state/memory
- Memory as sensing: the trick
- Memory can substitute for sensing
- Traditional state machines
- Blackboards
- Propositional Logic (Review?)
- Propositional formulae
- Boolean atoms (variables), literals ((non)negated
atoms)
- connectives: disjunction (or, sum), conjunction (and,
product), grouping (parens)
- implication: a => b iff not a or b
- What to do with prop formulae?
- evaluate: given total assignment of true/false to
atoms, is formula true or false?
- canonicalize: given formula, place in some canonical
form. formulae are equivalent if their set of
models are true in all interpretations
- sum of products / disjunctive normal form
- product of sums / conjunctive normal form
- model: find/characterize the set of total
assignments which make given formula true
- infer: given formulae, produce
another formula using inference rules
- a sound and complete set of inference rules
- modus ponens (a, a => b : b)
- and introduction (a, b : a and b)
- and commutativity (a and b : b and a)
- and elimination (a and b : a)
- or introduction (a : a or b; b : a or b)
- not elimination (not not a : a)
- additional rules are consequence of these rules
- sound and complete are wrt interpretations
- prove (deduce): given axiomatic formulae, derive
given formula via series of inference steps
- deduction is using given inference rules
- don't confuse deduction with entailment (below)
- interpret: assign a meaning to atoms, negation,
connectives; can be another formula, a function,
a natural language statement, etc.
- Herbrand interpretation: things are themselves
- truth tables give Herbrand interpretation of
connectives
- entailment: any model of a set of formulas
is also a model for the entailed formula
- a sound and complete set of inference rules is
one in which truth is the same as provability
- in prop, we can give a proof algorithm for
which works on exactly the set of true formulae
- unfortunately, no one knows whether there is
a polytime algorithm. This is the
P ?= NP question
- Resolution
- 3-CNF
- can convert any prop formula to only polynomially
larger 3-CNF canonical formula
- book procedure is ``wrong'': parse tree procedure
- Resolution and proof
- inference rule for CNF: sound
- refutation (insert negation of query and prove
unsat) is complete proof procedure for prop logic
- Horn clauses
- form: at most one positive literal
- atom = fact, implication = rule, negative = goal
- linear-time decision procedure
- Prop Representations
- Idea: model discrete world as prop formula
- Clauses are constraints on models
- Interpretation of a model is legal world
- Modeling and analysis
- Example: Tic-Tac-Toe World