Diff of /examples/family_relations/README.txt [495079] .. [6de8ee]  Maximize  Restore

Switch to unified view

a/examples/family_relations/README.txt b/examples/family_relations/README.txt
...
...
23
    Combined rule base.  This has some forward-chaining rules, some
23
    Combined rule base.  This has some forward-chaining rules, some
24
    (unoptimized) backward-chaining rules, and produces plans that return the
24
    (unoptimized) backward-chaining rules, and produces plans that return the
25
    relationship when run.  (This is a poor use of plans, but demonstrates the
25
    relationship when run.  (This is a poor use of plans, but demonstrates the
26
    syntax and underlying principles).
26
    syntax and underlying principles).
27
27
28
run.py
28
driver.py
29
    Driver program.  Read this code to see how to call Pyke!
29
    Driver program.  Read this code to see how to call Pyke!
30
    
30
    
31
    Run:
31
    Run:
32
32
33
        >>> import run
33
        >>> import driver
34
34
35
        # All of the *test functions below default to 'bruce', but I won't use
35
        # All of the *test functions below default to 'bruce', but I won't use
36
        # that here because it generates a lot of output!
36
        # that here because it generates a lot of output!
37
37
38
        # uses fc_example.krb
38
        # uses fc_example.krb
39
        >>> run.fc_test('michael_k')           # doctest: +ELLIPSIS
39
        >>> driver.fc_test('michael_k')           # doctest: +ELLIPSIS
40
        doing proof
40
        doing proof
41
        michael_k, amanda are ('father', 'daughter')
41
        michael_k, amanda are ('father', 'daughter')
42
        michael_k, tammy are ('father', 'daughter')
42
        michael_k, tammy are ('father', 'daughter')
43
        michael_k, crystal are ('father', 'daughter')
43
        michael_k, crystal are ('father', 'daughter')
44
        <BLANKLINE>
44
        <BLANKLINE>
...
...
48
        fc_example: 0 bc_rules, 0 goals, 0 rules matched
48
        fc_example: 0 bc_rules, 0 goals, 0 rules matched
49
                    0 successes, 0 failures
49
                    0 successes, 0 failures
50
        fc time ..., ... asserts/sec
50
        fc time ..., ... asserts/sec
51
51
52
        # uses bc_example.krb
52
        # uses bc_example.krb
53
        >>> run.bc_test('gary')                # doctest: +ELLIPSIS
53
        >>> driver.bc_test('gary')                # doctest: +ELLIPSIS
54
        doing proof
54
        doing proof
55
        gary, justin_m are ('father', 'son')
55
        gary, justin_m are ('father', 'son')
56
        <BLANKLINE>
56
        <BLANKLINE>
57
        done
57
        done
58
        bc_example: 0 fc_rules, 0 triggered, 0 rerun
58
        bc_example: 0 fc_rules, 0 triggered, 0 rerun
...
...
60
                    3563 successes, 17901 failures
60
                    3563 successes, 17901 failures
61
        family: 9 fact names, 94 universal facts, 0 case_specific facts
61
        family: 9 fact names, 94 universal facts, 0 case_specific facts
62
        bc time ..., ... goals/sec
62
        bc time ..., ... goals/sec
63
63
64
        # uses bc2_example.krb
64
        # uses bc2_example.krb
65
        >>> run.bc2_test('chad')               # doctest: +ELLIPSIS
65
        >>> driver.bc2_test('chad')               # doctest: +ELLIPSIS
66
        doing proof
66
        doing proof
67
        chad, tyler are ('father', 'son')
67
        chad, tyler are ('father', 'son')
68
        chad, tiffany are ('father', 'daughter')
68
        chad, tiffany are ('father', 'daughter')
69
        <BLANKLINE>
69
        <BLANKLINE>
70
        done
70
        done
...
...
73
                     10 successes, 140 failures
73
                     10 successes, 140 failures
74
        family: 9 fact names, 94 universal facts, 0 case_specific facts
74
        family: 9 fact names, 94 universal facts, 0 case_specific facts
75
        bc time ..., ... goals/sec
75
        bc time ..., ... goals/sec
76
76
77
        # uses example.krb
77
        # uses example.krb
78
        >>> run.test('paul')                   # doctest: +ELLIPSIS
78
        >>> driver.test('paul')                   # doctest: +ELLIPSIS
79
        doing proof
79
        doing proof
80
        paul, nick are father, son
80
        paul, nick are father, son
81
        paul, katrina are father, daughter
81
        paul, katrina are father, daughter
82
        <BLANKLINE>
82
        <BLANKLINE>
83
        done
83
        done
...
...
90
        total time ...
90
        total time ...
91
91
92
92
93
        # this has three parameters that all default to None:
93
        # this has three parameters that all default to None:
94
        #     person1, person2 and relationship
94
        #     person1, person2 and relationship
95
        >>> run.general(person1='bruce',                # uses bc2_example.krb
95
        >>> driver.general(person1='bruce',             # uses bc2_example.krb
96
        ...             relationship=('father', 'son')) # doctest: +ELLIPSIS
96
        ...             relationship=('father', 'son')) # doctest: +ELLIPSIS
97
        doing proof
97
        doing proof
98
        bruce, m_thomas are ('father', 'son')
98
        bruce, m_thomas are ('father', 'son')
99
        bruce, david_a are ('father', 'son')
99
        bruce, david_a are ('father', 'son')
100
        <BLANKLINE>
100
        <BLANKLINE>

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

Sign up for the SourceForge newsletter:





No, thanks