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

Re: Compare logical expressions with XPath/XSLT

Subject: Re: Compare logical expressions with XPath/XSLT
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 7 Mar 2019 16:11:08 -0000
Re:  Compare logical expressions with XPath/XSLT
I'm a bit confused by the sentence

{ A OR C } is not a subset of { (!A OR !B) AND !C }

because intuitively these expressions are boolean predicates, not sets.
Perhaps I should be reading "X is not a subset of Y" as "Y implies not X"?

Is this the same as (or closely related to) the boolean satisfiability problem
https://en.wikipedia.org/wiki/Boolean_satisfiability_problem ?

Would it be a good idea to focus on finding an algorithm first, and then
thinking about how to code it in XPath?

Michael Kay
Saxonica

> On 7 Mar 2019, at 15:53, Michael MC<ller-Hillebrand mmh@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Hi,
>
> I have a problem at hand that (I think) I understood on the whiteboard, but
have no initial idea how to best tackle this using our beloved tools
(currently limited to XSLT/XPath 2).
>
> We have larger objects (documents) and many child objects (chapters), and
both can have a property, let's call it "Project Name". The task is to find
conflicts between the document's and the chapter's project setting. Behind
each project name there is a configurable boolean expression using AND, OR and
NOT, which defines whether two projects may match or not.
>
> The definition of project names looks like this (with required="false"
describing the NOT logic):
>
> <defs>
>  <def name="project-1">
>    <set>
>      <AND>
>        <OR>
>          <item required="false">A</item>
>          <item required="false">B</item>
>        </OR>
>        <item required="false">C</item>
>      </AND>
>    </set>
>  </def>
>  <def name="project-2">
>    <set>
>      <OR>
>        <item required="true">A</item>
>        <item required="true">C</item>
>      </OR>
>    </set>
>  </def>
>  <def name="project-3">
>    <set>
>      <item required="false">C</item>
>    </set>
>  </def>
> </defs>
>
> If the document uses "project-1", a chapter with "project-2" would be in
conflict with project-1, because { A OR C } is not a subset of { (!A OR !B)
AND !C }.
>
> A chapter with "project-3" would be okay, because { !C } is a subset of {
(!A OR !B) AND !C }.
>
> I simply hope for some pointers to similar problems.
>
> Thanks a lot for your time,
>
> - Michael MC<ller-Hillebrand

Current Thread

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
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.