automated reasoning
play

Automated Reasoning Decision procedures for various small theories, - PowerPoint PPT Presentation

Decision Procedures in Theorem Proving Automated Reasoning Decision procedures for various small theories, e.g., - propositional


  1. ☛ ✁ ✂ ✆ ✁ ☛ ✝ ✞ ✟ ✁ � ✠ ✄ � � ✡ ✡ � ✁ ☛ ☛ ☛ ☎ Decision Procedures in Theorem Proving Automated Reasoning Decision procedures for various small theories, e.g., - propositional logic: truth tables; binary decision diagrams. DP method... Decision Procedure for linear - some flavours of equational logic arithmetic - logic without function symbols and existential quantifiers cf . earlier lecture - some flavours of arithmetic: linear arithmetic Given formula of a theory, decision procedure says whether it is provable or not Jacques Fleuriot - Advantage: a black box does all the work Lecture XIII Terminates but may be very inefficient e.g. decision procedure for elementary geometry (Tarski) by definition Linear Arithmetic Decidability First order theory of real (or rational) numbers with: Decidable , and , but not , , There is a decision procedure , and e.g. tautology checking, linear arithmetic, elementary geometry note that can be expressed using < and = only multiplication by a constant is allowed e.g. which can be thought of as 3 X X X X Undecidable Essentially theory of dense ordered Abelian groups without endpoints The problem is not decidable: there is no decision procedure e.g. termination of a set of rewrite rules, inductive theorem there is a number between any two different numbers proving ... e.g. the reals or the rationals Commonly used to reason about time, loops in programs, etc. Semi-decidable Want a special-purpose way (rather than resolution) of dealing with such problems Special class of undecidable problems: there is a procedure Linear Arithmetic is decidable e.g. trivial for ground formulae (e.g. 2 + 3 < 6) which will terminate if the answer is yes. Decision procedure works by reducing a quantified conjecture to an equivalent e.g. - the halting problem: can run the program formula which does not contain quantifiers or variables i.e. a ground formula - first order theorem proving: enumerate all proofs Applies sequence of normal forming transformations

  2. ✛ ✘ ★ ✩ ✖ ✏ ✖ ✑ ✙ ✏ ✗ ✎ ✪ ✧ ✙ ✌ ✫ ✍ ✬ ✌ ✕ ☞ ✭ ✮ ✒ ✦ ✚ ✣ ✙ ✙ ✘ ✕ ✗ ✛ ✜ ✖ ✢ ✖ ✕ ✓ ✤ ✢ ✔ ✣ ☛ ✕ ✏ ✕ ✎ ✥ ✕ ☛ ✯ ✄ ✹ ✄ ✺ ✯ ✝ ✵ ✆ ✻ ☎ ✼ ✽ ✰ ✯ ✂ ✁ ✂ ✯ ✵ � ✁ � ✼ ✄ ✸ ✆ ✲ ✱ ✠ ✲ ✠ ✳ ✡ ✴ ✠ ✰ ✱ ✟ ✷ ✳ ✯ ✟ ✵ ☎ ✵ ✞ ✶ ✄ ☎ ✘ Example of Decision Procedure Application Step II: Disjunctive Normal Form (DNF) Choose to eliminate Y in the conjecture: DNF: disjunction of conjunction of literals 2 1 1 Example: X. Y. ¬ X Y ¬ Y X A formula of the form D 1 D n where A B D E F each D i is of the form C i 1 C i m Put in disjunctive normal form : 2 1 1 X. Y. X Y Y X How to achieve DNF: Each step preserves truth Remove all logical connectives except ¬, and use def. of and . Solve for Y : Move ¬ inwards 2 1 1 Move inside X. Y. Y X Y X Stratification Move inside Eliminate Y : ( no longer appears) Y View this process as X. 2 1 1 X X reorganisation within levels so that existential variable can be easily Simplify. Repeat process, eliminate X : solved and eliminated 2 X. X an exhaustive application of rewrite rules Solve for X, and we are done. The conjecture is true Step I: Choosing a Variable to Eliminate Step II: Removing and universally quantify any free variables appearing in conjecture (closure) Removal of Y. 2 1 Y X For example, P Q P Q Q P becomes no need to unfold alternatively: Y. 2 1 X. Y X P Q ¬P Q ¬Q P choose with no quantifiers in its scope: the innermost Note: formula doubles in size e.g. choose Y in: Y. 2 1 X. Y X Removal of if no then create one: P Q ¬P Q X. P ¬ X. ¬P recall: lhs rhs eliminate this variable then recurse Exercise: Are these rules terminating? is a rewrite rule stop if there are no variables or quantifiers left clearly size is not decreasing!

  3. ☎ � ✂ ☛ � ✁ ☞ ✂ ✌ ☛ ✁ � ✌ ☛ ✁ ✌ ✂ ☞ ✌ � ✌ ✂ ☎ ☎ ✡ ☛ � ✁ ☞ ✌ ✌ � ✁ ✌ ✂ ☞ � ☛ ☎ ✁ ✂ ✑ ✁ ✏ ✏ � ✒ ✄ ✒ ✄ ✂ ✒ ✂ ✒ ✁ ✎ ✓ � ☛ ✑ ✏ ☞ ✌ � ✍ ✂ ✍ ☛ ✁ ✁ ✁ ✍ ✂ ☛ ✍ � ✎ ✏ Stratification Example of Disjunctive Normal Form We have a formula in which and have to be removed Need to stratify: arrange remaining connectives into layers Conjecture: top ✆✞✝✠✟ X. P Q ¬R S Removal of : ¬ X. ¬ P Q ¬ R S bottom atomic formulae Stratification of ¬ : Stratify ¬ : De Morgan's laws Rewrite rules X. ¬P ¬Q ¬¬ R S ¬ P Q ¬P ¬Q Stratification of : ¬ P Q ¬P ¬Q X. ¬P ¬Q ¬P ¬¬ R S Stratify : Stratification of : P Q R P Q P R X. ¬P ¬Q X. ¬P ¬¬ R X. S Q R P Q P R P Reorganisation: Stratify : X. ¬P ¬Q X. ¬P R X. S X. P Q X. P X. Q note: use of associativity rule Having exhaustively applied these stratification rules, we are in DNF Note: transformation into DNF is potentially inefficient But, it is worth doing a little more normalization (tidying up) Reorganisation Elimination of Quantifiers Right associativity Make each argument of ∧ into an equation or inequality P Q R P Q R P Q R P Q R need to remove defined predicate symbols (e.g. ≤ in terms of < and =) Thinning Solve each equation and inequality for chosen existential variable ¬¬P P Thereby eliminate variable from conjunction Note: this is sometimes done as negation is pushed in during stratification Existential quantifier becomes redundant since that variable no longer appears in the formula Reorganisation makes subsequent steps a little easier

  4. ✱ ✻ ✽ ✓ ✼ ✕ ✾ ✓ ✾ ✘ ✿ ✕ ✽ ✓ ✿ ✙ ✗ ✼ ✺ ✸ ✘ ✸ ✓ ✹ ✘ ✻ ✾ ✒ ✼ ✒ ✽ ✒ ✼ ✘ ✻ ✷ ✒ ✼ ✓ ❃ ❂ ✒ ✿ ❁ ✽ ✒ ❂ ✖ ✿ ✽ ✓ ✔ ✕ ✒ ✻ ✾ ✒ ✿ ✽ ✿ ✓ ✗ ✼ ❀ ✕ ❁ ✓ ❂ ✔ ✕ ✘ ✗ ★ ✜ ✢ ✥ ✜ ✢ ✦ ✢ ✢ ✜ ✥ ✦ ✢ ✚ ✧ ✩ ✢ ✰ ✮ ✱ ✱ ✰ ✯ ✮ ✭ ✧ ✯ ✮ ✭ ✬ ✫ ✪ ✤ ✜ ✲ ✒ ✘ ✳ ✒ ✳ ✒ ✶ ✳ ✓ ✵ ✗ ✶ ✙ ✳ ✓ ✴ ✵ ✣ ✲ ✢ ✜ ✛ ✚ ✱ ✗ ✙ ✘ ✓ ✳ ✘ ✴ ✕ ✳ ✿ ✒ ❃ ☛ ✕ ☛ ☛ ✌ ☛ ✌ � � ☞ ✍ ☛ ✎ � ✡ ☞ ☛ � ✑ ✏ ☎ ✑ ✆ ✏ ✝ ✞ ✍ ✏ ✡ ✑ � ✏ ✎ ✠ ✏ ✟ ✔ ❂ ✒ ❃ ✽ ✓ ✿ ❂ ✿ ✕ ❁ ✖ ✿ ✔ ❂ ✒ ✒ ✑ ✏ ✟ ✏ ✞ ✝ ✑ ✆ ☎ ✲ ✑ ✄ ✏ ✂ ✁ � Eliminating Variables Removal of Defined Symbols Eliminating Variables Removal of > , ≤ , ≥ Now we can exploit the solutions for the chosen variable Now we can exploit the solutions for the chosen variable X Y Y X Substitution of solutions: use an equality X = T to replace all the other Substitution of solutions: use an equality X = T to replace all the other X Y ¬ X Y occurrences of X with the term T occurrences of X with the term T X Y ¬ Y X Removal of ¬ X T P X P T ¬ X Y X Y Y X Un-interpolation: Un-interpolation: ¬ X Y X Y Y X S i S i X X X X T j T j S i S i T j T j all possible combinations all possible combinations relies on linearity: X < Y or X = Y or X > Y for any X and Y i j i j Note: this must be done within the DNF procedure, since the presence of ¬ special case: special case: S S X X X X T T S S T T makes a difference a b k b b c b d a b k b b c b d Exercise: Exercise: A ¬ X Y need to redo DNF Drop redundant quantifier Drop redundant quantifier e.g. if not then A X Y X Y X. P X. P P P Note: unnegated equalities are untouched where P does not contain X where P does not contain X Equation and Inequality Solving Example of Elimination of Quantifiers Attraction 0 X Y X Y bring together occurrences of X has been chosen and formula is in DNF 0 X Y X Y variables being solved X Z Y X Y Z Next: e.g. 3 ? X Y X Collection Conjecture: A X B X A B X 1 2 Y Z X. Z X Y X Z X Y A X B X A B X Removal of : Note: A and B must be constants for linear arithmetic, 1 2 Y Z X. Z X X Z Y X Y so A + B and A B must evaluate to a number Isolation: isolate the chosen (quantified) variable onto one side of Inequality solving: every equality or inequality 1 1 2 Y Z X. Z X X Y Z X Y X Y Z X Z Y Un-interpolation X Y Z X Z Y X is chosen variable in each case Y Z X. Z 1 Y Z Z 1 1 2 Y X Y Z X Z Y A is constant (since linear arith) X Y Z X Z Y Drop redundant : 0 1 A A X Z X A Z 1 1 1 2 Y Z. Z Y Z Z Y conditional rules that make coefficient 0 1 A A X Z X A Z of the chosen variable +1 Solve for Y and Z ... 0 1 A A X Z A Z X

Recommend


More recommend