/usr/share/doc/python-swap/formula.html is in python-swap 1.2.1-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 | <!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module formula</title>
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>formula</strong></big></big> (version Id: formula.py,v 1.63 2007/12/16 00:22:59 syosi Exp )</font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/syosi/cvs-trunk/WWW/2000/10/swap/formula.py">/home/syosi/cvs-trunk/WWW/2000/10/swap/formula.py</a></font></td></tr></table>
<p></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="StringIO.html">StringIO</a><br>
<a href="diag.html">diag</a><br>
</td><td width="25%" valign=top><a href="notation3.html">notation3</a><br>
<a href="sys.html">sys</a><br>
</td><td width="25%" valign=top><a href="types.html">types</a><br>
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="formula.html#StoredStatement">StoredStatement</a>
</font></dt><dt><font face="helvetica, arial"><a href="term.html#AnonymousNode">term.AnonymousNode</a>(<a href="term.html#Node">term.Node</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="formula.html#Formula">Formula</a>(<a href="term.html#AnonymousNode">term.AnonymousNode</a>, <a href="term.html#CompoundTerm">term.CompoundTerm</a>)
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="term.html#CompoundTerm">term.CompoundTerm</a>(<a href="term.html#Term">term.Term</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="formula.html#Formula">Formula</a>(<a href="term.html#AnonymousNode">term.AnonymousNode</a>, <a href="term.html#CompoundTerm">term.CompoundTerm</a>)
</font></dt></dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Formula">class <strong>Formula</strong></a>(<a href="term.html#AnonymousNode">term.AnonymousNode</a>, <a href="term.html#CompoundTerm">term.CompoundTerm</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>A formula of a set of RDF statements, triples.<br>
<br>
(The triples are actually instances of <a href="#StoredStatement">StoredStatement</a>.)<br>
Other systems such as jena and redland use the term "Model" for <a href="#Formula">Formula</a>.<br>
For rdflib, this is known as a TripleStore.<br>
Cwm and N3 extend RDF to allow a literal formula as an item in a triple.<br>
<br>
A formula is either open or closed. Initially, it is open. In this<br>
state is may be modified - for example, triples may be added to it.<br>
When it is closed, note that a different interned version of itself<br>
may be returned. From then on it is a constant.<br>
<br>
Only closed formulae may be mentioned in statements in other formuale.<br>
<br>
There is a <a href="#Formula-reopen">reopen</a>() method but it is not recommended, and if desperate should<br>
only be used immediately after a <a href="#Formula-close">close</a>().<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="formula.html#Formula">Formula</a></dd>
<dd><a href="term.html#AnonymousNode">term.AnonymousNode</a></dd>
<dd><a href="term.html#Node">term.Node</a></dd>
<dd><a href="term.html#CompoundTerm">term.CompoundTerm</a></dd>
<dd><a href="term.html#Term">term.Term</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="Formula-__init__"><strong>__init__</strong></a>(self, store, uri<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="Formula-__iter__"><strong>__iter__</strong></a>(self)</dt><dd><tt>The internal method which allows one to iterate over the statements<br>
as though a formula were a sequence.</tt></dd></dl>
<dl><dt><a name="Formula-__len__"><strong>__len__</strong></a>(self)</dt><dd><tt>How many statements?</tt></dd></dl>
<dl><dt><a name="Formula-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
<dl><dt><a name="Formula-add"><strong>add</strong></a>(self, subj, pred, obj, why<font color="#909090">=None</font>)</dt><dd><tt>Add a triple to the formula.<br>
<br>
The formula must be open.<br>
subj, pred and obj must be objects as for example generated <br>
by <a href="#Formula">Formula</a>.<a href="#Formula-newSymbol">newSymbol</a>() and <a href="#Formula-newLiteral">newLiteral</a>(), or else literal<br>
values which can be interned.<br>
why may be a reason for use when a proof will be required.</tt></dd></dl>
<dl><dt><a name="Formula-any"><strong>any</strong></a>(self, subj<font color="#909090">=None</font>, pred<font color="#909090">=None</font>, obj<font color="#909090">=None</font>)</dt><dd><tt>Return None or the value filing the blank in the called parameters.<br>
<br>
Specifiy exactly two of the arguments.<br>
color = f.<a href="#Formula-any">any</a>(pred=pantoneColor, subj=myCar)<br>
somethingRed = f.<a href="#Formula-any">any</a>(pred=pantoneColor, obj=red)<br>
<br>
Note difference from the old store.any!!<br>
Note SPO order not PSO.<br>
To aboid confusion, use named parameters.</tt></dd></dl>
<dl><dt><a name="Formula-bind"><strong>bind</strong></a>(self, prefix, uri)</dt><dd><tt>Give a prefix and associated URI as a hint for output<br>
<br>
The store does not use prefixes internally, but keeping track<br>
of those usedd in the input data makes for more human-readable output.</tt></dd></dl>
<dl><dt><a name="Formula-canonicalize"><strong>canonicalize</strong></a>(F)</dt><dd><tt>If this formula already exists, return the master version.<br>
If not, record this one and return it.<br>
Call this when the formula is in its final form, with all its statements.<br>
Make sure no one else has a copy of the pointer to the smushed one.<br>
<br>
LIMITATION: The basic <a href="#Formula">Formula</a> class does NOT canonicalize. So<br>
it won't spot idenical formulae. The IndexedFormula will.</tt></dd></dl>
<dl><dt><a name="Formula-classOrder"><strong>classOrder</strong></a>(self)</dt></dl>
<dl><dt><a name="Formula-close"><strong>close</strong></a>(self)</dt><dd><tt>No more to add. Please return interned value.<br>
NOTE You must now use the interned one, not the original!</tt></dd></dl>
<dl><dt><a name="Formula-compareTerm"><strong>compareTerm</strong></a>(self, other)</dt><dd><tt>Assume is also a <a href="#Formula">Formula</a> - see function compareTerm below</tt></dd></dl>
<dl><dt><a name="Formula-contains"><strong>contains</strong></a>(self, pred<font color="#909090">=None</font>, subj<font color="#909090">=None</font>, obj<font color="#909090">=None</font>)</dt><dd><tt>Return boolean true iff formula contains statement(s) matching the parts given<br>
<br>
For example:<br>
if f.<a href="#Formula-contains">contains</a>(pred=pantoneColor):<br>
print "We've got one statement about something being some color"</tt></dd></dl>
<dl><dt><a name="Formula-declareExistential"><strong>declareExistential</strong></a>(self, v)</dt></dl>
<dl><dt><a name="Formula-declareUniversal"><strong>declareUniversal</strong></a>(self, v, key<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="Formula-doesNodeAppear"><strong>doesNodeAppear</strong></a>(self, symbol)</dt><dd><tt>Does that particular node appear anywhere in this formula<br>
<br>
This function is necessarily recursive, and is useful for the pretty printer<br>
It will also be useful for the flattener, when we write it.</tt></dd></dl>
<dl><dt><a name="Formula-each"><strong>each</strong></a>(self, subj<font color="#909090">=None</font>, pred<font color="#909090">=None</font>, obj<font color="#909090">=None</font>)</dt><dd><tt>Return a list of values value filing the blank in the called parameters<br>
<br>
Examples:<br>
colors = f.<a href="#Formula-each">each</a>(pred=pantoneColor, subj=myCar)<br>
<br>
for redthing in f.<a href="#Formula-each">each</a>(pred=pantoneColor, obj=red): ...</tt></dd></dl>
<dl><dt><a name="Formula-existentials"><strong>existentials</strong></a>(self)</dt><dd><tt>Return a list of existential variables with this formula as scope.<br>
<br>
Implementation:<br>
we may move to an internal storage rather than these pseudo-statements</tt></dd></dl>
<dl><dt><a name="Formula-freeVariables"><strong>freeVariables</strong></a>(self)</dt></dl>
<dl><dt><a name="Formula-generated"><strong>generated</strong></a>(self)</dt><dd><tt>Yes, any identifier you see for this is arbitrary.</tt></dd></dl>
<dl><dt><a name="Formula-intern"><strong>intern</strong></a>(self, value)</dt></dl>
<dl><dt><a name="Formula-loadFormulaWithSubstitution"><strong>loadFormulaWithSubstitution</strong></a>(self, old, bindings<font color="#909090">={}</font>, why<font color="#909090">=None</font>, cannon<font color="#909090">=False</font>)</dt><dd><tt>Load information from another formula, subsituting as we go<br>
returns number of statements added (roughly)</tt></dd></dl>
<dl><dt><a name="Formula-n3EntailedBy"><strong>n3EntailedBy</strong></a>(pattern, kb, vars<font color="#909090">=set([])</font>, existentials<font color="#909090">=set([])</font>, bindings<font color="#909090">={}</font>)</dt><dd><tt>See Term.<a href="#Formula-unify">unify</a>() and term.matchSet()<br>
<br>
KB is a stronger statement han other.<br>
Bindings map variables in pattern onto kb.<br>
Self n3-entails other.<br>
Criteria: Subset of self statements must match other statements.<br>
Self's exisetntials must be subset of other's<br>
Self's universals must be superset.</tt></dd></dl>
<dl><dt><a name="Formula-n3String"><strong>n3String</strong></a>(self, base<font color="#909090">=None</font>, flags<font color="#909090">=''</font>)</dt><dd><tt>Dump the formula to an absolute string in N3</tt></dd></dl>
<dl><dt><a name="Formula-newBlankNode"><strong>newBlankNode</strong></a>(self, uri<font color="#909090">=None</font>, why<font color="#909090">=None</font>)</dt><dd><tt>Create a new unnamed node with this formula as context.<br>
<br>
The URI is typically omitted, and the system will make up an internal idnetifier.<br>
If given is used as the (arbitrary) internal identifier of the node.</tt></dd></dl>
<dl><dt><a name="Formula-newExistential"><strong>newExistential</strong></a>(self, uri<font color="#909090">=None</font>, why<font color="#909090">=None</font>)</dt><dd><tt>Create a named variable existentially qualified within this formula<br>
<br>
See also: <a href="#Formula-existentials">existentials</a>() and <a href="#Formula-newBlankNode">newBlankNode</a>().</tt></dd></dl>
<dl><dt><a name="Formula-newFormula"><strong>newFormula</strong></a>(self, uri<font color="#909090">=None</font>)</dt><dd><tt>Create a new open, empty, formula in the same store as this one.<br>
<br>
The URI is typically omitted, and the system will make up an internal idnetifier.<br>
If given is used as the (arbitrary) internal identifier of the formula.</tt></dd></dl>
<dl><dt><a name="Formula-newList"><strong>newList</strong></a>(self, list)</dt></dl>
<dl><dt><a name="Formula-newLiteral"><strong>newLiteral</strong></a>(self, str, dt<font color="#909090">=None</font>, lang<font color="#909090">=None</font>)</dt><dd><tt>Create or reuse the internal representation of the RDF literal whose string is given<br>
<br>
The literal is created in the same store as the formula.</tt></dd></dl>
<dl><dt><a name="Formula-newSymbol"><strong>newSymbol</strong></a>(self, uri)</dt><dd><tt>Create or reuse the internal representation of the RDF node whose uri is given<br>
<br>
The symbol is created in the same store as the formula.</tt></dd></dl>
<dl><dt><a name="Formula-newUniversal"><strong>newUniversal</strong></a>(self, uri<font color="#909090">=None</font>, why<font color="#909090">=None</font>)</dt><dd><tt>Create a named variable universally qualified within this formula<br>
<br>
See also: <a href="#Formula-universals">universals</a>()</tt></dd></dl>
<dl><dt><a name="Formula-newXMLLiteral"><strong>newXMLLiteral</strong></a>(self, doc)</dt><dd><tt>Create or reuse the internal representation of the RDF literal whose string is given<br>
<br>
The literal is created in the same store as the formula.</tt></dd></dl>
<dl><dt><a name="Formula-ntString"><strong>ntString</strong></a>(self, base<font color="#909090">=None</font>, flags<font color="#909090">='bravestpun'</font>)</dt><dd><tt>Dump the formula to an absolute string in N3</tt></dd></dl>
<dl><dt><a name="Formula-objects"><strong>objects</strong></a>(self, pred<font color="#909090">=None</font>, subj<font color="#909090">=None</font>)</dt><dd><tt>Obsolete - use <a href="#Formula-each">each</a>(subj=..., pred=...)</tt></dd></dl>
<dl><dt><a name="Formula-occurringIn"><strong>occurringIn</strong></a>(self, vars)</dt><dd><tt>Which variables in the list occur in this?</tt></dd></dl>
<dl><dt><a name="Formula-outputStrings"><strong>outputStrings</strong></a>(self, channel<font color="#909090">=None</font>, relation<font color="#909090">=None</font>)</dt><dd><tt>Fetch output strings from store, sort and output<br>
<br>
To output a string, associate (using the given relation) with a key<br>
such that the order of the keys is the order in which you want the corresponding<br>
strings output.<br>
<br>
@@ what is this doing here??</tt></dd></dl>
<dl><dt><a name="Formula-predicates"><strong>predicates</strong></a>(self, subj<font color="#909090">=None</font>, obj<font color="#909090">=None</font>)</dt><dd><tt>Obsolete - use <a href="#Formula-each">each</a>(subj=..., obj=...)</tt></dd></dl>
<dl><dt><a name="Formula-rdfString"><strong>rdfString</strong></a>(self, base<font color="#909090">=None</font>, flags<font color="#909090">=''</font>)</dt><dd><tt>Dump the formula to an absolute string in RDF/XML</tt></dd></dl>
<dl><dt><a name="Formula-removeStatement"><strong>removeStatement</strong></a>(self, s)</dt><dd><tt>Removes a statement The formula must be open.<br>
<br>
This implementation is alas slow, as removal of items from tha hash is slow.</tt></dd></dl>
<dl><dt><a name="Formula-renameVars"><strong>renameVars</strong></a>(self)</dt></dl>
<dl><dt><a name="Formula-reopen"><strong>reopen</strong></a>(self)</dt><dd><tt>Make a formula which was once closed oopen for input again.<br>
<br>
NOT Recommended. Dangers: this formula will be, because of interning,<br>
the same objet as a formula used elsewhere which happens to have the same content.<br>
You mess with this one, you mess with that one.<br>
Much better to keep teh formula open until you don't needed it open any more.<br>
The trouble is, the parsers close it at the moment automatically. To be fixed.</tt></dd></dl>
<dl><dt><a name="Formula-searchable"><strong>searchable</strong></a>(self, subj<font color="#909090">=None</font>, pred<font color="#909090">=None</font>, obj<font color="#909090">=None</font>)</dt><dd><tt>A pair of the difficulty of searching and a statement iterator of found statements<br>
<br>
The difficulty is a store-portable measure of how long the store<br>
thinks (in arbitrary units) it will take to search.<br>
This will only be used for choisng which part of the query to search first.<br>
If it is 0 there is no solution to the query, we know now.<br>
<br>
In this implementation, we use the length of the sequence to be searched.</tt></dd></dl>
<dl><dt><a name="Formula-size"><strong>size</strong></a>(self)</dt><dd><tt>Return the number statements.<br>
Obsolete: use len(F).</tt></dd></dl>
<dl><dt><a name="Formula-statementsMatching"><strong>statementsMatching</strong></a>(self, pred<font color="#909090">=None</font>, subj<font color="#909090">=None</font>, obj<font color="#909090">=None</font>)</dt><dd><tt>Return a READ-ONLY list of <a href="#StoredStatement">StoredStatement</a> objects matching the parts given<br>
<br>
For example:<br>
for s in f.<a href="#Formula-statementsMatching">statementsMatching</a>(pred=pantoneColor):<br>
print "We've got one which is ", `s[OBJ]`<br>
<br>
If none, returns []</tt></dd></dl>
<dl><dt><a name="Formula-subSet"><strong>subSet</strong></a>(self, statements, why<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="Formula-subjects"><strong>subjects</strong></a>(self, pred<font color="#909090">=None</font>, obj<font color="#909090">=None</font>)</dt><dd><tt>Obsolete - use <a href="#Formula-each">each</a>(pred=..., obj=...)</tt></dd></dl>
<dl><dt><a name="Formula-substituteEquals"><strong>substituteEquals</strong></a>(self, bindings, newBindings)</dt><dd><tt>Return this or a version of me with subsitution made<br>
<br>
Subsitution of = for = does NOT happen inside a formula,<br>
as the formula is a form of quotation.</tt></dd></dl>
<dl><dt><a name="Formula-substitution"><strong>substitution</strong></a>(self, bindings, why<font color="#909090">=None</font>, cannon<font color="#909090">=False</font>, keepOpen<font color="#909090">=False</font>)</dt><dd><tt>Return this or a version of me with subsitution made</tt></dd></dl>
<dl><dt><a name="Formula-the"><strong>the</strong></a>(self, subj<font color="#909090">=None</font>, pred<font color="#909090">=None</font>, obj<font color="#909090">=None</font>)</dt><dd><tt>Return None or the value filing the blank in the called parameters<br>
<br>
This is just like <a href="#Formula-any">any</a>() except it checks that there is only<br>
one answer in the store. It wise to use this when you expect only one.<br>
<br>
color = f.<a href="#Formula-the">the</a>(pred=pantoneColor, subj=myCar)<br>
redCar = f.<a href="#Formula-the">the</a>(pred=pantoneColor, obj=red)</tt></dd></dl>
<dl><dt><a name="Formula-unifySecondary"><strong>unifySecondary</strong></a>(self, other, env1, env2, vars, universals, existentials, n1Source, n2Source)</dt></dl>
<dl><dt><a name="Formula-universals"><strong>universals</strong></a>(self)</dt><dd><tt>Return a set of variables universally quantified with this formula as scope.<br>
<br>
Implementation:<br>
We may move to an internal storage rather than these statements.</tt></dd></dl>
<dl><dt><a name="Formula-variables"><strong>variables</strong></a>(self)</dt><dd><tt>Return a set of all variables quantified within this scope.</tt></dd></dl>
<hr>
Static methods defined here:<br>
<dl><dt><a name="Formula-resetRenames"><strong>resetRenames</strong></a>(reset<font color="#909090">=True</font>)</dt></dl>
<hr>
Methods inherited from <a href="term.html#AnonymousNode">term.AnonymousNode</a>:<br>
<dl><dt><a name="Formula-asPair"><strong>asPair</strong></a>(self)</dt></dl>
<dl><dt><a name="Formula-uriref"><strong>uriref</strong></a>(self)</dt></dl>
<hr>
Methods inherited from <a href="term.html#Term">term.Term</a>:<br>
<dl><dt><a name="Formula-compareAnyTerm"><strong>compareAnyTerm</strong></a>(self, other)</dt><dd><tt>Compare two langauge items<br>
This is a cannoncial ordering in that is designed to allow<br>
the same graph always to be printed in the same order.<br>
This makes the regression tests possible.<br>
The literals are deemed smaller than symbols, which are smaller<br>
than formulae. This puts the rules at the botom of a file where<br>
they tend to take a lot of space anyway.<br>
Formulae have to be compared as a function of their sorted contents.<br>
<br>
@@ Anonymous nodes have to, within a given <a href="#Formula">Formula</a>, be compared as<br>
a function of the sorted information about them in that context.<br>
This is not done yet</tt></dd></dl>
<dl><dt><a name="Formula-debugString"><strong>debugString</strong></a>(self, already<font color="#909090">=[]</font>)</dt></dl>
<dl><dt><a name="Formula-representation"><strong>representation</strong></a>(self, base<font color="#909090">=None</font>)</dt><dd><tt>The string represnting this in N3</tt></dd></dl>
<dl><dt><a name="Formula-unify"><strong>unify</strong></a>(self, other, env1<font color="#909090">=Env({})</font>, env2<font color="#909090">=Env({})</font>, vars<font color="#909090">=set([])</font>, universals<font color="#909090">=set([])</font>, existentials<font color="#909090">=set([])</font>, n1Source<font color="#909090">=32</font>, n2Source<font color="#909090">=32</font>)</dt></dl>
<dl><dt><a name="Formula-value"><strong>value</strong></a>(self)</dt><dd><tt>As a python value - by default, none exists, use self</tt></dd></dl>
<hr>
Data and other attributes inherited from <a href="term.html#Term">term.Term</a>:<br>
<dl><dt><strong>__dict__</strong> = <dictproxy object><dd><tt>dictionary for instance variables (if defined)</tt></dl>
<dl><dt><strong>__weakref__</strong> = <attribute '__weakref__' of 'Term' objects><dd><tt>list of weak references to the object (if defined)</tt></dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="StoredStatement">class <strong>StoredStatement</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>A statememnt as an element of a formula<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="StoredStatement-__cmp__"><strong>__cmp__</strong></a>(self, other)</dt><dd><tt>Just compare SUBJ, Pred and OBJ, others the same<br>
Avoid loops by spotting reference to containing formula</tt></dd></dl>
<dl><dt><a name="StoredStatement-__getitem__"><strong>__getitem__</strong></a>(self, i)</dt></dl>
<dl><dt><a name="StoredStatement-__hash__"><strong>__hash__</strong></a>(self)</dt></dl>
<dl><dt><a name="StoredStatement-__init__"><strong>__init__</strong></a>(self, q)</dt></dl>
<dl><dt><a name="StoredStatement-__len__"><strong>__len__</strong></a>(self)</dt></dl>
<dl><dt><a name="StoredStatement-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
<dl><dt><a name="StoredStatement-asFormula"><strong>asFormula</strong></a>(self, why<font color="#909090">=None</font>)</dt><dd><tt>The formula which contains only a statement like this.<br>
<br>
When we split the statement up, we lose information in any existentials which are<br>
shared with other statements. So we introduce a skolem constant to tie the<br>
statements together. We don't have access to any enclosing formula <br>
so we can't express its quantification. This @@ not ideal.<br>
<br>
This extends the <a href="#StoredStatement">StoredStatement</a> class with functionality we only need with "why" module.</tt></dd></dl>
<dl><dt><a name="StoredStatement-comparePredObj"><strong>comparePredObj</strong></a>(self, other)</dt><dd><tt>Just compare P and OBJ, others the same</tt></dd></dl>
<dl><dt><a name="StoredStatement-context"><strong>context</strong></a>(self)</dt><dd><tt>Return the context of the statement</tt></dd></dl>
<dl><dt><a name="StoredStatement-existentials"><strong>existentials</strong></a>(self)</dt></dl>
<dl><dt><a name="StoredStatement-object"><strong>object</strong></a>(self)</dt><dd><tt>Return the object of the statement</tt></dd></dl>
<dl><dt><a name="StoredStatement-occurringIn"><strong>occurringIn</strong></a>(self, vars)</dt><dd><tt>Which variables in the list occur in this?</tt></dd></dl>
<dl><dt><a name="StoredStatement-predicate"><strong>predicate</strong></a>(self)</dt><dd><tt>Return the predicate of the statement</tt></dd></dl>
<dl><dt><a name="StoredStatement-spo"><strong>spo</strong></a>(self)</dt></dl>
<dl><dt><a name="StoredStatement-statements"><strong>statements</strong></a>(self)</dt></dl>
<dl><dt><a name="StoredStatement-subject"><strong>subject</strong></a>(self)</dt><dd><tt>Return the subject of the statement</tt></dd></dl>
<dl><dt><a name="StoredStatement-unify"><strong>unify</strong></a>(self, other, env1, env2, vars, universals, existentials, n1Source<font color="#909090">=32</font>, n2Source<font color="#909090">=32</font>)</dt></dl>
<dl><dt><a name="StoredStatement-unifySecondary"><strong>unifySecondary</strong></a>(self, other, env1, env2, vars, universals, existentials, n1Source, n2Source)</dt></dl>
<dl><dt><a name="StoredStatement-universals"><strong>universals</strong></a>(self)</dt></dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-sorted"><strong>sorted</strong></a>(...)</dt><dd><tt><a href="#-sorted">sorted</a>(iterable, cmp=None, key=None, reverse=False) --> new sorted list</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>CONTEXT</strong> = 0<br>
<strong>FORMULA</strong> = 1<br>
<strong>Logic_NS</strong> = 'http://www.w3.org/2000/10/swap/log#'<br>
<strong>OBJ</strong> = 3<br>
<strong>PRED</strong> = 1<br>
<strong>SUBJ</strong> = 2<br>
<strong>SYMBOL</strong> = 0<br>
<strong>__version__</strong> = 'Id: formula.py,v 1.63 2007/12/16 00:22:59 syosi Exp '<br>
<strong>generators</strong> = _Feature((2, 2, 0, 'alpha', 1), (2, 3, 0, 'final', 0), 4096)<br>
<strong>tracking</strong> = 0</td></tr></table>
</body></html>
|