Re: Boolean Value Warnings in Java
Hans Chalupsky <[email protected]> Mon, 25 Oct 2010 11:51:44 -0700
| Newsgroups | gmane.comp.ai.powerloom |
|---|---|
| Message-ID | <[email protected]> |
I actually wasn't able to reproduce the warning, but that's somewhat besides the point, and I only tried with the Lisp version of s-ask. There are a couple of comments: (1) PowerLoom does't really fully support boolean-valued functions, since they are not strictly necessary. Instead of a boolean-valued function, you can always define a relation with one less argument whose truth value will correspond to the boolean value. For example: (defrelation unhappy ((?c city))) (2) You can define a boolean-valued function the way you had it, but you won't get all the inferences you expect. For example, if you ask (ask (not (= (unhappy newyork)TRUE))) => FALSE (ask (= (unhappy newyork) false)) => FALSE you get correct answers because of PowerLoom's reasoning about the single-valuedness of the function, not because of its boolean value type. However, if you assert (assert (not (= (unhappy la) true))) and then ask (ask (= (unhappy la) false)) => UNKNOWN which is not what you'd expect. (3) If you don't mind these issues but want to stay with boolean values, you could just define the function without the boolean value type, and the warning should go away - even though I'm not fully sure why you are getting it at all: (deffunction unhappy ((?c city)) :-> ?b) We might provide more general support for boolean-valued functions sometime in the future given that that is a modeling style used in Semantic Web languages that do not support unary relations. Hans >>>>> lee martie <[email protected]> writes: > From the powerloom 4.0.0.beta command line in the module PL-USER I can: > (defconcept city) > (assert (city newyork)) > (deffunction unhappy ((?c city)) :-> (?b BOOLEAN)) > (assert (=(unhappy newyork)TRUE)) > (ask(=(unhappy newyork)TRUE)) > and get an answer of TRUE. > Attempting the same example above using the powerloom.jar that comes > with powerloom 4.0.0.beta gives me a warning. > If I ask "(=(unhappy newyork)TRUE)" with the method > PLI.sAsk in the module PL-USER I get the warning: > WARNING: Type check violation on argument `@TRUE' in proposition > (= (UNHAPPY NEWYORK) TRUE). > Argument must have type `BOOLEAN'. > Warning occurred while parsing the proposition: > (KAPPA () (UNHAPPY @NEWYORK @TRUE)) > and an answer of TRUE. > Am I using the wrong values for booleans? > Is there any advice on how to get rid of these warnings? > Thanks for your help. > Lee Martie > _______________________________________________ > powerloom-forum mailing list > [email protected] > http://mailman.isi.edu/mailman/listinfo/powerloom-forum