Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[2922d1]: Test / examples / family_relations.tst Maximize Restore History

Download this file

family_relations.tst    254 lines (245 with data), 10.6 kB

  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
# family_relations.tst
>>> import sys
>>> import pyke
>>> import os
>>> new_path = os.path.join(os.path.dirname(os.path.dirname(pyke.__file__)),
... 'examples/family_relations')
>>> sys.path.append(new_path)
>>> import driver
>>> driver.fc_test() # doctest: +ELLIPSIS
doing proof
bruce, thomas are ('son', 'father')
bruce, norma are ('son', 'mother')
bruce, frederik are (('grand', 'son'), ('grand', 'father'))
bruce, mary are (('grand', 'son'), ('grand', 'mother'))
bruce, allen are (('grand', 'son'), ('grand', 'father'))
bruce, ismay are (('grand', 'son'), ('grand', 'mother'))
bruce, m_thomas are ('father', 'son')
bruce, david_a are ('father', 'son')
bruce, fred_a are ('brother', 'brother')
bruce, tim are ('brother', 'brother')
bruce, vicki are ('brother', 'sister')
bruce, jill are ('brother', 'sister')
bruce, joyce are ('nephew', 'aunt')
bruce, phyllis are ('nephew', 'aunt')
bruce, john_w are ('nephew', 'uncle')
bruce, bill are ('nephew', 'uncle')
bruce, chuck_w are ('nephew', 'uncle')
bruce, david_c are ('1st', 'cousins')
bruce, danny are ('1st', 'cousins')
bruce, dee are ('1st', 'cousins')
bruce, mitch are ('1st', 'cousins')
bruce, jonni are ('1st', 'cousins')
bruce, lorri are ('1st', 'cousins')
bruce, steve_w are ('1st', 'cousins')
bruce, jim are ('1st', 'cousins')
bruce, jeri are ('1st', 'cousins')
bruce, annette are ('1st', 'cousins')
bruce, helen_w are ('1st', 'cousins')
bruce, mary_w are ('1st', 'cousins')
bruce, charli are ('1st', 'cousins', 1, 'removed')
bruce, jimjim are ('1st', 'cousins', 1, 'removed')
bruce, johnjohn are ('1st', 'cousins', 1, 'removed')
bruce, jamie are ('1st', 'cousins', 1, 'removed')
bruce, david_w are ('1st', 'cousins', 1, 'removed')
bruce, jessica are ('1st', 'cousins', 1, 'removed')
bruce, bridget are ('1st', 'cousins', 1, 'removed')
bruce, brian2 are ('1st', 'cousins', 1, 'removed')
bruce, victoria are ('1st', 'cousins', 1, 'removed')
<BLANKLINE>
done
family: 9 fact names, 94 universal facts, 6920 case_specific facts
fc_example: 20 fc_rules, 6772 triggered, 892 rerun
fc_example: 0 bc_rules, 0 goals, 0 rules matched
0 successes, 0 failures
fc time ..., ... asserts/sec
>>> driver.bc_test() # doctest: +ELLIPSIS
doing proof
bruce, thomas are ('son', 'father')
bruce, norma are ('son', 'mother')
bruce, frederik are (('grand', 'son'), ('grand', 'father'))
bruce, mary are (('grand', 'son'), ('grand', 'mother'))
bruce, allen are (('grand', 'son'), ('grand', 'father'))
bruce, ismay are (('grand', 'son'), ('grand', 'mother'))
bruce, m_thomas are ('father', 'son')
bruce, david_a are ('father', 'son')
bruce, fred_a are ('brother', 'brother')
bruce, tim are ('brother', 'brother')
bruce, vicki are ('brother', 'sister')
bruce, jill are ('brother', 'sister')
bruce, joyce are ('nephew', 'aunt')
bruce, phyllis are ('nephew', 'aunt')
bruce, john_w are ('nephew', 'uncle')
bruce, bill are ('nephew', 'uncle')
bruce, chuck_w are ('nephew', 'uncle')
bruce, david_c are ('1st', 'cousins')
bruce, danny are ('1st', 'cousins')
bruce, dee are ('1st', 'cousins')
bruce, mitch are ('1st', 'cousins')
bruce, jonni are ('1st', 'cousins')
bruce, lorri are ('1st', 'cousins')
bruce, steve_w are ('1st', 'cousins')
bruce, jim are ('1st', 'cousins')
bruce, jeri are ('1st', 'cousins')
bruce, annette are ('1st', 'cousins')
bruce, helen_w are ('1st', 'cousins')
bruce, mary_w are ('1st', 'cousins')
bruce, charli are ('1st', 'cousins', 1, 'removed')
bruce, jimjim are ('1st', 'cousins', 1, 'removed')
bruce, johnjohn are ('1st', 'cousins', 1, 'removed')
bruce, jamie are ('1st', 'cousins', 1, 'removed')
bruce, david_w are ('1st', 'cousins', 1, 'removed')
bruce, jessica are ('1st', 'cousins', 1, 'removed')
bruce, bridget are ('1st', 'cousins', 1, 'removed')
bruce, brian2 are ('1st', 'cousins', 1, 'removed')
bruce, victoria are ('1st', 'cousins', 1, 'removed')
<BLANKLINE>
done
bc_example: 0 fc_rules, 0 triggered, 0 rerun
bc_example: 26 bc_rules, 31950 goals, 112099 rules matched
17150 successes, 112099 failures
family: 9 fact names, 94 universal facts, 0 case_specific facts
bc time ..., ... goals/sec
>>> driver.bc2_test() # doctest: +ELLIPSIS
doing proof
bruce, thomas are ('son', 'father')
bruce, norma are ('son', 'mother')
bruce, frederik are (('grand', 'son'), ('grand', 'father'))
bruce, mary are (('grand', 'son'), ('grand', 'mother'))
bruce, allen are (('grand', 'son'), ('grand', 'father'))
bruce, ismay are (('grand', 'son'), ('grand', 'mother'))
bruce, m_thomas are ('father', 'son')
bruce, david_a are ('father', 'son')
bruce, fred_a are ('brother', 'brother')
bruce, tim are ('brother', 'brother')
bruce, vicki are ('brother', 'sister')
bruce, jill are ('brother', 'sister')
bruce, joyce are ('nephew', 'aunt')
bruce, phyllis are ('nephew', 'aunt')
bruce, john_w are ('nephew', 'uncle')
bruce, bill are ('nephew', 'uncle')
bruce, chuck_w are ('nephew', 'uncle')
bruce, david_c are ('1st', 'cousins')
bruce, danny are ('1st', 'cousins')
bruce, dee are ('1st', 'cousins')
bruce, mitch are ('1st', 'cousins')
bruce, jonni are ('1st', 'cousins')
bruce, lorri are ('1st', 'cousins')
bruce, steve_w are ('1st', 'cousins')
bruce, jim are ('1st', 'cousins')
bruce, jeri are ('1st', 'cousins')
bruce, annette are ('1st', 'cousins')
bruce, helen_w are ('1st', 'cousins')
bruce, mary_w are ('1st', 'cousins')
bruce, charli are ('1st', 'cousins', 1, 'removed')
bruce, jimjim are ('1st', 'cousins', 1, 'removed')
bruce, johnjohn are ('1st', 'cousins', 1, 'removed')
bruce, jamie are ('1st', 'cousins', 1, 'removed')
bruce, david_w are ('1st', 'cousins', 1, 'removed')
bruce, jessica are ('1st', 'cousins', 1, 'removed')
bruce, bridget are ('1st', 'cousins', 1, 'removed')
bruce, brian2 are ('1st', 'cousins', 1, 'removed')
bruce, victoria are ('1st', 'cousins', 1, 'removed')
<BLANKLINE>
done
bc2_example: 0 fc_rules, 0 triggered, 0 rerun
bc2_example: 29 bc_rules, 315 goals, 1202 rules matched
272 successes, 1202 failures
family: 9 fact names, 94 universal facts, 0 case_specific facts
bc time ..., ... goals/sec
>>> driver.test() # doctest: +ELLIPSIS
doing proof
bruce, thomas are son, father
bruce, norma are son, mother
bruce, frederik are grand son, grand father
bruce, mary are grand son, grand mother
bruce, allen are grand son, grand father
bruce, ismay are grand son, grand mother
bruce, m_thomas are father, son
bruce, david_a are father, son
bruce, fred_a are brother, brother
bruce, tim are brother, brother
bruce, vicki are brother, sister
bruce, jill are brother, sister
bruce, joyce are nephew, aunt
bruce, phyllis are nephew, aunt
bruce, john_w are nephew, uncle
bruce, bill are nephew, uncle
bruce, chuck_w are nephew, uncle
bruce, david_c are 1st cousins
bruce, danny are 1st cousins
bruce, dee are 1st cousins
bruce, mitch are 1st cousins
bruce, jonni are 1st cousins
bruce, lorri are 1st cousins
bruce, steve_w are 1st cousins
bruce, jim are 1st cousins
bruce, jeri are 1st cousins
bruce, annette are 1st cousins
bruce, helen_w are 1st cousins
bruce, mary_w are 1st cousins
bruce, charli are 1st cousins, 1 removed
bruce, jimjim are 1st cousins, 1 removed
bruce, johnjohn are 1st cousins, 1 removed
bruce, jamie are 1st cousins, 1 removed
bruce, david_w are 1st cousins, 1 removed
bruce, jessica are 1st cousins, 1 removed
bruce, bridget are 1st cousins, 1 removed
bruce, brian2 are 1st cousins, 1 removed
bruce, victoria are 1st cousins, 1 removed
<BLANKLINE>
done
example: 6 fc_rules, 262 triggered, 0 rerun
example: 21 bc_rules, 9600 goals, 19772 rules matched
1542 successes, 19772 failures
family: 9 fact names, 94 universal facts, 422 case_specific facts
fc time ..., ... asserts/sec
bc time ..., ... goals/sec
total time ...
>>> driver.general('bruce') # doctest: +ELLIPSIS
doing proof
bruce, thomas are ('son', 'father')
bruce, norma are ('son', 'mother')
bruce, frederik are (('grand', 'son'), ('grand', 'father'))
bruce, mary are (('grand', 'son'), ('grand', 'mother'))
bruce, allen are (('grand', 'son'), ('grand', 'father'))
bruce, ismay are (('grand', 'son'), ('grand', 'mother'))
bruce, m_thomas are ('father', 'son')
bruce, david_a are ('father', 'son')
bruce, fred_a are ('brother', 'brother')
bruce, tim are ('brother', 'brother')
bruce, vicki are ('brother', 'sister')
bruce, jill are ('brother', 'sister')
bruce, joyce are ('nephew', 'aunt')
bruce, phyllis are ('nephew', 'aunt')
bruce, john_w are ('nephew', 'uncle')
bruce, bill are ('nephew', 'uncle')
bruce, chuck_w are ('nephew', 'uncle')
bruce, david_c are ('1st', 'cousins')
bruce, danny are ('1st', 'cousins')
bruce, dee are ('1st', 'cousins')
bruce, mitch are ('1st', 'cousins')
bruce, jonni are ('1st', 'cousins')
bruce, lorri are ('1st', 'cousins')
bruce, steve_w are ('1st', 'cousins')
bruce, jim are ('1st', 'cousins')
bruce, jeri are ('1st', 'cousins')
bruce, annette are ('1st', 'cousins')
bruce, helen_w are ('1st', 'cousins')
bruce, mary_w are ('1st', 'cousins')
bruce, charli are ('1st', 'cousins', 1, 'removed')
bruce, jimjim are ('1st', 'cousins', 1, 'removed')
bruce, johnjohn are ('1st', 'cousins', 1, 'removed')
bruce, jamie are ('1st', 'cousins', 1, 'removed')
bruce, david_w are ('1st', 'cousins', 1, 'removed')
bruce, jessica are ('1st', 'cousins', 1, 'removed')
bruce, bridget are ('1st', 'cousins', 1, 'removed')
bruce, brian2 are ('1st', 'cousins', 1, 'removed')
bruce, victoria are ('1st', 'cousins', 1, 'removed')
<BLANKLINE>
done
bc2_example: 0 fc_rules, 0 triggered, 0 rerun
bc2_example: 29 bc_rules, 315 goals, 1202 rules matched
272 successes, 1202 failures
family: 9 fact names, 94 universal facts, 0 case_specific facts
bc time ..., ... goals/sec