Diff of /doc/source/knowledge_bases/special.txt [0176eb] .. [4dca5a] Maximize Restore

  Switch to side-by-side view

--- a/doc/source/knowledge_bases/special.txt
+++ b/doc/source/knowledge_bases/special.txt
@@ -180,9 +180,9 @@
 
     >>> from pyke import knowledge_engine
     >>> engine = knowledge_engine.engine()
-    >>> engine.prove_1('special', 'check_command', (('true',),), 0)
-    ((), None)
-    >>> engine.prove_1('special', 'check_command', (('false',),), 0)
+    >>> engine.prove_1_goal('special.check_command((true))')
+    ({}, None)
+    >>> engine.prove_1_goal('special.check_command((false))')
     Traceback (most recent call last):
         ...
     pyke.knowledge_engine.CanNotProve: Can not prove special.check_command((false))
@@ -205,16 +205,14 @@
     >>> from __future__ import with_statement
     >>> from pyke import pattern, contexts
     >>> def run_command(entity, command, cwd=None, stdin=None):
-    ...     my_context = contexts.simple_context()
-    ...     output = contexts.variable('output')
-    ...     with engine.prove('special', entity, my_context,
-    ...                       (output,
-    ...                        pattern.pattern_literal(command),
-    ...                        pattern.pattern_literal(cwd),
-    ...                        pattern.pattern_literal(stdin))) \
+    ...     with engine.prove_goal(
+    ...            'special.%s($output, $command, $cwd, $stdin)' % entity,
+    ...            command=command,
+    ...            cwd=cwd,
+    ...            stdin=stdin) \
     ...       as gen:
-    ...         for no_plan in gen:
-    ...             print(output.as_data(my_context))
+    ...         for vars, no_plan in gen:
+    ...             print(vars['output'])
     >>> run_command('command', ('echo', 'hi', 'mom'))
     ('hi mom',)
     >>> run_command('command', ('ls',))   # doctest: +NORMALIZE_WHITESPACE