math built-in called on existential: kerflewey

Still trying to isolate one bug, found another.

Try the attached ala...

connolly@dirk:~/w3ccvs/WWW/2000/10/swap$ python cwm.py
test/datatypes/dec-div.n3  --think


and out comes...



#Processed by Id: cwm.py,v 1.162 2004/08/08 01:44:49 syosi Exp
        #    using base
file:/home/connolly/w3ccvs/WWW/2000/10/swap/test/datatypes/dec-div.n3
        Traceback (most recent call last):
  File "cwm.py", line 635, in ?
    doCommand()
  File "cwm.py", line 543, in doCommand
    think(workingContext, mode=option_flags["think"])
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/query.py", line 60, in
think
    return InferenceTask(knowledgeBase, ruleFormula, mode=mode,
repeat=1).run()
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/query.py", line 220, in
run
    return self.runSmart()
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/query.py", line 208, in
runSmart
    total += cy.run()
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/query.py", line 349, in
run
    found = rule.once()
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/query.py", line 441, in
once
    total = query.resolve()
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/query.py", line 584, in
resolve
    return self.unify(self.queue, self.variables, self.existentials)
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/query.py", line 821, in
unify
    bindings.copy(), nb, evidence = evidence + [reason])
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/query.py", line 821, in
unify
    bindings.copy(), nb, evidence = evidence + [reason])
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/query.py", line 821, in
unify
    bindings.copy(), nb, evidence = evidence + [reason])
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/query.py", line 821, in
unify
    bindings.copy(), nb, evidence = evidence + [reason])
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/query.py", line 821, in
unify
    bindings.copy(), nb, evidence = evidence + [reason])
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/query.py", line 821, in
unify
    bindings.copy(), nb, evidence = evidence + [reason])
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/query.py", line 821, in
unify
    bindings.copy(), nb, evidence = evidence + [reason])
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/query.py", line 821, in
unify
    bindings.copy(), nb, evidence = evidence + [reason])
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/query.py", line 821, in
unify
    bindings.copy(), nb, evidence = evidence + [reason])
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/query.py", line 821, in
unify
    bindings.copy(), nb, evidence = evidence + [reason])
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/query.py", line 749, in
unify
    nbs = item.tryBuiltin(queue, bindings, heavy=0, evidence=evidence)
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/query.py", line 1025, in
tryBuiltin
    result = pred.evalObj(subj, queue, bindings.copy(), proof,
self.query)
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/term.py", line 963, in
evalObj    return
self.store._fromPython(self.evaluateObject(subj.value()))
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/cwm_math.py", line 122,
in evaluateObject
    if len(subj_py) == 2: return
numeric(subj_py[0]).__truediv__(numeric(subj_py[1]))
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/cwm_math.py", line 71, in
numeric
    if s.find('.') < 0 and s.find('e') < 0 : return long(s)
AttributeError: AnonymousExistential instance has no attribute 'find'

-- 
Dan Connolly, W3C http://www.w3.org/People/Connolly/

Received on Monday, 16 August 2004 21:24:02 UTC