Diff of /doc/html/logic_programming/plans.html [0176eb] .. [4dca5a]  Maximize  Restore

Switch to side-by-side view

--- a/doc/html/logic_programming/plans.html
+++ b/doc/html/logic_programming/plans.html
@@ -45,7 +45,7 @@
 <div class="normal-nav"><a href="../knowledge_bases/index.html">Knowledge Bases</a></div>
 <div class="normal-nav"><a href="../pyke_syntax/index.html">Pyke Syntax</a></div>
-<div class="normal-nav"><a href="../using_pyke.html">Using Pyke</a></div>
+<div class="normal-nav"><a href="../using_pyke/index.html">Using Pyke</a></div>
 <div class="normal-nav"><a href="../examples.html">Examples</a></div>
 <div class="normal-nav"><a href="../PyCon2008-paper.html">PyCon 2008 Paper</a></div>
@@ -81,7 +81,7 @@
 clause at the end of each <a class="reference external" href="rules/index.html">rule</a> in the <a class="reference external" href="../pyke_syntax/krb_syntax/index.html">.krb file</a>.  They don't affect how
 the <a class="reference external" href="rules/index.html">rules</a> run to prove a goal, but are
 gathered up to form a call graph that is returned along with the <a class="reference external" href="pattern_matching/pattern_variables.html">pattern
-variable</a> bindings that <a class="reference external" href="../using_pyke.html#proving-goals">prove</a> the top-level goal.</p>
+variable</a> bindings that <a class="reference external" href="../using_pyke/proving_goals.html">prove</a> the top-level goal.</p>
 <div class="section" id="example">
@@ -180,16 +180,25 @@
 <div class="section" id="running-the-example">
 <h2>Running the Example</h2>
-<p>The plan is created as a byproduct of <a class="reference external" href="../using_pyke.html#proving-goals">proving</a> the goal:</p>
+<!-- This code is hidden.  It will add '' to sys.path, change to the doc.examples
+directory and store the directory path in __file__ for the code section
+>>> import sys
+>>> if '' not in sys.path: sys.path.insert(0, '')
+>>> import os
+>>> os.chdir("../../examples")
+>>> __file__ = os.getcwd() -->
+<p>The plan is created as a byproduct of <a class="reference external" href="../using_pyke/proving_goals.html">proving</a> the goal:</p>
 <pre class="doctest-block">
 &gt;&gt;&gt; from pyke import knowledge_engine
-&gt;&gt;&gt; engine = knowledge_engine.engine('doc.examples')
+<pre class="doctest-block">
+&gt;&gt;&gt; engine = knowledge_engine.engine(__file__)
 &gt;&gt;&gt; engine.activate('plan_example')
-&gt;&gt;&gt; no_vars, plan1 = engine.prove_1('plan_example', 'transfer',
-...                                 (('bruce', 'checking'),
-...                                  ('bruce', 'savings')),
-...                                 0)
+&gt;&gt;&gt; no_vars, plan1 = \
+...   engine.prove_1_goal(
+...     'plan_example.transfer((bruce, checking), (bruce, savings))')
 <p><tt class="docutils literal"><span class="pre">plan1</span></tt> is now a program to transfer X amount
@@ -223,10 +232,10 @@
 <p>Let's create a second program:</p>
 <pre class="doctest-block">
-&gt;&gt;&gt; no_vars, plan2 = engine.prove_1('plan_example', 'transfer',
-...                                 (('bruce', 'checking'),
-...                                  ('my_other_bank', 'bruce', 'savings')),
-...                                 0)
+&gt;&gt;&gt; no_vars, plan2 = \
+...   engine.prove_1_goal(
+...     'plan_example.transfer((bruce, checking), '
+...                           '(my_other_bank, bruce, savings))')
 <p><tt class="docutils literal"><span class="pre">plan2</span></tt> is now a program to transfer X amount
@@ -248,10 +257,10 @@
 <p>And the final use case:</p>
 <pre class="doctest-block">
-&gt;&gt;&gt; no_vars, plan3 = engine.prove_1('plan_example', 'transfer',
-...                                 (('my_other_bank', 'bruce', 'checking'),
-...                                  ('bruce', 'savings')),
-...                                 0)
+&gt;&gt;&gt; no_vars, plan3 = \
+...   engine.prove_1_goal(
+...     'plan_example.transfer((my_other_bank, bruce, checking), '
+...                           '(bruce, savings))')
 &gt;&gt;&gt; plan3(150)
 get 150 from bank my_other_bank acct bruce checking
 withdraw 150 from central_accts ach_recv_acct
@@ -317,7 +326,7 @@
   <div id="last-modified">
     Page last modified
-    Wed, Mar 25 2009.
+    Fri, Mar 05 2010.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks