Re: How to assert that a country has one president

Hans Chalupsky <[email protected]> Thu, 29 Nov 2007 21:20:02 -0800
Newsgroups gmane.comp.ai.powerloom
Message-ID <[email protected]>
Cameron,

I recently fixed this bug in one of my local versions.  I'll try to
fold it into the main release.  As a follow-up to Tom's answer:
PowerLoom's unique names assumption will not allow you to assert or
infer that 

   (= Bill John)

If that happens, it will report a clash.  The only individuals for which
PowerLoom allows identity are intensional individuals such as skolems
or function terms.  A workaround would therefore be to use a function
wrapper for all individuals for which you want to be able to assert
or infer identity.

For example:

(deffunction denotes (?name) :-> ?entity)

(assert (= (denotes bill) (denotes joe)))

Your rule would then be written as:

(forall (?occ ?a1 ?a2)
     (=>> (and (occurrence_of ?occ (denotes ?a1))
               (occurrence_of ?occ (denotes ?a2)))
          (= (denotes ?a1) (denotes ?a2))))

Note also that I marked the rule as a forward-only rule via the =>>
syntax, since PowerLoom does not backchain on equality predicates.

Hans

>>>>> Cameron Ross <[email protected]> writes:

> Thanks Thomas.
> Some context... we're trying to create a manual translation of the Process Specification Language that we can load into PowerLoom.  My example was based on Axiom 13 of the PSL core module (http://www.mel.nist.gov/psl/psl-ontology/psl_core.html).  The original axiom is:

> (forall (?occ ?a1 ?a2)
>     (=> (and (occurrence_of ?occ ?a1)
>                  (occurrence_of ?occ ?a2))
>           (= ?a1 ?a2)))

> We had discussed defining the PSL occurrence_of relation as a function, but would prefer to stay as true to the standard PSL ontology as possible.  Note that I think we would in fact want the analogy of (= Bill John) in the PSL context (i.e. Bill and John are synonyms), so this shouldn't be a problem.  Generally, the challenge we're having is that the PSL doesn't explicitly define concepts, relations or functions based on an upper ontology, but leaves such definitions implicit within a set of axioms (see http://www.mel.nist.gov/psl/download/psl_core.clf).  Any advice on how we should proceed with our manual translation is very much appreciated.

> Thanks,
> Cameron.
>   ----- Original Message ----- 
>   From: Thomas Russ 
>   To: Cameron Ross ; PowerLoom Forum 
>   Cc: Lorrie Fava 
>   Sent: Tuesday, November 27, 2007 1:40 PM
>   Subject: Re: [PowerLoom Forum] How to assert that a country has one president



>   On Nov 27, 2007, at 10:04 AM, Cameron Ross wrote:

>> Hello,
>> 
>> We're trying to define an axiom to ensure a singular cardinality as  
>> follows:
>> 
>> ;; BEGIN PowerLoom
>> (defconcept Person)
>> (defconcept Country)
>> (defrelation presidentOf ((?p Person) (?c Country)))

>   The simplest method would be reverse the order of arguments and make  
>   this a function:

>      (deffunction hasPresident ((?c Country) (?p Person)))

>   This will assure that a country only has one president.  It will also  
>   enable implicit value clipping so that changing the value doesn't  
>   require an explicit retraction first.

>> (assert (forall (?c ?p1 ?p2)
>> (=> (and (presidentOf ?p1 ?c)
>> (presidentOf ?p2 ?c))
>> (= ?p1 ?p2))))

>   This rule will not necessarily do what you expect it to do.  If you  
>   were to assert

>      (presidentOf John Freedonia)
>      (presidentOf Bill Freedonia)

>   this rule will then result in the inference that

>       (= Bill John)

>   so that henceforth these two individuals will be considered the  
>   same.  PowerLoom uses a unique name assumption (unlike OWL, for  
>   example), but that is just an assumption and can be overcome with an  
>   explicit assertion or an inference.  You would have to make sure that  
>   all instances are asserted to be different from one another in order  
>   to force a contradiction.  (I will note that PowerLoom is not always  
>   very aggressive in noticing such clashes, though).

>   Right off the top of my head, I can't think of a rule-based solution,  
>   although there probably is one.

>> 
>> ;; END PowerLoom
>> 
>> 
>> 
>> The following error results when the above are entered into the  
>> PowerLoom command prompt:

>   This is, of course, a bug.  It shouldn't break.

>> 
>> Internal Error: OOPS -- BUG IN 'copy- 
>> description'edu.isi.stella.StellaException: OOPS -- BUG IN 'copy- 
>> description'
>> at edu.isi.powerloom.logic.Logic.copyPropositionArgument 
>> (Logic.java:29501)
>> at edu.isi.powerloom.logic.Proposition.copyProposition 
>> (Proposition.java:635)
>> at edu.isi.powerloom.logic.Logic.copyPropositionArgument 
>> (Logic.java:29480)
>> at edu.isi.powerloom.logic.Proposition.copyProposition 
>> (Proposition.java:635)
>> at edu.isi.powerloom.logic.Logic.copyPropositionArgument 
>> (Logic.java:29480)
>> at edu.isi.powerloom.logic.Proposition.copyProposition 
>> (Proposition.java:635)
>> at  
>> edu.isi.powerloom.logic.Proposition.createForwardChainingIndex 
>> (Proposition.java:4578)
>> at  
>> edu.isi.powerloom.logic.Proposition.deriveComplexForwardRule 
>> (Proposition.java:4571)
>> at edu.isi.powerloom.logic.Proposition.deriveOneSatelliteRule 
>> (Proposition.java:4954)
>> at  
>> edu.isi.powerloom.logic.Proposition.deriveSatelliteRulesForGoalP 
>> (Proposition.java:4886)
>> at edu.isi.powerloom.logic.Proposition.deriveSatelliteRules 
>> (Proposition.java:4796)
>> at edu.isi.powerloom.logic.Proposition.runGoesTrueDemons 
>> (Proposition.java:11617)
>> at  
>> edu.isi.powerloom.logic.Proposition.updateLinksAndTimestamps 
>> (Proposition.java:11492)
>> at edu.isi.powerloom.logic.Proposition.assignTruthValue 
>> (Proposition.java:11469)
>> at  
>> edu.isi.powerloom.logic.Proposition.updatePropositionTruthValue 
>> (Proposition.java:11277)
>> at  
>> edu.isi.powerloom.logic.Proposition.helpUpdateTopLevelProposition 
>> (Proposition.java:9493)
>> at edu.isi.powerloom.logic.Logic.updateTopLevelProposition 
>> (Logic.java:9231)
>> at edu.isi.powerloom.logic.Logic.updateProposition(Logic.java: 
>> 9260)
>> at edu.isi.powerloom.logic.Logic.smartUpdateProposition 
>> (Logic.java:9406)
>> at edu.isi.powerloom.logic.Logic.renamed_Assert(Logic.java:9427)
>> at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown  
>> Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at edu.isi.stella.javalib.Native.funcall(Native.java:608)
>> at edu.isi.stella.Stella.apply(Stella.java:8401)
>> at edu.isi.stella.Cons.evaluateConsTree(Cons.java:8355)
>> at edu.isi.stella.Stella_Object.evaluate(Stella_Object.java: 
>> 4351)
>> at edu.isi.powerloom.logic.Logic.evaluateLogicCommand 
>> (Logic.java:31552)
>> at edu.isi.powerloom.logic.Logic.logicCommandLoop(Logic.java: 
>> 31448)
>> at edu.isi.powerloom.logic.Logic.powerloom(Logic.java:37358)
>> at edu.isi.powerloom.PowerLoom.main(PowerLoom.java:108)
>> 
>> Any advice is greatly appreciated.
>> Cameron Ross.
>> 
>> _______________________________________________
>> powerloom-forum mailing list
>> [email protected]
>> http://mailman.isi.edu/mailman/listinfo/powerloom-forum
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
> <META content="MSHTML 6.00.6000.16546" name=GENERATOR>
> <STYLE></STYLE>
> </HEAD>
> <BODY bgColor=#ffffff>
> <DIV><FONT face=Arial size=2>Thanks Thomas.</FONT></DIV>
> <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> <DIV><FONT face=Arial size=2>
> <DIV><FONT face=Arial size=2>Some context... we're trying to create a manual 
> translation of the Process Specification Language&nbsp;that we can load into 
> PowerLoom.&nbsp; </FONT>My example&nbsp;was based on Axiom 13 of the PSL core 
> module (<A 
> href="http://www.mel.nist.gov/psl/psl-ontology/psl_core.html">http://www.mel.nist.gov/psl/psl-ontology/psl_core.html</A>).&nbsp; 
> The original axiom is:</FONT></DIV></DIV>
> <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> <DIV><FONT face=Arial size=2>(forall (?occ ?a1 ?a2)<BR>&nbsp;&nbsp;&nbsp; 
> (=&gt;&nbsp;(and (occurrence_of ?occ 
> ?a1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
> (occurrence_of ?occ 
> ?a2))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (= ?a1 
> ?a2)))</FONT></DIV>
> <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> <DIV><FONT face=Arial size=2>We had discussed defining the PSL occurrence_of 
> relation as a function, but would prefer to stay as true to the standard PSL 
> ontology as possible.&nbsp; Note that I think we would in fact want the analogy 
> of&nbsp;(= Bill John) in the PSL context (i.e. Bill and John are synonyms), so 
> this shouldn't be a problem.&nbsp; Generally, the challenge we're having is that 
> the PSL doesn't explicitly define concepts, relations or functions based on an 
> upper ontology, but leaves such definitions implicit within a set of axioms (see 
> <A 
> href="http://www.mel.nist.gov/psl/download/psl_core.clf">http://www.mel.nist.gov/psl/download/psl_core.clf</A>).&nbsp; 
> Any advice on how we&nbsp;should proceed with our manual translation is very 
> much appreciated.</FONT></DIV>
> <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> <DIV><FONT face=Arial size=2>Thanks,</FONT></DIV>
> <DIV><FONT face=Arial size=2>Cameron.</FONT></DIV>
> <BLOCKQUOTE 
> style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
>   <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
>   <DIV 
>   style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
>   <A [email protected] href="mailto:[email protected]">Thomas Russ</A> </DIV>
>   <DIV style="FONT: 10pt arial"><B>To:</B> <A [email protected] 
>   href="mailto:[email protected]">Cameron Ross</A> ; <A 
>   [email protected] href="mailto:[email protected]">PowerLoom 
>   Forum</A> </DIV>
>   <DIV style="FONT: 10pt arial"><B>Cc:</B> <A [email protected] 
>   href="mailto:[email protected]">Lorrie Fava</A> </DIV>
>   <DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, November 27, 2007 1:40 
>   PM</DIV>
>   <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [PowerLoom Forum] How to 
>   assert that a country has one president</DIV>
>   <DIV><BR></DIV><BR>On Nov 27, 2007, at 10:04 AM, Cameron Ross 
>   wrote:<BR><BR>&gt; Hello,<BR>&gt;<BR>&gt; We're trying to define an axiom to 
>   ensure a singular cardinality as&nbsp; <BR>&gt; follows:<BR>&gt;<BR>&gt; ;; 
>   BEGIN PowerLoom<BR>&gt; (defconcept Person)<BR>&gt; (defconcept 
>   Country)<BR>&gt; (defrelation presidentOf ((?p Person) (?c 
>   Country)))<BR><BR>The simplest method would be reverse the order of arguments 
>   and make&nbsp; <BR>this a function:<BR><BR>&nbsp;&nbsp; (deffunction 
>   hasPresident ((?c Country) (?p Person)))<BR><BR>This will assure that a 
>   country only has one president.&nbsp; It will also&nbsp; <BR>enable implicit 
>   value clipping so that changing the value doesn't&nbsp; <BR>require an 
>   explicit retraction first.<BR><BR>&gt; (assert (forall (?c ?p1 
>   ?p2)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
>   (=&gt; (and (presidentOf ?p1 
>   ?c)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
>   (presidentOf ?p2 
>   ?c))<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
>   (= ?p1 ?p2))))<BR><BR>This rule will not necessarily do what you expect it to 
>   do.&nbsp; If you&nbsp; <BR>were to assert<BR><BR>&nbsp;&nbsp; (presidentOf 
>   John Freedonia)<BR>&nbsp;&nbsp; (presidentOf Bill Freedonia)<BR><BR>this rule 
>   will then result in the inference that<BR><BR>&nbsp;&nbsp;&nbsp; (= Bill 
>   John)<BR><BR>so that henceforth these two individuals will be considered 
>   the&nbsp; <BR>same.&nbsp; PowerLoom uses a unique name assumption (unlike OWL, 
>   for&nbsp; <BR>example), but that is just an assumption and can be overcome 
>   with an&nbsp; <BR>explicit assertion or an inference.&nbsp; You would have to 
>   make sure that&nbsp; <BR>all instances are asserted to be different from one 
>   another in order&nbsp; <BR>to force a contradiction.&nbsp; (I will note that 
>   PowerLoom is not always&nbsp; <BR>very aggressive in noticing such clashes, 
>   though).<BR><BR>Right off the top of my head, I can't think of a rule-based 
>   solution,&nbsp; <BR>although there probably is one.<BR><BR>&gt;<BR>&gt; ;; END 
>   PowerLoom<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; The following error results when the 
>   above are entered into the&nbsp; <BR>&gt; PowerLoom command 
>   prompt:<BR><BR>This is, of course, a bug.&nbsp; It shouldn't 
>   break.<BR><BR>&gt;<BR>&gt;&nbsp; Internal Error: OOPS -- BUG IN 'copy- 
>   <BR>&gt; description'edu.isi.stella.StellaException: OOPS -- BUG IN 'copy- 
>   <BR>&gt; description'<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
>   edu.isi.powerloom.logic.Logic.copyPropositionArgument <BR>&gt; 
>   (Logic.java:29501)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
>   edu.isi.powerloom.logic.Proposition.copyProposition <BR>&gt; 
>   (Proposition.java:635)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
>   edu.isi.powerloom.logic.Logic.copyPropositionArgument <BR>&gt; 
>   (Logic.java:29480)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
>   edu.isi.powerloom.logic.Proposition.copyProposition <BR>&gt; 
>   (Proposition.java:635)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
>   edu.isi.powerloom.logic.Logic.copyPropositionArgument <BR>&gt; 
>   (Logic.java:29480)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
>   edu.isi.powerloom.logic.Proposition.copyProposition <BR>&gt; 
>   (Proposition.java:635)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at&nbsp; 
>   <BR>&gt; edu.isi.powerloom.logic.Proposition.createForwardChainingIndex 
>   <BR>&gt; (Proposition.java:4578)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
>   at&nbsp; <BR>&gt; edu.isi.powerloom.logic.Proposition.deriveComplexForwardRule 
>   <BR>&gt; (Proposition.java:4571)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
>   at edu.isi.powerloom.logic.Proposition.deriveOneSatelliteRule <BR>&gt; 
>   (Proposition.java:4954)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at&nbsp; 
>   <BR>&gt; edu.isi.powerloom.logic.Proposition.deriveSatelliteRulesForGoalP 
>   <BR>&gt; (Proposition.java:4886)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
>   at edu.isi.powerloom.logic.Proposition.deriveSatelliteRules <BR>&gt; 
>   (Proposition.java:4796)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
>   edu.isi.powerloom.logic.Proposition.runGoesTrueDemons <BR>&gt; 
>   (Proposition.java:11617)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at&nbsp; 
>   <BR>&gt; edu.isi.powerloom.logic.Proposition.updateLinksAndTimestamps <BR>&gt; 
>   (Proposition.java:11492)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
>   edu.isi.powerloom.logic.Proposition.assignTruthValue <BR>&gt; 
>   (Proposition.java:11469)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at&nbsp; 
>   <BR>&gt; edu.isi.powerloom.logic.Proposition.updatePropositionTruthValue 
>   <BR>&gt; (Proposition.java:11277)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
>   at&nbsp; <BR>&gt; 
>   edu.isi.powerloom.logic.Proposition.helpUpdateTopLevelProposition <BR>&gt; 
>   (Proposition.java:9493)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
>   edu.isi.powerloom.logic.Logic.updateTopLevelProposition <BR>&gt; 
>   (Logic.java:9231)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
>   edu.isi.powerloom.logic.Logic.updateProposition(Logic.java: <BR>&gt; 
>   9260)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
>   edu.isi.powerloom.logic.Logic.smartUpdateProposition <BR>&gt; 
>   (Logic.java:9406)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
>   edu.isi.powerloom.logic.Logic.renamed_Assert(Logic.java:9427)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
>   at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown 
>   Source)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
>   sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown&nbsp; <BR>&gt; 
>   Source)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
>   java.lang.reflect.Method.invoke(Unknown 
>   Source)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
>   edu.isi.stella.javalib.Native.funcall(Native.java:608)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
>   at 
>   edu.isi.stella.Stella.apply(Stella.java:8401)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
>   at 
>   edu.isi.stella.Cons.evaluateConsTree(Cons.java:8355)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
>   at edu.isi.stella.Stella_Object.evaluate(Stella_Object.java: <BR>&gt; 
>   4351)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
>   edu.isi.powerloom.logic.Logic.evaluateLogicCommand <BR>&gt; 
>   (Logic.java:31552)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
>   edu.isi.powerloom.logic.Logic.logicCommandLoop(Logic.java: <BR>&gt; 
>   31448)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
>   edu.isi.powerloom.logic.Logic.powerloom(Logic.java:37358)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
>   at edu.isi.powerloom.PowerLoom.main(PowerLoom.java:108)<BR>&gt;<BR>&gt; Any 
>   advice is greatly appreciated.<BR>&gt; Cameron Ross.<BR>&gt;<BR>&gt; 
>   _______________________________________________<BR>&gt; powerloom-forum 
>   mailing list<BR>&gt; <A 
>   href="mailto:[email protected]">[email protected]</A><BR>&gt; <A 
>   href="http://mailman.isi.edu/mailman/listinfo/powerloom-forum">http://mailman.isi.edu/mailman/listinfo/powerloom-forum</A><BR></BLOCKQUOTE></BODY></HTML>
> _______________________________________________
> powerloom-forum mailing list
> [email protected]
> http://mailman.isi.edu/mailman/listinfo/powerloom-forum