Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] error in swrl builtins?

Thomas Russ tar at ISI.EDU
Tue Jan 8 13:18:13 PST 2008


On Jan 8, 2008, at 12:42 PM, Andrew Crapo wrote:

> I have a swrl rule to calculate the volume of a sphere:
> Sphere(?x)  ∧
> radius(?x, ?r)  ∧
> swrlb:divide(?ft, 4, 3)  ∧
> swrlb:multiply(?ftp, ?ft, 3.14159)  ∧
> swrlb:pow(?r3, ?r, 3)  ∧
> swrlb:multiply(?v, ?ftp, ?r3)
>  → volume(?x, ?v)
>
> For an instance of a sphere with radius 12.5, Protege-OWL 3.4 beta  
> (build 125)
> assigns a value of 6135.5254. I believe the correct answer, hand  
> calculated or
> calculated with another reasoner, is 8181.1465.

I'm not completely sure, but I think that the built-ins try to keep  
the same numeric datatype as their input arguments.  The discrepancy  
you see would be explained by 4/3 => 1 instead of 4.0/3.0 = 1.33333333

Try changing all the constants to floating point numbers and see if  
that changes things.




More information about the protege-owl mailing list