Re: assert vs instance-of and other questions
Kotaro Funakoshi <[email protected]>
| Newsgroups | gmane.comp.ai.powerloom |
|---|---|
| Message-ID | <[email protected]> |
Dear Thomas and Hans, Thank you very much for your helpful comments! Best, Kotaro On 2006/01/13, at 2:35, Thomas Russ wrote: > > On Jan 12, 2006, at 3:01 AM, Kotaro FUNAKOSHI wrote: > >> Dear members, >> >> I have three questions about PowerLoom. I will highly appreciate it >> if somebody gives me answers. > > I will be glad to. > >> >> (1) assert vs instance-of >> >> I found an asymmetricity between (A) asserting conceptual propositions using >> command "assert" directly and (B) asserting conceptual propositions using >> relation "instance-of". > > Yes. This is a known problem. > The fundamental issue has to do with PowerLoom rule indexing, > which I'll cover in the answer to your second question. > >> Assume the following KB: >> -------------------------------------------------------------------- >> (defmodule "PL-USER/TEST") >> (in-module "PL-USER/TEST") >> (clear-module "PL-USER/TEST") >> (in-dialect :KIF) >> >> (defconcept animal) >> (defconcept monkey (animal)) >> -------------------------------------------------------------------- >> >> case (A): >> When I use command "assert", everything is fine. >> >> |= (assert (george monkey)) >> >> |P|(MONKEY GEORGE) >> >> |= (ask (instance-of george monkey)) >> >> TRUE >> >> |= (ask (instance-of george animal)) >> >> TRUE >> >> |= (ask (animal george)) >> >> TRUE >> >> |= (ask (monkey george)) >> >> TRUE >> >> case (B): >> However if I use relation "instance-of", something goes wrong. >> >> |= (definstance george :instance-of monkey) >> >> |i|GEORGE >> >> |= (ask (instance-of george monkey)) >> >> TRUE >> >> |= (ask (instance-of george animal)) >> >> TRUE >> >> |= (ask (monkey george)) >> >> UNKNOWN >> >> |= (ask (animal george)) >> >> UNKNOWN >> >> >> Why cannot PowerLoom answer that (monkey george) is TRUE when I use >> "instance-of" even though it answers correctly against (ask (instance-of george animal))? >> >> I just wanted to use "instance-of" because I prefer frame-style descriptions >> such as >> (definstance george >> :instance-of monkey >> :likes banana >> :at forest1 >> :age 4). >> >> I can simply avoid this problem by using always command "assert" like >> (definstance george >> :likes banana >> :at forest1 >> :age 4) >> (assert (monkey george)). ( yet not so elegant :-( ) >> >> Even avoidable, such a behavior of PowerLoom makes me feel ill at ease... >> Is this an intended behavior or just a bug? > > This is just a bug. I don't know when it will be fixed, though. > > Fortunately, there is a fairly easy alternate way of saying > what you want that will allow you to use the frame-style > descriptions. > > Any single place (unary) relation, which includes concepts, > can be specified as if it were a boolean binary relation. > In other words, instead of writing > :instance-of monkey > you would write > :monkey true > and this will cause PowerLoom to assert (monkey george). > Your full example would look like > > (definstance george > :monkey true > :likes banana > :at forest1 > :age 4) > > This will then get you the inferences you want. > >> (2) Warning: PowerLoom can't index the rule >> >> I tried to avoid the problem described above by using a rule. But I got a >> warning message "Warning: PowerLoom can't index the rule" and the rule >> seems not to work. >> >> The rule is here: >> (defrule "instance-of TO assert" >> (forall (?x ?c) (=> (and (concept ?c) (instance-of ?x ?c)) (?c ?x)))) >> >> What's the meaning of the message and what's wrong with my rule? > > PowerLoom itself has a similar rule, but our sources also > indicate that this is not properly indexed. > > What the warning means is that although the rule is a > legal and correct rule, it has a part that is too complicated > for PowerLoom's current machinery to index. This has the > unfortunate effect of rendering the rule useless, since without > indexing, the PowerLoom reasoner can't find the rule when it > would need to apply it. > > In your particular example, the problem is that the clause > (?c ?x) doesn't give PowerLoom anything definite to use for > indexing the rule. > >> (3) Powers of PowerLoom >> >> This is a basic question about PowerLoom. Is PowerLoom superior to or >> equivalent to Loom in any respects? > >> Loom seems have more complex syntax (maybe syntax sugars) than PowerLoom. >> But yet does PowerLoom have greater expressiveness than Loom? > > I'll try a quick and general answer. If you want more details, ask. > > PowerLoom definitely has greater expressive power than Loom. > That is because the language that can be used to describe > concepts in Loom is more limited. It is a description logic > with certain additional constructs (:satisfies), but that is > more limited a language than first order predicate calculus. > Also, Loom has only limited ability to reason with :satisfies > clauses, and in particular no way to classify concepts based > on them. > > PowerLoom's input language is first order predicate calculus, > which is more expressive. > >> Should everybody use PowerLoom instead of Loom? Or somebody with some >> specific purposes had better use Loom rather than PowerLoom? > > It depends. There are certain specific purposes where Loom would > be better suited at the moment. > > Specifically, Loom would be better suited if you really care > about concept classification. PowerLoom has the ability to classify > concepts and relations, but that form of reasoning has not yet > received a lot of attention. In particular, PowerLoom's classifier > is weak in classifying based on cardinality constraints. > > Loom, on the other hand, being a classification-based description > logic is quite good at classifying concepts. As long as you are > able to express what you wish in the more limited Loom language, it > would be a good choice. Also, if you want to have a system that > supports procedural rules (production rules), then Loom would be a > good choice. > > PowerLoom's strengths lie in areas outside of concept and relation > classification. Major benefits are a more expressive input language > and a more expressive logical rule language (this is different from a > procedural rule language). PowerLoom's research release also has > support for connections to databases, which is not available in Loom. > (We hope to make the stable parts of that available in the next > PowerLoom release.) > > PowerLoom is available in C++, Java and Common Lisp. Loom is > available only in Common Lisp. > > PowerLoom is also under active development whereas Loom is a > finished project and will not be further developed. > >> Best regards, >> >> Kotaro Funakoshi >> Tokyo Institute of Technology >> _______________________________________________ >> powerloom-forum mailing list >> [email protected] >> http://mailman.isi.edu/mailman/listinfo/powerloom-forum > >