Re: A few questions concerning Loom 2.1 to Powerloom 4 translation
Hans Chalupsky <[email protected]> Wed, 06 Mar 2013 13:32:48 -0800
| Newsgroups | gmane.comp.ai.powerloom |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--===============0707564166==
Content-Type: multipart/alternative;
boundary="------------060307010709030808020406"
This is a multi-part message in MIME format.
--------------060307010709030808020406
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Hi Philippe,
first off, be aware that Loom and PowerLoom are quite different animals
with different representation languages and different feature sets.
PowerLoom is not intended to be a drop-in replacement for Loom, for
example. Maybe it was in its initial conception, but things evolved.
Loom is a description logic (similar to OWL but more expressive and
pragmatic), with the usual distinction of T-Box and A-Box and a heavy
dependence on its classifier for full inference. PowerLoom uses
first-order logic + extensions as its representation language, it uses a
natural deduction system as its inference engine and is more similar to
Prolog than a description logic. It has a classifier and some
description logic features, but their use is more the exception than the
rule.
KBs written for a description logic usually look significantly different
from a FOL formulation. This is not just in syntax but also in modeling
style which relies heavily on necessary and sufficient conditions, set
operations and type and cardinality constraints. The aircraft.plm
example KB included with PowerLoom was derived from a Loom KB which you
might want to look at for some inspiration.
The Loom create function creates instances in the A-Box (possibly also
in the T-Box, I'm not a Loom expert, Tom can correct me if necessary).
There is no equivalent to "create" in PowerLoom. Objects are simply
introduced by mentioning their name in an assertion or definition.
"defconcept" creates named descriptions that describe sets or classes of
objects. In some future version we might allow concept creation simply
by assertion such as "(assert (concept city))". While you can introduce
concepts this way, you currently have to use defconcept (or defrelation)
to get all the functionality you want for named descriptions.
"print-facts" shows all assertions about a particular object. "describe"
shows its definition if it has one. If you use "print-facts" on a
concept or relation, you will see the assertions the definition created.
The concept definition you show would be translated like this:
(defconcept city (?x)
:<=> (and (location ?x)
(range-cardinality name ?x 1)
(range-cardinality population ?x 1)
(>= (population ?x) 5000)))
Since :is was used, the definition is as an if-and-only-if or
bi-implication. If :is-primitive had been used, we would have used a
:=> arrow. It basically says that any ?x that is a location, that has a
population >= 5000 and that has exactly one value for its name and
population relations is called a city (and vice versa).
The slot-cardinality restrictions (exactly N ...) are translated via the
range-cardinality idiom (even though PowerLoom's reasoning with these
cardinality restrictions is somewhat incomplete). The population
constraint was translated assuming "population" was defined as a
function which allows use of the function term syntax. If it is defined
as a relation, you would need an extra variable as in this formulation:
(defconcept city (?x)
:<=> (exists (?p)
(and (location ?x)
(range-cardinality name ?x 1)
(range-cardinality population ?x 1)
(population ?x ?p)
(>= ?p 5000))))
There is a "(translate-loom-file <loom-file> <powerloom-file>)" command
that you can play with, that translates Loom KBs into PowerLoom syntax
(as long as the Loom file is fairly vanilla and doesn't use any Lisp-isms).
Experimenting with Loom and translating to and from PowerLoom is
certainly educational, however, it might also be frustrating, since they
don't align that closely.
Hans
On 03/04/2013 02:10 PM, Philippe de Rochambeau wrote:
>
> Hello,
>
> I am currently going through the Loom 2.1 tutorial, translating the
> examples to PowerLoom 4 as a learning exercise.
>
> On page 4 of the tutorial, the author creates an object called ob-1, thus
>
> (create 'ob-1 nil)
>
> What is the difference between 'create' and 'defconcept' ?
>
> What is the equivalent of the :exactly, :at-least and :is-primitive
> parameters shown on page 5 and other pages, in Powerloom 4?
>
> Is 'print-facts' the only "modern" equivalent to 'pc' and 'pr'?
>
> How would you translate the following example to Powerloom 4?
>
> > (defconcept city :is
> (and location
> (exactly 1 name)
> (exactly 1 population)
> (>= population 5000)))
>
> Many thanks.
>
> Philippe
>
>
> *
> *
>
>
> *
> *
>
>
>
> _______________________________________________
> powerloom-forum mailing list
> [email protected]
> http://mailman.isi.edu/mailman/listinfo/powerloom-forum
--------------060307010709030808020406
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Philippe,<br>
<br>
first off, be aware that Loom and PowerLoom are quite different
animals with different representation languages and different
feature sets. PowerLoom is not intended to be a drop-in
replacement for Loom, for example. Maybe it was in its initial
conception, but things evolved. Loom is a description logic
(similar to OWL but more expressive and pragmatic), with the usual
distinction of T-Box and A-Box and a heavy dependence on its
classifier for full inference. PowerLoom uses first-order logic +
extensions as its representation language, it uses a natural
deduction system as its inference engine and is more similar to
Prolog than a description logic. It has a classifier and some
description logic features, but their use is more the exception
than the rule.<br>
<br>
KBs written for a description logic usually look significantly
different from a FOL formulation. This is not just in syntax but
also in modeling style which relies heavily on necessary and
sufficient conditions, set operations and type and cardinality
constraints. The aircraft.plm example KB included with PowerLoom
was derived from a Loom KB which you might want to look at for
some inspiration. <br>
<br>
The Loom create function creates instances in the A-Box (possibly
also in the T-Box, I'm not a Loom expert, Tom can correct me if
necessary). There is no equivalent to "create" in PowerLoom.
Objects are simply introduced by mentioning their name in an
assertion or definition. "defconcept" creates named descriptions
that describe sets or classes of objects. In some future version
we might allow concept creation simply by assertion such as
"(assert (concept city))". While you can introduce concepts this
way, you currently have to use defconcept (or defrelation) to get
all the functionality you want for named descriptions.<br>
<br>
"print-facts" shows all assertions about a particular object.
"describe" shows its definition if it has one. If you use
"print-facts" on a concept or relation, you will see the
assertions the definition created.<br>
<br>
The concept definition you show would be translated like this:<br>
<br>
<div style="margin: 0px; ">(defconcept city (?x)<br>
:<=> (and (location ?x)<br>
(range-cardinality name ?x 1) <br>
(range-cardinality population ?x 1)<br>
</div>
<div style="margin: 0px; "> (>=
(population ?x) 5000)))<br>
<br>
Since :is was used, the definition is as an if-and-only-if or
bi-implication. If :is-primitive had been used, we would have
used a :=> arrow. It basically says that any ?x that is a
location, that has a population >= 5000 and that has exactly
one value for its name and population relations is called a city
(and vice versa).<br>
<br>
The slot-cardinality restrictions (exactly N ...) are translated
via the range-cardinality idiom (even though PowerLoom's
reasoning with these cardinality restrictions is somewhat
incomplete). The population constraint was translated assuming
"population" was defined as a function which allows use of the
function term syntax. If it is defined as a relation, you would
need an extra variable as in this formulation:<br>
<br>
<div style="margin: 0px; ">(defconcept city (?x)<br>
:<=> (exists (?p)<br>
(and (location ?x)<br>
(range-cardinality name ?x 1) <br>
(range-cardinality population ?x 1)<br>
(population ?x ?p)<br>
</div>
<div style="margin: 0px; "> (>= ?p
5000))))</div>
<br>
There is a "(translate-loom-file <loom-file>
<powerloom-file>)" command that you can play with, that
translates Loom KBs into PowerLoom syntax (as long as the Loom
file is fairly vanilla and doesn't use any Lisp-isms).<br>
<br>
Experimenting with Loom and translating to and from PowerLoom is
certainly educational, however, it might also be frustrating,
since they don't align that closely.<br>
<br>
Hans<br>
</div>
<br>
On 03/04/2013 02:10 PM, Philippe de Rochambeau wrote:<br>
</div>
<blockquote cite="mid:[email protected]"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<div><br>
</div>
<div>Hello,</div>
<div><br>
</div>
<div>I am currently going through the Loom 2.1 tutorial,
translating the examples to PowerLoom 4 as a learning exercise.</div>
<div><br>
</div>
<div>On page 4 of the tutorial, the author creates an object
called ob-1, thus</div>
<div><br>
</div>
<div>
<div style="margin: 0px; ">(create 'ob-1 nil)</div>
</div>
<div style="margin: 0px; "><br>
</div>
<div style="margin: 0px; ">What is the difference between 'create'
and 'defconcept' ?</div>
<div style="margin: 0px; "><br>
</div>
<div style="margin: 0px; ">What is the equivalent of the :exactly,
:at-least and :is-primitive parameters shown on page 5 and other
pages, in Powerloom 4?</div>
<div style="margin: 0px; "><br>
</div>
<div style="margin: 0px; ">Is 'print-facts' the only "modern"
equivalent to 'pc' and 'pr'?</div>
<div style="margin: 0px; "><br>
</div>
<div style="margin: 0px; ">How would you translate the following
example to Powerloom 4?</div>
<div style="margin: 0px; "><br>
</div>
<div style="margin: 0px; ">
<div style="margin: 0px; "> > (defconcept city :is</div>
<div style="margin: 0px; ">(and location</div>
<div style="margin: 0px; ">(exactly 1 name)</div>
<div style="margin: 0px; ">(exactly 1 population)</div>
<div style="margin: 0px; ">(>= population 5000)))</div>
<div style="margin: 0px; "><br>
</div>
<div style="margin: 0px; ">Many thanks.</div>
<div style="margin: 0px; "><br>
</div>
<div style="margin: 0px; ">Philippe</div>
<div style="margin: 0px; "><br>
</div>
<div style="margin: 0px; "><br>
</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier;
"><b><br>
</b></div>
</div>
<div style="margin: 0px; "><br>
</div>
<div style="margin: 0px; "><br>
</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; "><b><br>
</b></div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; "><br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
powerloom-forum mailing list
<a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a>
<a class="moz-txt-link-freetext" href="http://mailman.isi.edu/mailman/listinfo/powerloom-forum">http://mailman.isi.edu/mailman/listinfo/powerloom-forum</a>
</pre>
</blockquote>
<br>
</body>
</html>
--------------060307010709030808020406--
--===============0707564166==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
powerloom-forum mailing list
[email protected]
http://mailman.isi.edu/mailman/listinfo/powerloom-forum
--===============0707564166==--