Stable model semantics: Difference between revisions

Content deleted Content added
Line 9:
:<math>s \leftarrow p,\ \operatorname{not} q.</math>
 
Given this program, the query <math>{{mvar|p</math>}} will succeed, because the program includes <math>{{mvar|p</math>}} as a fact; the query <math>{{mvar|q</math>}} will fail, because it does not occur in the head of any of the rules. The query <math>{{mvar|r</math>}} will fail also, because the only rule with <math>{{mvar|r</math>}} in the head contains the subgoal <math>{{mvar|q</math>}} in its body; as we have seen, that subgoal fails. Finally, the query <math>{{mvar|s</math>}} succeeds, because each of the subgoals <math>{{mvar|p</math>}}, <math>\operatorname{not} q</math> succeeds. (The latter succeeds because the corresponding positive goal <math>{{mvar|q</math>}} fails.) To sum up, the behavior of SLDNF resolution on the given program can be represented by the following truth assignment:
 
:{| cellpadding=5 style="width:18em"
|{{mvar|p}}
|<math>p</math>
|{{mvar|q}}
|<math>q</math>
|{{mvar|r}}
|<math>r</math>
|{{mvar|s}}
|<math>s</math>
|-
|'''T'''
Line 25:
On the other hand, the rules of the given program can be viewed as [[propositional formula]]s if we identify the comma with conjunction <math>\land</math>, the symbol <math>\operatorname{not}</math> with negation <math>\neg</math>, and agree to treat <math>F \leftarrow G</math> as the implication <math>G \rightarrow F</math> written backwards. For instance, the last rule of the given program is, from this point of view, alternative notation for the propositional formula
 
:<math>p \land not\text{ }neg q \rightarrow s.</math>
 
If we calculate the [[truth value]]s of the rules of the program for the truth assignment shown above then we will see that each rule gets the value '''T'''. In other words, that assignment is a [[model theory|model]] of the program. But this program has also other models, for instance
 
:{| cellpadding=5 style="width:18em"
|{{mvar|p}}
|<math>p</math>
|{{mvar|q}}
|<math>q</math>
|{{mvar|r}}
|<math>r</math>
|{{mvar|s}}
|<math>s</math>
|-
|'''T'''