[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: A more fundamental concept than functions: units of code t

  • From: Olivier Rossel <olivier.rossel@gmail.com>
  • To: "Costello, Roger L." <costello@mitre.org>
  • Date: Tue, 18 May 2010 14:16:27 +0200

Re:  A more fundamental concept than functions: units of code t
without going into the RDF vs XML debate, i must admit the capability
of a rule engine
to enhance its original data set with business rules has definitely
made me a description-logic and inference engine fanatic.

On Tue, May 18, 2010 at 1:26 PM, Costello, Roger L. <costello@mitre.org> wrote:
> Hi Olivier,
>
> I was hoping someone would bring up rule engines. That is very exciting about a rule adding more data to the input, thus triggering other rules to fire. Wow!
>
> /Roger
>
> -----Original Message-----
> From: Olivier Rossel [mailto:olivier.rossel@gmail.com]
> Sent: Tuesday, May 18, 2010 4:28 AM
> To: Hermann Stamm-Wilbrandt
> Cc: xml-dev@lists.xml.org
> Subject: Re:  A more fundamental concept than functions: units of code that self-select
>
> self-selecting units of code are the fundament of all (forward) rules engines.
> such as drools, euler, cwm, fuxi, etc.
>
> the differences between these rules engines and xslt is the concept of
> working memory.
> the working memory is the set of data that are processed by the rule
> engine to decide which
> rules to trigger.
>
> in xslt, the working memory could be seen as the input document(s).
> with the limitation
> that the running stylesheet cannot alter its working memory (i.e the
> input document(s)).
>
> on the contrary, in rules engines, the working memory is accessible to
> the rules also in write mode.
> so rules can add data to the working memory, and these data will
> trigger other rules that add
> other data to the working memory, and so on.
>
>
> On Tue, May 18, 2010 at 10:05 AM, Hermann Stamm-Wilbrandt
> <STAMMW@de.ibm.com> wrote:
>>> Are there other programming languages that support self-selecting units
>> of code?
>> David already pointed to C++ and Java.
>>
>> Add perl, awk and even sed to that list (/regexp/ selectors).
>>
>>
>> Mit besten Gruessen / Best wishes,
>>
>> Hermann Stamm-Wilbrandt
>> Developer, XML Compiler, L3
>> WebSphere DataPower SOA Appliances
>> ----------------------------------------------------------------------
>> IBM Deutschland Research & Development GmbH
>> Vorsitzender des Aufsichtsrats: Martin Jetter
>> Geschaeftsfuehrung: Dirk Wittkopp
>> Sitz der Gesellschaft: Boeblingen
>> Registergericht: Amtsgericht Stuttgart, HRB 243294
>>
>>
>>
>>             "Costello, Roger
>>             L."
>>             <costello@m...                                          To
>>             rg>                       "xml-dev@lists.xml.org"
>>                                       <xml-dev@lists.xml.org>
>>             05/18/2010 12:27                                           cc
>>             AM
>>                                                                   Subject
>>                                        A more fundamental
>>                                       concept than functions: units of
>>                                       code that self-select
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Hi Folks,
>>
>> XSLT has xsl:template and xsl:function. On the surface they appear to be
>> the same: you invoke a template rule using xsl:apply-templates and you
>> invoke a function by dereferencing its name; you can pass parameters to
>> both; both return values.
>>
>> Clearly the idea of "function" is a fundamental concept in Computer
>> Science.
>>
>> It occurs to me that the functionality provided by template rules represent
>> an even more fundamental concept. In fact, functions are merely a subset of
>> the functionality provided by template rules.
>>
>> Allow me to explain.
>>
>> Consider these three template rules:
>>
>>    <xsl:template match="Book[Publisher lt 1970]">
>>
>>    <xsl:template match="Book[Publisher eq 1970]">
>>
>>    <xsl:template match="Book[Publisher gt 1970]">
>>
>> Suppose that Book is the context node and it has a Publisher child element
>> with value 1970. With this apply-templates:
>>
>>    <xsl:apply-templates select="." />
>>
>> the second xsl:template rule will fire. Of the three template rules, the
>> second one self-selected ("I meet the requisite conditions; I will now
>> activate myself").
>>
>> Template rules have the ability to self-select. Functions never
>> self-select. They must always be explicitly called out.
>>
>> Template rules can also be explicitly called out. Consider these revised
>> templates:
>>
>>    <xsl:template match="*" mode="pre-1970">
>>        <param name="Book" />
>>
>>    <xsl:template match="*" mode="eq-1970>
>>        <param name="Book" />
>>
>>    <xsl:template match="*" mode="post-1970">
>>        <param name="Book" />
>>
>> The second template can be explicitly called out:
>>
>>    <xsl:template select="." mode="eq="1970">
>>        <xsl:with-param name="Book" select="." />
>>
>> Each template rule is "named" using mode. Effectively the mode is used as
>> the name of the template rule.
>>
>> So template rules are units of code that can be either explicitly called
>> out, or can self-select.
>>
>> Functions are units of code that can only be explicitly called out.
>>
>> The ability to create self-selecting units of code is very powerful. It
>> resounds of decentralization, local-control, Complex Systems. Wow!
>>
>> Are there other programming languages that support self-selecting units of
>> code?
>>
>> Do you agree that self-selecting units of code represents a more
>> fundamental concept than functions?
>>
>> /Roger
>>
>>
>>
>> _______________________________________________________________________
>>
>> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
>> to support XML implementation and development. To minimize
>> spam in the archives, you must subscribe before posting.
>>
>> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
>> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
>> subscribe: xml-dev-subscribe@lists.xml.org
>> List archive: http://lists.xml.org/archives/xml-dev/
>> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>>
>>
>>
>>
>> _______________________________________________________________________
>>
>> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
>> to support XML implementation and development. To minimize
>> spam in the archives, you must subscribe before posting.
>>
>> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
>> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
>> subscribe: xml-dev-subscribe@lists.xml.org
>> List archive: http://lists.xml.org/archives/xml-dev/
>> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>>
>>
>
> _______________________________________________________________________
>
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
>
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>
>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.