Model Generation Method 2ai The Model Generation (MG) method is an easy method for humans to apply, but it has not been so widely implemented as DP. Similar to DP, MG returns True if given clauses are satisfiable . AUTOMATED REASONING MG constructs a tree in which each branch tries to maintain a partial model of the SLIDES 2: initial clauses (but in a different and more constrained way to DP). Branches of MG trees contain only atoms: the atoms in a branch give a partial model. Branches that cannot be extended to a full model are called closed . PROPOSITIONAL TECHNIQUES (2) eg Given a branch with atoms A and B and clauses ¬A ∨ C, ¬A ∨ ¬B Model Generation Procedure Solving the “Three Little Girls” Problem We could extend the branch with atom C, since any model that makes A true will be forced to make C true because of ¬A ∨ C OBDDs (Ordered Binary Decision Diagrams) However, better we can close the branch since no model that makes A and B true can make ¬A ∨ ¬B true. KB - AR - 09 Branches that are not yet closed are called open . A branch is c ompleted if all initial clauses have been considered by the branch. MG is related to the tableau method, which we study later. 2aiii Model Generation Example as a tree 2aii Model Generation Procedure Given clauses: LK, ¬L¬K, ¬LM, ¬MK, MR (ie L ∨ K etc.) procedure MG(S,B): boolean No tautologies or subsumed clauses; not step 1 %S are clauses still to make true and B is the branch (model) so far MG(S,{ }) (ie the branch is empty) 1. If no clause in S contains a negative literal then return true. (B is a partial model of the initial clauses - see Note 1 to make B a model) Choose LK (step 2) 2 . If S contains a clause C with ≥ 1 positive literals and is such that all L K negative literals ¬L in C (if any) satisfy L occurs in B, then return the MG([¬L¬K, ¬LM, MR],{K}) MG([¬L¬K, ¬LM, ¬MK, MR],{L}) disjunction of MG(S(A),B+A) , for each positive literal A in C, Choose MR (step 2) Choose ¬LM (step 2) where S(A) = S-{X|X in S and X is made true by the assignments in B+A} (See Note 2) M R M 3. If S contains a clause C with only negative literals and and all literals ¬L MG([¬L¬K, ¬MK],{L,M}) in C satisfy L occurs in B, then return false. Choose ¬MK (step 2) MG(([¬L¬K, ¬LM],{K,R}) (B makes C false - see Note 3) return True (step 4) K 4. If none of 1, 2 or 3 occurs then return true. MG([¬L¬K],{K,M}) Model={K,R,¬L} (Every remaining clause has ≥ 1 unassigned negative literal) – See note 4) return true (step 4) MG([¬L¬K],{L,M,K}) Model={K,M,¬L} choose ¬L¬K (Must make L False return False (step 3) MG is initially called with S=given clauses and B= [ ]. as K already True) ( Note : Can assume there are no tautologies or subsumed clauses at the Return (False or True or True)=True start and that all identical literals have been merged.)
2aiv Example: {LK, ¬L¬K, ¬LM, ¬MK, MR} (also shown in tree form on 2aiii) Notes about MG (Step 2) Choose MR (could also have chosen LK instead as on Slide 2aiii). procedure MG(S,B): boolean Return MG([LK,¬L¬K, ¬MK], {M}) or MG([LK,¬L¬K, ¬LM, ¬MK], {R}); 1. If no clause in S contains a negative literal return true. i.e. start a tree with two branches. Note1: B satisfies all clauses so far removed from the original argument S. B Consider the first disjunct and (Step 2), clause ¬MK. can be made into a model of the remaining clauses by assigning true to any Return MG([¬L¬K], {M,K}). ie still to make ¬L ∨ K true atoms not yet assigned, since they either occur positively in S, or do not occur at all. (Step 4) return true - assign false to L. 2 . If C=L ∨ D (L positive) is in S and for all negative literals ¬L in D L is in B, Check that {M,K,¬L} is a (partial) model for the initial clauses. then return the disjunction of MG(S(A),B+A) , for each positive literal A in C If the second disjunct had been chosen, Note2: The branches of the form B+A extending B are the only ways to make then apply (Step 2) and clause L ∨ K and return C true. Can remove any clauses in S also made true by B+A MG([¬L¬K, ¬LM, ¬MK], {R,L}) or MG([¬L¬K, ¬LM], {R,K}); i.e. extend the second branch of the tree by two branches. 3. If C in S has only negative literals and for all literals ¬L in C L is in B, then return false. The first disjunct will eventually return false (show this yourself) Note3: B cannot be extended to make C true as it already makes C false. and the second will return the model {R,K,¬L}. Check that {R,K,¬L} is a (partial) model for the initial clauses. 4. If none of 1, 2 or 3 occurs then return true. Note4: Every remaining clause in S has ≥ 1 unassigned negative literal ¬L. You can also try the "three little girls" problem as an exercise. Assign false to all such L to make the remaining clauses true. Can assign The MG procedure can be generalised to first order clauses with care. either true or false to any remaining atoms in the language not yet assigned. 2av e.g. use (2) in place of (2a)-(2c). See exercise sheet. 2avi Model Generation Procedure (MG): Why does MG Work (1)? (An illustration) 2bi Another procedure appropriate for propositional clauses is model generation (MG), which is a Assume clauses S, and a branch B containing positive atoms special case of the tableau method ( to be covered in detail later in the course). Although the MG method can be generalised to arbitrary propositional sentences, it then loses some of its simplicity. The termination cases (1,3,4): MG is very easy for humans to use as it is more restricted than DP. The MG procedure attempts to build partial models. It constructs a tree in which each branch tries Case 1 Case 3 Case 4 to maintain a partial model of the initial sentences (but in a different way to DP). All clauses in S have S includes ¬B1 ∨ ... ∨ ¬Bn All clauses include The tree built by the MG procedure for an initial set of clauses S consists of nodes each labelled only positive literals by an atom. There are 2 kinds of branches, called open and closed . The atoms in each open branch where B1, ..., Bn all in B some ¬Ci, where Ci is not in B B give a model of the set of clauses processed in B; when all of S have been processed in an open Already processed eg ¬Ci ∨ ... branch B then the branch is called completed and the nodes in B give rise to a (partial) model of S. (ie removed) clauses A closed branch B is also called completed and indicates that the atoms in B cannot be extended to S cannot be made that are true using be a model of S (i.e. they make some clause in S false). true given B Otherwise would be in atoms in B Cases 1,2 or 3 Let closed branches be labelled by false and completed open branches be labelled by true. Then Model is: the given clauses S have no model if the disjunction of all labels in a tree in which all branches are B + remaining completed is false. There is a model if the disjunction is true, as at least one branch must then have Model is: been completed and open. atoms in clauses NOTE: Atoms in B true In Cases 1 and 4 may have Each Ci is false Remaining clauses to extend model to cover all Another simple normalisation procedure for ground clauses is the method of OBDDs (Ordered will be true by above atoms in language. Can do Binary Decision Diagrams). A related extension is used in model checking programs to obtain neat representations for propositional sentences. In essence it reduce a sentence to an if-then-else assignments so arbitrarily. normal form, from which a model can easily be obtained. If the normal form reduces to false then there is no model. See slides 2d.
Recommend
More recommend