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> </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 that we can load into
> PowerLoom. </FONT>My example 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>).
> The original axiom is:</FONT></DIV></DIV>
> <DIV><FONT face=Arial size=2></FONT> </DIV>
> <DIV><FONT face=Arial size=2>(forall (?occ ?a1 ?a2)<BR>
> (=> (and (occurrence_of ?occ
> ?a1)<BR>
> (occurrence_of ?occ
> ?a2))<BR> (= ?a1
> ?a2)))</FONT></DIV>
> <DIV><FONT face=Arial size=2></FONT> </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. 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
> <A
> href="http://www.mel.nist.gov/psl/download/psl_core.clf">http://www.mel.nist.gov/psl/download/psl_core.clf</A>).
> Any advice on how we should proceed with our manual translation is very
> much appreciated.</FONT></DIV>
> <DIV><FONT face=Arial size=2></FONT> </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>> Hello,<BR>><BR>> We're trying to define an axiom to
> ensure a singular cardinality as <BR>> follows:<BR>><BR>> ;;
> BEGIN PowerLoom<BR>> (defconcept Person)<BR>> (defconcept
> Country)<BR>> (defrelation presidentOf ((?p Person) (?c
> Country)))<BR><BR>The simplest method would be reverse the order of arguments
> and make <BR>this a function:<BR><BR> (deffunction
> hasPresident ((?c Country) (?p Person)))<BR><BR>This will assure that a
> country only has one president. It will also <BR>enable implicit
> value clipping so that changing the value doesn't <BR>require an
> explicit retraction first.<BR><BR>> (assert (forall (?c ?p1
> ?p2)<BR>>
> (=> (and (presidentOf ?p1
> ?c)<BR>>
> (presidentOf ?p2
> ?c))<BR>>
> (= ?p1 ?p2))))<BR><BR>This rule will not necessarily do what you expect it to
> do. If you <BR>were to assert<BR><BR> (presidentOf
> John Freedonia)<BR> (presidentOf Bill Freedonia)<BR><BR>this rule
> will then result in the inference that<BR><BR> (= Bill
> John)<BR><BR>so that henceforth these two individuals will be considered
> the <BR>same. PowerLoom uses a unique name assumption (unlike OWL,
> for <BR>example), but that is just an assumption and can be overcome
> with an <BR>explicit assertion or an inference. You would have to
> make sure that <BR>all instances are asserted to be different from one
> another in order <BR>to force a contradiction. (I will note that
> PowerLoom is not always <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, <BR>although there probably is one.<BR><BR>><BR>> ;; END
> PowerLoom<BR>><BR>><BR>><BR>> The following error results when the
> above are entered into the <BR>> PowerLoom command
> prompt:<BR><BR>This is, of course, a bug. It shouldn't
> break.<BR><BR>><BR>> Internal Error: OOPS -- BUG IN 'copy-
> <BR>> description'edu.isi.stella.StellaException: OOPS -- BUG IN 'copy-
> <BR>> description'<BR>> at
> edu.isi.powerloom.logic.Logic.copyPropositionArgument <BR>>
> (Logic.java:29501)<BR>> at
> edu.isi.powerloom.logic.Proposition.copyProposition <BR>>
> (Proposition.java:635)<BR>> at
> edu.isi.powerloom.logic.Logic.copyPropositionArgument <BR>>
> (Logic.java:29480)<BR>> at
> edu.isi.powerloom.logic.Proposition.copyProposition <BR>>
> (Proposition.java:635)<BR>> at
> edu.isi.powerloom.logic.Logic.copyPropositionArgument <BR>>
> (Logic.java:29480)<BR>> at
> edu.isi.powerloom.logic.Proposition.copyProposition <BR>>
> (Proposition.java:635)<BR>> at
> <BR>> edu.isi.powerloom.logic.Proposition.createForwardChainingIndex
> <BR>> (Proposition.java:4578)<BR>>
> at <BR>> edu.isi.powerloom.logic.Proposition.deriveComplexForwardRule
> <BR>> (Proposition.java:4571)<BR>>
> at edu.isi.powerloom.logic.Proposition.deriveOneSatelliteRule <BR>>
> (Proposition.java:4954)<BR>> at
> <BR>> edu.isi.powerloom.logic.Proposition.deriveSatelliteRulesForGoalP
> <BR>> (Proposition.java:4886)<BR>>
> at edu.isi.powerloom.logic.Proposition.deriveSatelliteRules <BR>>
> (Proposition.java:4796)<BR>> at
> edu.isi.powerloom.logic.Proposition.runGoesTrueDemons <BR>>
> (Proposition.java:11617)<BR>> at
> <BR>> edu.isi.powerloom.logic.Proposition.updateLinksAndTimestamps <BR>>
> (Proposition.java:11492)<BR>> at
> edu.isi.powerloom.logic.Proposition.assignTruthValue <BR>>
> (Proposition.java:11469)<BR>> at
> <BR>> edu.isi.powerloom.logic.Proposition.updatePropositionTruthValue
> <BR>> (Proposition.java:11277)<BR>>
> at <BR>>
> edu.isi.powerloom.logic.Proposition.helpUpdateTopLevelProposition <BR>>
> (Proposition.java:9493)<BR>> at
> edu.isi.powerloom.logic.Logic.updateTopLevelProposition <BR>>
> (Logic.java:9231)<BR>> at
> edu.isi.powerloom.logic.Logic.updateProposition(Logic.java: <BR>>
> 9260)<BR>> at
> edu.isi.powerloom.logic.Logic.smartUpdateProposition <BR>>
> (Logic.java:9406)<BR>> at
> edu.isi.powerloom.logic.Logic.renamed_Assert(Logic.java:9427)<BR>>
> at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown
> Source)<BR>> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown <BR>>
> Source)<BR>> at
> java.lang.reflect.Method.invoke(Unknown
> Source)<BR>> at
> edu.isi.stella.javalib.Native.funcall(Native.java:608)<BR>>
> at
> edu.isi.stella.Stella.apply(Stella.java:8401)<BR>>
> at
> edu.isi.stella.Cons.evaluateConsTree(Cons.java:8355)<BR>>
> at edu.isi.stella.Stella_Object.evaluate(Stella_Object.java: <BR>>
> 4351)<BR>> at
> edu.isi.powerloom.logic.Logic.evaluateLogicCommand <BR>>
> (Logic.java:31552)<BR>> at
> edu.isi.powerloom.logic.Logic.logicCommandLoop(Logic.java: <BR>>
> 31448)<BR>> at
> edu.isi.powerloom.logic.Logic.powerloom(Logic.java:37358)<BR>>
> at edu.isi.powerloom.PowerLoom.main(PowerLoom.java:108)<BR>><BR>> Any
> advice is greatly appreciated.<BR>> Cameron Ross.<BR>><BR>>
> _______________________________________________<BR>> powerloom-forum
> mailing list<BR>> <A
> href="mailto:[email protected]">[email protected]</A><BR>> <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