math:quotient on strings crashes

I'm trying to isolate a bug that seems to involve
the recent datatype.py stuff. I haven't found it
yet, but I found something nearby:

Try this:

---8<---
@prefix math: <http://www.w3.org/2000/10/swap/math#> .

@prefix : <#>.

{ ("10" "2.3") math:quotient ?X } => { ?X a :Answer }.
---8<---

ala...

$ python cwm.py foo.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 338, in
run
    return 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 836, in
unify
    return query.conclude(bindings,  evidence=evidence)  # No terms left
.. success!
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/query.py", line 664, in
conclude
    delta = self.targetContext.loadFormulaWithSubsitution(
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/formula.py", line 367, in
loadFormulaWithSubsitution
    why=why)
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/llyn.py", line 272, in
add
    if not isinstance(subj, Term): subj = store.intern(subj)
  File "/home/connolly/w3ccvs/WWW/2000/10/swap/llyn.py", line 1264, in
intern    raise RuntimeError("Eh?  can't intern "+`what`+" of type:
"+`type(what)`)RuntimeError: Eh?  can't intern NotImplemented of type:
<type 'NotImplementedType'>

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

Received on Monday, 16 August 2004 21:10:07 UTC