Specification of Deliberation RuleML 1.02

From RuleML Wiki
Jump to: navigation, search

Authors: Harold Boley, Tara Athan, Adrian Paschke, Adrian Giurca, Nick Bassiliades, Guido Governatori, Monica Palmirani, Adam Wyner, Gen Zou

Quick links:

RuleML Families : Specification of RuleML 1.02

Prerequisites: None, Level: Semi-formal

Deliberation RuleML : Specification of Deliberation RuleML

Prerequisites: None, Level: Semi-formal

Primer : Tutorial on RuleML

Prerequisites: None, Level: Informative

Relax NG Schemas : Machine-readable grammar in the Relax NG language

Prerequisites: Relax NG, Level: Formal

MYNG : Modular sYNtax confiGurator, a GUI for customizing Relax NG schemas

Prerequisites: None, Level: Formal

XSD Schemas : Machine-readable schemas in XSD

Prerequisites: XSD, Level: Formal

Normalizer : Stylesheet for transforming into the normal-form serialization

Prerequisites: XSLT, Level: Formal

Compactifier : Stylesheet for transforming into the compact serialization

Prerequisites: XSLT, Level: Formal

Upgrader : Stylesheets for transforming from earlier versions into Version 1.02

Prerequisites: XSLT, Level: Formal

Examples : Illustrative Instances of the Version 1.02 Language

Prerequisites: Primer, Level: Informative

Glossary : Definitions of Elements and Attributes

Prerequisites: Primer, Level: Semi-formal

Content Models : Simplified XML Element and Attribute Definitions

Prerequisites: Primer, Level: Semi-formal

Schema Docs : Diagrammatic Presentation of Content Models

Prerequisites: Primer, Level: Semi-formal

Implementations : Implemented RuleML tools

Prerequisites: None, Level: Informative

This version: deliberation.ruleml.org/1.02

Current version: deliberation.ruleml.org/spec

Development version: deliberation.ruleml.org/1.03

Version history:
Date Version
2001-01-25 -

Version 0.7 HTML

2001-07-11 -

Version 0.8 HTML

2003-12-09 -

Version 0.85 HTML

2004-06-23 -

Version 0.86 HTML

2004-08-12 -

Version 0.87 HTML

2005-03-01 -

Version 0.88 HTML

2005-05-27 -

Version 0.89 HTML

2005-11-09 -

Version 0.9 HTML

2006-08-24 -

Version 0.91 HTML

2011-09-27 -

Version 0.91 Patched HTML

2012-04-03 -

Version 1.0 HTML

2012-04-03 -

Version 1.0 Wiki

2014-07-25 -

Version 1.01 Wiki

2016-06-23 -

Version 1.02 Wiki

2017-mm-dd -

Version 1.03 Wiki-dev


Copyright © RuleML Inc. 2014 - 2017 -- Licensed under the RuleML Specification License 1.0 (http://ruleml.org/licensing/RSL1.0-RuleML)


RuleML is a knowledge architecture addressing the goals of uniform representation and interchange of the major kinds of Web rules across various rule logics and platforms. RuleML has broad coverage as a system of families of languages for Web rules. This document about the Deliberation RuleML family has the goal of covering declarative rules.

This specification defines Version 1.02 of the Deliberation RuleML family within the RuleML 1.02 system, also including the Consumer RuleML and Reaction RuleML families. For a visualization of the internal structure of the Deliberation RuleML family, embedded within this system, see the left part of the first figure in RuleML 1.02.

RuleML's modular schemas permit rule interchange with high precision: RuleML's instance documents can be validated w.r.t. such schemas, e.g. w.r.t. the schema that exactly covers the intended rule expressivity. Thus, RuleML applies XML technologies for schemas and instances[1]. On top of these, it builds foundational and extended RuleML technology.

In Deliberation RuleML languages, instance documents combine (some of) the features listed in the Features section. Further, the Deliberation RuleML specification refers to relevant RuleML semantics specifications listed in the Predefined Semantic Styles section. The Deliberation RuleML specification provides a foundation for the Consumer and Reaction RuleML specifications, which both include some features of Deliberation RuleML.

The Deliberation RuleML 1.02 specification provides support for Consumer RuleML through Relax NG[2] schema modules, establishing the grammar rules for most of the features shared by Deliberation and Consumer RuleML. While the SWSL (Semantic Web Services Language)[3] subfamily as such has been removed, the most persistent features of SWSL, supporting higher-order syntax, have been retained in the Deliberation RuleML 1.02 syntax. This facilitates ongoing studies in higher-order semantics for the subfamily of Higher Order Logic (HOL), which subsumes First Order Logic (FOL) RuleML. FOL RuleML itself subsumes Derivation RuleML, which contains, e.g., the Hornlog languages and their function-free specializations, the Datalog languages.

In scope of this specification are the following items:

  • (Informative) Glossary of the language components[4]
  • Schemas in the following notations:
    • (Normative) Relax NG schemas[5], some distinguished as Relax NG anchor schemas
    • (Informative) XSD (XML Schema Definition Language)[6] anchor schemas[7], generated using Trang[8] from the Relax NG anchor schemas
  • (Informative) MYNG GUI[9] and MYNG engine[10]. MYNG is an acronym for "Modular sYNtax confiGurator", or "Modularize Your NG", and may be pronounced either "ming" or "my N G";
  • (Informative) Content models[11], in the following notations:
  • (Normative) Language Transformations (whose implementations are called Transformers) including the following:
    • Formatters from the "relaxed" Version 1.02 syntax to the "normalized" Version 1.02 syntax are specified by XSLT 2.0[14] transformations in the Normalizer directory[15].
    • Formatters from the "relaxed" Version 1.02 syntax to the "compact" Version 1.02 syntax are specified by XSLT 2.0 transformations in the Compactifier directory[16].
    • Upgraders from the "relaxed" Version 1.01 (and 1.0) syntax to Version 1.02 syntax are specified by XSLT 2.0 transformations in the Upgrader directory[17].
  • (Informative) Examples[18].

Out of scope of this specification are the following items:

  • Any schemas written as DTDs[19]. While the DTD[19] schemas of RuleML have been provided up to and including RuleML 0.85[20] (see archive), for versions later than RuleML 0.85, conversion tools (such as XMLSpy[21] and oXygen[22]) are recommended for obtaining DTDs from the newer RuleML schemas in XSD or Relax NG.
  • While the specification itself does not cover semantics, it makes use of the family-independent Predefined Semantic Styles of RuleML 1.02.
  • Tools that make use of RuleML languages, such as editors or engines. For a listing of tools for working with RuleML, see the Implementations page.
  • All Category:Enhancements_of_Deliberation_RuleML_1.02, including in regard to expressivity.

This specification is itself a component of the specification of the RuleML 1.02 System, along with the specifications of the other families and the family-independent Semantic Styles of RuleML 1.02.

The intended audience of the Deliberation RuleML specification is quite open-ended, including users who want to perform any of the following tasks:

  • Author new Deliberation RuleML instance documents
  • Author new instance documents using a syntax that incorporates Deliberation RuleML elements, such as Consumer RuleML, Reaction RuleML, or LegalRuleML
  • Validate such documents
  • Transform such documents
  • Implement reasoning engines that accept such documents

Boxed inline links (e.g. <Naf>) directly lead to glossary entries, some of which link to examples. Readers who are already familiar with Deliberation RuleML may want to refer to the Changes section. The RuleML 1.02 System as a whole is described in RuleML 1.02: Deliberation, Reaction and Consumer Families[23].

1 Overview

1.1 Deliberation RuleML Features

The Deliberation RuleML family includes the following features:

  • First-order logic (FOL), with function applications (expressions) and atomic formulas (atoms) that are n-ary with n≥0, i.e. that have "variably polyadic"[24] functions and relations (sometime called "variadic functions"[25]), optionally with name overloading ("punning"[26]) between functions, relations and individuals (see Formula, Term, Function, Relation)
  • Optional frame syntax, including object identifiers (oids), cardinality and weight qualifications, instead of or in addition to relational syntax (see <oid>, <slot>, @card, @weight)
  • Equality <Equal>, including @oriented
  • Weak negation (see <Naf>)
  • (Un)certainty degree (see <degree>)
  • IRI (Internationalized Resource Identifier)[27] symbol names with CURIE (Compact URI)[28] abbreviations (see @iri)
  • Reference to externally defined extended quantification (see @closure), signatures (see @type) and semantic styles (see @style, Predefined Semantic Styles)
  • Optional semantic variants for implications, including reasoning direction and materiality (see @direction, @material)
  • Metadata through labels and annotations (see @node, <meta>)
  • Performatives (see Performative)
  • Metalogic (see Metalogical Node)
  • Optional (syntactically) distributed representation of all constructs (see Key-Keyref and, in the Glossary, @key and @keyref)

1.2 Other Deliberation RuleML 1.02 Specification Components

A comprehensive Glossary accompanies this specification.

The grammars of Deliberation RuleML 1.02 languages are approximated by the normative lenient Deliberation RuleML Relax NG Schemas and XSD Schemas, with the exception of some restrictions that cannot easily be captured in these schema languages. All instances of a Deliberation RuleML language validate against the Relax NG schema of that language. The component Content Models of Deliberation RuleML 1.02 describes documentation of these Relax NG and XSD schemas.

2 Examples

Numerous sample RuleML documents have been prepared and maintained in the Examples directory. Some exemplify features of RuleML and are useful didactically (from the early own.ruleml example to the more recent datalogplus_min.ruleml) while others are mostly for testing purposes. The following examples are new:

Examples from previous versions of RuleML are maintained as well, e.g. 1.01 examples. Deliberation RuleML 1.02 is mostly backward compatible, so the new examples are only slightly modified from the examples of the previous version. In particular, the method of abbreviating IRIs has changed, from relative IRIs to CURIEs. The Deliberation RuleML Upgrader 1.02 was used to upgrade the Deliberation RuleML 1.01 examples to version 1.02, expanding all relative IRIs to absolute IRIs.

For viewing the examples in the exa directory, in some browsers (e.g. Firefox) one needs to view the source code (e.g. Control-U).

3 Modularization

The Deliberation RuleML Relax NG schemas use a modularization approach based on syntactic lattices. The details are given in the publication about the re-engineering of RuleML in Relax NG and the RuleML MYNG Wiki page. MYNG, RuleML's Modular sYNtax confiGurator, is accessible through a GUI or, for advanced users, a PHP script that is publicly available from the Deliberation RuleML Github repository.

The XSD schemas for Deliberation RuleML 1.02 are derived from the Relax NG schemas using Jing/Trang, and are (intentionally) not themselves modular. These monolithic XSD schemas have advantages over previous versions in that they are compatible with most XML IDEs (e.g. editors) and they validate with respect to JAXB.

4 RuleML/XML Serialization Technology

The following sections describe RuleML-specific usages of XML, which are shared across all RuleML families.

4.1 Constructs

The syntactic Constructs of RuleML languages are partitioned into the following groups:

In the XML serialization of RuleML, Node element names are upper camel-case, while the names of edge elements as well as the slot element <slot> and attributes are lower camel-case. In the RuleML documentation, the Node/edge capitalization convention is sometimes highlighted by spelling "Node" with an uppercase first letter while keeping the first letter of "edge" lowercase.

4.2 Nodes

The element names of Node indicate the class or type of entity, e.g., an atomic formula is constructed as an <Atom> Node element.

Node constructs are further partitioned into two groups:

  • Branch Nodes, which may contain another Node,
  • Leaf Nodes, which may not contain another Node.

4.3 Edges

Edge elements always occur within Node elements and always contain a single child Node element. Edge elements indicate a 'has role' relationship between the parent Node and the child Node of the edge. For example, within the <Atom> Node for an atomic formula, an operator (<op>) edge element leads to the <Rel> Node for a relation symbol.

4.3.1 Header Elements

Certain edge elements are designated as "header elements"; these are distinct from the "main elements" that form the foundation of the content model of a RuleML Node. For example, <if> and <then> are the mandatory main elements of <Implies>, indicating the premise and conclusion of the implication. An <Implies> may optionally contain a <degree> child, a header element that indicates a degree of uncertainty or fuzziness of the formula.

Header elements are always optional, are never skippable, and always precede their sibling main elements in the normalized or compact serialization. The canonical ordering of the header elements is as follows (i.e., all header elements under item 1. occur before all header elements under item 2., etc.):

  1. Foreign namespace elements, if allowed in RuleML extensions, are placed first in the canonical ordering of header elements.
  2. <meta> can occur zero or more times within any Branch Node element.
  3. <oid> is optional within any <Atom>, <Expr> and <Plex> element.
  4. <degree> is optional within any Node element that represents a logical formula, e.g. <Atom> or <Forall>.

4.4 Node-Children

In RuleML, we distinguish a certain subset of the descendants of a Node element as its "Node-children". A descendant of a Node element is a "Node-child" of it if one of the following is true:

  • The descendant is a child and a Node element.
  • The descendant is a grandchild, a Node element, and its parent is an edge element.

5 Key-Keyref for Distributed Syntax

RuleML 1.02 takes an approach similar to the XML schema key-keyref elements approach to define local (webized) unique key identifiers (@key) and key reference (@keyref) attributes on RuleML knowledge elements. As introduced in Reaction RuleML 1.0, these @key-@keyref pairs can act as primary and foreign keys used to syntactically distribute or reuse - possibly across multiple documents - constructs in a RuleML knowledge base, e.g. to separate a knowledge interface from its knowledge implementation or to compactly represent a set of rules having the same premise. Different syntactic and semantic composition operations for key-keyref can be referenced by the @style attribute. The intention is that different parts of the syntax are joined together through the key-keyref resolution mechanism by the XML parser, prior to execution by a rule engine. For additional details and examples see the Glossary entry for @key and @keyref.

As an example, consider the (2-element) set of rules that would be obtained from a semantics-preserving transformation to remove the (binary) conjunctive conclusion of the rule "if P, Q, and R, then S and T" (while the transformation would copy the premise, @key can label one premise occurrence and @keyref just refer to it from the other occurrence):

    <Implies>
      <if>
        <And key=":premise">
          <Atom><Rel>P</Rel></Atom>
          <Atom><Rel>Q</Rel></Atom>
          <Atom><Rel>R</Rel></Atom>
        </And>
      </if>
      <then>
        <Atom><Rel>S</Rel></Atom>
      </then>
    </Implies>
    <Implies>
      <if>
        <And keyref=":premise"/>
      </if>
      <then>
        <Atom><Rel>T</Rel></Atom>
      </then>
    </Implies>

As can be seen in this example, syntactically RuleML's @key attribute is similar to XML's @xml:id attribute. Note, however, that the datatype of @key is CURIE or IRI (or @@@term@@@ in Reaction RuleML) while the datatype of @xml:id is xs:ID. There is no direct XML counterpart to RuleML's @keyref attribute, although prominent XML applications such as HTML have used @href for referring to an @xml:id.

6 Attribute Mapping

As in previous versions of Deliberation RuleML, there are several pairs of attributes in Deliberation RuleML 1.02 that have names which differ only by a 'map' prefix: @closure and @mapClosure, @direction and @mapDirection, and @material and @mapMaterial. The naming convention reflects attribute 'mapping' through XML trees. There are several cases of such mappings, as follows:

  • Simple case, with one map attribute appearing on the outer node. In general,
    <NodeName mapAttribute="...">
      <NodeChildName1>. . .</NodeChildName1>
       . . .
      <NodeChildNameN>. . .</NodeChildNameN>
    </NodeName>
    

    is syntactic sugar for

    <NodeName>
      <NodeChildName1 attribute="...">. . .</NodeChildName1>
       . . .
      <NodeChildNameN attribute="...">. . .</NodeChildNameN>
    </NodeName>
    

    or, equivalently, for

    <NodeName>
      <edgeName1>
        <NodeChildName1 attribute="...">. . .</NodeChildName1>
      </edgeName1>
       . . .
      <edgeNameN>
       <NodeChildNameN attribute="...">. . .</NodeChildNameN>
      </edgeNameN>
    </NodeName>
    

    For example,

    <Rulebase mapDirection="backward">
      <Implies>. . .</Implies>
      <Implies>. . .</Implies>
    </Rulebase>
    

    is syntactic sugar for

    <Rulebase>
      <Implies direction="backward">. . .</Implies>
      <Implies direction="backward">. . .</Implies>
    </Rulebase>
    
  • Conflict case, whenever a map attribute on a Node is in conflict with a corresponding attribute that is present on a child Node element, the attribute value on the descendant element takes precedence. For example,
    <Rulebase mapDirection="backward">
      <Implies>. . .</Implies>
      <Implies direction="forward">. . .</Implies>
      <Implies>. . .</Implies>
    </Rulebase>
    

    is syntactic sugar for

    <Rulebase>
      <Implies direction="backward">. . .</Implies>
      <Implies direction="forward">. . .</Implies>
      <Implies direction="backward">. . .</Implies>
    </Rulebase>
    


    In the extreme case of conflicting attributes present on all child Node elements, we would have

    <NodeName mapAttribute="A">
      <NodeChildName1 attribute="B_1">. . .</NodeChildName1>
       . . .
      <NodeChildNameN attribute="B_N">. . .</NodeChildNameN>
    </NodeName>
    

    is logically equivalent to

    <NodeName>
      <NodeChildName1 attribute="B_1">. . .</NodeChildName1>
       . . .
      <NodeChildNameN attribute="B_N">. . .</NodeChildNameN>
    </NodeName>
    
  • For example,

    <Rulebase mapDirection="backward">
      <Implies direction="forward">. . .</Implies>
      <Implies direction="forward">. . .</Implies>
      <Implies direction="forward">. . .</Implies>
    </Rulebase>
    

    is logically equivalent to

    <Rulebase>
      <Implies direction="forward">. . .</Implies>
      <Implies direction="forward">. . .</Implies>
      <Implies direction="forward">. . .</Implies>
    </Rulebase>
    

    7 XSLT-Based Upgrader

    Continuing the practice begun in RuleML 0.86, XSLT transformations, available at http://deliberation.ruleml.org/1.02/xslt/upgrader/, have been created to automatically upgrade Version 1.01 documents to Version 1.02 (recall that the transition from Version 1.0 to Version 1.01 only involved backward-compatible changes, so no upgrader was required for that identity transformation).

    Several backward-incompatible changes were introduced in Deliberation RuleML 1.02:

    • Relative IRI references are no longer allowed in attributes (@iri, @node, and @type); either an ("absolute") IRI is used or the CURIE mechanism for abbreviation is used.
    • The @xml:base attribute is restricted to the Data element with datatype ruleml:anyURI.

    The upgrader resolves relative IRI references to IRIs using the base IRI, and removes the @xml:base attribute from elements that do not allow it in version 1.02.

    There are two different upgraders:

    • 1.02_upgrader.xslt[29] treats the values of the @type attribute as relative IRI references.
    • 1.02_upgrader_hash.xslt[30] treats these values like same-document IDs, prepending with hash before resolving as relative IRI references.

    Users may use whichever is most appropriate to their instances.

    Upgrader transformation can be accomplished using a web-based XSLT tool, Online XSLT 2.0 Service, provided by W3C. Instructions for this process can be found in Appendix 6.

    8 XSLT-Based Formatters

    A RuleML formatting transformation is an abstract-syntax (metamodel-)preserving mapping from one RuleML language to another RuleML language, both belonging to the same version. A RuleML processor, or a specification for such a processor such as an XSLT stylesheet, that implements a RuleML formatting transformation is called a RuleML formatter.

    A conforming RuleML formatter must accept as input any valid document of the input language of the formatting transformation, and generate from such input only valid documents in the output language. The abstract-syntax parse tree for the output must be the same as that of the input, provided the input belongs to the specified input language. The formatter may be applicable to other XML documents. This specification addresses formatters whose output is in distinguished restricted forms of serialization.

    Each RuleML language has at least two distinguished restricted forms of serialization: the normalized format and the compact format. For Deliberation RuleML, these forms of serialization are defined by the RNC and XSD schemas, as well as the additional constraints described in the Additional Restrictions Section. The Deliberation RuleML specification provides XSLT transformations as reference implementations of formatters into these formats.

    8.1 XSLT-Based Normalizer

    RuleML has always allowed abbreviated serialization (skipped edge tags) and some freedom in the ordering of elements. From Version 1.0 and up, Relax NG schemas allow even more freedom in element ordering than the XSD schemas, with nearly all permutations possible as long as the missing edge tags may be unambiguously reconstructed.

    XSLT stylesheets have been developed (see the Version 1.02 Normalizer directory) for normalizing the syntax used in a given Version 1.02 instance, filling in any skipped edges and sorting elements into a canonical order. An example of the normalized serialization is shown below as the output of the normalizer applied to a Datalog+ instance.

    The goals of the RuleML normalizer include the following:

    • Reconstruct all skipped edge tags to produce a fully striped form [since edge tags correspond to Resource Description Framework (RDF)[31] properties, this simplifies interoperation between RuleML/XML and directed labeled (RDF) graphs]
    • Perform canonical ordering of sibling elements [this reduces the complexity of equality comparison across RuleML/XML serializations, for both humans and machines]

    We say that using this normalizer followed by schema-based RuleML validation performs "normalidation" on RuleML instances. That is, not only are missing edge elements inserted and sibling elements sorted in the XSLT output, but this transformed instance is subsequently validated syntactically to ensure that Node and edge elements only appear in correct positions, and with permitted content. Normalidation is required when using the XSD schemas for validation of general RuleML instances, because the positional independence allowed by the relaxed serialization of the Relax NG schemas is beyond the expressivity of XSD.

    The normalizer XSLT specifies normalizing formatters that transform into the normalized serialization, which explicitly includes all skippable elements, and also has child elements sorted into a canonical order. If the input is valid against the RNC schema for the supremum (i.e. least restricted) Deliberation RuleML language, nafhologeq_relaxed.rnc, then the output of the normalizer must be valid against the RNC schema for the normalized Deliberation RuleML sublanguage, nafhologeq_normal.rnc, as well as the supremum XSD schema for the normalized serialization, nafhologeq.xsd.

    The following is a list of the operations that are performed by the reference Deliberation RuleML 1.02 Normalizer on arbitrary well-formed XML input. Note that the reference XSLT Normalizer is intended to successfully transform XML instances that may not be valid in Deliberation 1.02 (validation is the second step of the normalidation process); therefore no assumptions are made about the names or number of child elements in the instance being transformed in the operations below.

    • <Implies>, <Entails>
      • When there are two "naked Node" (a Node element that has a Node parent element) children, wrap the first within <if> edge tags, and the second within <then> edge tags.
      • Partial completion is also accepted. Example: if there is a child <if> edge element, and there is also a naked Node child element, then wrap the naked Node with the <then> edge tags.
      • Re-order the child elements, with first the Specification_of_Deliberation_RuleML_1.02#Header_Elements in the canonical order, then the main elements: <if>, followed by <then>.
    • <Expr>
      • Wrap each naked <Fun> child (if any) with an <op> edge element.
      • Wrap each remaining naked Node (if any) into <arg> edge tags.
      • Re-order the child elements, with first the #Header_Elements in the canonical order, then the main elements: positional arguments (<arg>, then <repo>), followed by slotted arguments (<slot>, then <resl>).
      • Insert any missing index attributes on <arg> elements, according to position within the sibling <arg> nodeset, and sort by index.
    • <Atom>
      • Wrap each naked <Rel> child (if any) with an <op>.
      • Wrap each remaining naked Node (if any) into <arg> edge tags.
      • Re-order the child elements, with first the #Header_Elements in the canonical order, then the main elements: positional arguments (<arg>, then <repo>), followed by slotted arguments (<slot>, then <resl>).
      • Insert any missing index attributes on <arg> elements, according to position within the sibling <arg> nodeset, and sort by index.
    • <Uniterm>
      • Wrap each naked <Rel> or <Fun> child (if any) with an <op>.
      • Wrap each remaining naked Node (if any) into <arg> edge tags.
      • Exception: if the child nodeset contains no <op>, <Rel> or <Fun> child, wrap the first naked child in <op> edge tags.
      • Re-order the child elements, with first the #Header_Elements in the canonical order, then the main elements: positional arguments (<arg>, then <repo>), followed by slotted arguments (<slot>, then <resl>).
      • Insert any missing index attributes on <arg> elements, according to position within the sibling <arg> nodeset, and sort by index.
    • <Plex>
      • Wrap each naked Node (if any) into <arg> edge tags.
      • Re-order the child elements, with first the #Header_Elements in the canonical order, then the main elements: positional arguments (<arg>, then <repo>), followed by slotted arguments (<slot>, then <resl>).
      • Insert any missing index attributes on <arg> elements, according to position within the sibling <arg> nodeset, and sort by index.
    • <Assert>, <Retract>, <Query>
      • Wrap each naked child Node (if any) with a <formula> edge tags.
      • Re-order the child elements, with first the #Header_Elements in the canonical order, then the main elements: <formula>.
    • <And>, <Or>
      • Wrap each naked child Node (if any) with a <formula> edge tags.
      • Re-order the child elements, with first the #Header_Elements in the canonical order, then the main elements: <formula>.
      • Insert any missing index attributes on <formula> elements, according to position within the sibling <formula> nodeset, and sort by index.
    • <RuleML>
      • Wrap each naked child Node (if any) with an <act> edge tags.
      • Re-order the child elements, with first the #Header_Elements in the canonical order, then the main elements: <act>.
      • Insert any missing index attributes on <act> elements, according to position within the sibling <act> nodeset, and sort by index.
    • <Neg>
      • Wrap each naked child Node (if any) with a <strong> edge tags.
      • Re-order the child elements, with first the #Header_Elements in the canonical order, then the main elements: followed by <strong>.
    • <Naf>
      • Wrap each naked child Node (if any) with a <weak> edge tags.
      • Re-order the child elements, with first the #Header_Elements in the canonical order, then the main elements: <weak>.
    • <Equal>
      • If there are two naked child Nodes, wrap first naked Node child with a <left> element and second naked Node child with <right> element.
      • Partial completion is also accepted. Example: if there is a child <left> edge element, and there is also a naked Node child element, then wrap the naked Node with the <right> edge tags.
      • Re-order the child elements, with first the #Header_Elements in the canonical order, then the main elements: <left>, followed by <right>.

    For example, the compact version of the Datalog+ example (with a focus on the manager/department rule):

    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-model href="http://deliberation.ruleml.org/1.02/relaxng/datalogplus_min_relaxed.rnc"?>
    <RuleML xmlns="http://ruleml.org/spec">
          ...
        <Assert>
          <!-- Existential Rules -->
          <!-- Every manager directs at least one department. -->
          <Forall>
            <Var>M</Var>
            <Implies>
              <if>
                <Atom>
                  <Rel>manager</Rel>
                  <Var>M</Var>
                </Atom>
              </if>
              <then>
                <Exists>
                  <Var>P</Var>
                  <Atom>
                    <Rel>directs</Rel>
                    <Var>M</Var>
                    <Var>P</Var>
                  </Atom>
                </Exists>
              </then>
            </Implies>
          </Forall>
        </Assert>  
          ...
    </RuleML>
    

    is normalized to the expanded version:

    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-model href="http://deliberation.ruleml.org/1.02/relaxng/datalogplus_min_normal.rnc"?>
    <RuleML xmlns="http://ruleml.org/spec">
            ...
        <act index="17">
          <Assert>
            <!-- Existential Rules -->
            <!-- Every manager directs at least one department. -->
            <formula>
              <Forall>
                <declare>
                  <Var>M</Var>
                </declare>
                <formula>
                  <Implies>
                    <if>
                      <Atom>
                        <op><Rel>manager</Rel></op>
                        <arg index="1"><Var>M</Var></arg>
                      </Atom>
                    </if>
                    <then>
                      <Exists>
                        <declare>
                          <Var>P</Var>
                        </declare>
                        <formula>
                          <Atom>
                            <op><Rel>directs</Rel></op>
                            <arg index="1"><Var>M</Var></arg>
                            <arg index="2"><Var>P</Var></arg>
                          </Atom>
                        </formula>
                      </Exists>
                    </then>
                  </Implies>
                </formula>
              </Forall>
            </formula>
          </Assert>
        </act>
            ...
    </RuleML>
    

    XSLT processing using the Deliberation RuleML Normalizer is accomplished in the usual way. Instructions for the W3C web-based process can be found in Appendix 6.

    RuleML processors may use engines other than XSLT to carry out normalization. The above list of operations may be treated as conformance conditions that a compliant Deliberation RuleML 1.02 normalizer is required to perform on input that is a valid Deliberation RuleML 1.02 instance. However, compliant Deliberation RuleML processors are not required to generate output for arbitrary XML input; they may fail for some or all inputs that are not valid Deliberation RuleML 1.02, but must not produce valid Deliberation RuleML 1.02 output from input that is not a valid Deliberation RuleML 1.02 instance.

    Earlier versions of the RuleML Normalizer are maintained: see RON, as well as the Normalizer section of the RuleML Specification master page.

    8.2 XSLT-Based Compactifiers

    The compactifier XSLTs specify formatters mapping into a compact serialization, which has fewer elements (i.e. is more compact) than the normalized serialization. Two variations of this formatter specification are provided due to some limitations of XSD schemas.

    1. The full compactifier specifies the removal of all skippable RuleML stripes, after first applying the normalizer to sort the child nodesets into the canonical order. If the input is valid against the RNC schema for the supremum Deliberation RuleML language, nafhologeq_relaxed, then the output must be valid against the RNC schema for the supremum compact Deliberation RuleML language, nafhologeq_compact, as well as the supremum XSD schema for the compact serialization, nafhologeq_compact.xsd.
    2. The ifthen compactifier specifies the removal of all skippable RuleML stripes except the <if> and <then> edges within <Rule> and <Implies>, after first applying the normalizer to sort the child nodesets into the canonical order. If the input is valid against the RNC schema for the supremum Deliberation RuleML language, nafhologeq_relaxed, then the output must be valid against the RNC schema for the partially-compact Deliberation RuleML sublanguage nafhologeq_ifthen-compact as well as the corresponding XSD schema, nafhologeq_ifthen-compact.xsd. Such compactifers are required for RuleML languages and extensions that have elements of the same name with different content models in the premise and conclusion of rules and implications. For this syntax to be expressible in XSD, the <if> and <then> edges cannot be skipped, since they provide disambiguating contexts for those elements with the same name (whose positional disambiguation is not sufficient for XSD).

    Earlier versions of the RuleML Compactifier are maintained: see ROC, as well as the Compactifier section of the RuleML Specification master page.

    9 Additional Restrictions

    The normative schemas in the Modularization Section are lenient due to limitations in the expressivity of the schema languages. Syntactic restrictions expressed in neither Relax NG nor XSD schemas will be specified in mathematical English as follows:

    1. IRIs occurring as attribute values, whether originally expressed as an IRI or a CURIE, are required to be fully conformant to RFC 3987[27]. In the case of CURIEs, this restriction applies after expansion to an IRI according to the prefix.
    2. In the normalized serializations, a set of sibling, identically-named, ordered edges (i.e. arg, act, and formula within And and Or) must have sequential values of @index, starting with 1 and increasing incrementally. In the relaxed serialization, this condition must be satisfied following the normalization transformation, which inserts an @index attribute in any ordered edges where the attribute is missing, with value equal to the position of the edge element in the nodeset (i.e. the list of sibling elements).
    3. The @style attribute is restricted to the root element of Deliberation RuleML documents, so as to avoid issues regarding the resolution of distributed syntax.
    4. If a Deliberation RuleML document has a (root) @style attribute, then none of its @keyref attribute values should point to an element with a @key attribute in another document having a different @style attribute value. The reason is that, because of 3., it is not possible to transfer a different @style attribute value along with the referenced content.
    5. Similarly to 4., if a Deliberation RuleML document has no (root) @style attribute, then none of its @keyref attribute values should point to an element with a @key attribute in another document having a @style attribute.


    Further optional consideration:

    1. Edges that are skipped when compactifying should not have attributes when they appear in the normalized or relaxed serialization, except in the case of an ordered edge, which may have (only) an @index attribute; otherwise, the information expressed in the attribute is lost during compactification and cannot be recovered for normalization. However, it is not always clear what edges should be considered skippable. For example, the if and then stripes of implications are considered skippable for Datalog expressivity but not for Datalog-plus, due to difficulties in expressing within XSD schemas the different content models of formulas that are allowed in the conclusion and premise of the implications. In the provided schemas, such possibly-skippable edges are optionally allowed to have attributes other than @index; implementers should take into account the target expressivity and the compactification approach when determining whether optional attributes on edges that are permitted by XSD schemas (e.g. xsi:schemaLocation) should be used.

    10 Semantic Variant Attributes

    Certain (syntactic) attributes are classified as semantic variant attributes. The most general content models for these attributes accept CURIE or IRI values, and in some cases a fixed set of enumerated values. A (propositional) example is

    <Implies material="no">
      <if><Atom><Rel>it rains</Rel></Atom></if>
      <then><Atom><Rel>the match will be cancelled</Rel></then>
    </Implies>
    <Neg><Atom><Rel>it rains</Rel></Atom></Neg>
    

    The @material attribute with value no is intended to indicate nonmaterial implication, e.g., where the assertion of an implication whose premise is known to be false carries the meaning that the conclusion would be true if the premise were true. Material implication is indicated with value yes.

    In Deliberation RuleML 1.02, the semantic variant attributes are

    11 Predefined Semantic Styles

    All semantic styles that are predefined in RuleML 1.02 are listed on the page Predefined Semantic Styles of RuleML 1.02. While predefined semantic styles are not part of any RuleML family, some predefined semantic styles that may be applied to Deliberation RuleML 1.02 instance documents are listed below. When the given IRI occurs as a value of @style, it indicates that entailments are supported as specified in the document dereferencable from that IRI.

    • Under-specified: reasoning
      This constitutes a minimal set of laws of deduction - additional entailments may also be supported by extending this profile with compatible profiles.
    • Under-specified: splittableHeadConjunction
      This profile provides two laws of deduction; one for splitting a rule whose conclusion is a conjunction, and another for joining two rules with the same premise into a single rule whose conclusion is a conjunction.
    • Semantic profile: HornPSOA-Tarski
      This profile provides fully-specified semantics for Horn logic with PSOA.
    • Semantic profile: Horn-Herbrand
      In this profile, Herbrand semantics are defined for the Horn Logic syntax.

    12 Glossary

    The Deliberation RuleML Glossary contains descriptions for every element, attribute, and syntactic category in Deliberation RuleML.

    13 Acknowledgements

    We wish to acknowledge the contributions of: Asaf Adi, Sadnan Al-Manir, Yevgen Biletskiy, Alexander Cameron, Carlos Damasio, Mike Dean, Tshering Dema, Doan Dai Duong, Andreas Eberhart, Benjamin Grosof, David Hirtle, Michael Kifer, Alex Kozlenkov, Jae Kyu Lee, François Lévy, Monika Machunik, Frank Olken, Jeff Z. Pan, Steve Ross-Talbot, Omair Shafiq, Michael Sintek, Bruce Spencer, Giorgos Stamou, Suzette Stoutenburg, Said Tabet, Le Thi Thu Thuy, Gerd Wagner, and Zhili Zhao.

    14 Appendices

    14.1 Appendix 1: Example in Deliberation RuleML 1.02

    Source: http://deliberation.ruleml.org/1.02/exa/Datalog/own_compact.ruleml

    Notes:

    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-model href="http://deliberation.ruleml.org/1.02/relaxng/datalog_relaxed.rnc"?>
    <!--<?xml-model href="http://deliberation.ruleml.org/1.02/xsd/datalog.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>-->
    <RuleML xmlns="http://ruleml.org/spec" xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://ruleml.org/spec http://deliberation.ruleml.org/1.02/xsd/datalog.xsd">
    
      <!-- start XML comment ...
        
        This example rulebase contains four rules.
        The first and second rules are implications; the third and fourth ones are facts.
        
        In English:
        
        The first rule implies that a person owns an object
        if that person buys the object from a merchant and the person keeps the object.
        
        As an OrdLab Tree:
        
        Implies~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  *                                                                            *                       
               if *                                                                       then * 
                  *                                                                            *  
                 And~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                 Atom~~~~~~~~~~~~~~~~~~
                       |                                   |                                          *     |     |  
                       |                                   |                                      op  *     |     |  
                       |                                   |                                          *     |     |    
                     Atom~~~~~~~~~~~~~~~~~~~~~~~~~~~     Atom~~~~~~~~~~~~~~~~~~                      Rel   Var   Var
                              *     |      |       |              *     |     |                       .     .     .    
                          op  *     |      |       |          op  *     |     |                       .     .     .    
                              *     |      |       |              *     |     |                       .     .     .
                             Rel   Var    Var     Var            Rel   Var   Var                     own  person object
                              .     .      .       .              .     .     . 
                              .     .      .       .              .     .     .
                              .     .      .       .              .     .     .
                             buy  person merchant object        keep  person object
      
      Note that the edges labeled as "if", "then" and "op" in the OrdLab tree
     do not appear explicitly in the compact serialization.
    
        ... end XML comment -->
    
      <Assert mapClosure="universal">
    
        <Implies>
          <!-- explicit 'And' -->
          <And>
            <Atom>
              <Rel>buy</Rel>
              <Var>person</Var>
              <Var>merchant</Var>
              <Var>object</Var>
            </Atom>
            <Atom>
              <Rel>keep</Rel>
              <Var>person</Var>
              <Var>object</Var>
            </Atom>
          </And>
          <Atom>
            <Rel>own</Rel>
            <Var>person</Var>
            <Var>object</Var>
          </Atom>
    
        </Implies>
    
        <!-- The second rule implies that a person buys an object from a merchant
      if the merchant sells the object to the person. -->
    
        <Implies>
          <Atom>
            <Rel>sell</Rel>
            <Var>merchant</Var>
            <Var>person</Var>
            <Var>object</Var>
          </Atom>
          <Atom>
            <Rel>buy</Rel>
            <Var>person</Var>
            <Var>merchant</Var>
            <Var>object</Var>
          </Atom>
        </Implies>
    
    
        <!-- The third rule is a fact that asserts that
      John sells XMLBible to Mary. -->
    
    
        <Atom>
          <Rel>sell</Rel>
          <Ind>John</Ind>
          <Ind>Mary</Ind>
          <Ind>XMLBible</Ind>
        </Atom>
    
    
        <!-- The fourth rule is a fact that asserts that
      Mary keeps XMLBible.
       
      Observe that this fact is binary - i.e., there are two arguments
      for the relation. RDF viewed as a logical knowledge representation
      is, likewise, binary, although its arguments have type restrictions,
      e.g., the first must be a resource (basically, a URI). -->
    
        <Atom>
          <Rel>keep</Rel>
          <Ind>Mary</Ind>
          <Ind>XMLBible</Ind>
        </Atom>
    
      </Assert>
    
    </RuleML>
    

    14.2 Appendix 2: Simplified Relax NG for Deliberation RuleML

    The simplified (mostly w.r.t. modularization) Relax NG schemas[12] are derived, using Jing[32], from driver schemas that include Relax NG modules to create pivot schemas corresponding to anchor Deliberation RuleML languages that together span most of the available features, up to an expressivity of first-order logic with higher-order syntax, as shown below for the normalized serialization. The simplified schemas are derived solely for the purpose of informative display in this specification, and are not intended for use in validation; the source modules[33] and the parameterized schema[34] are normative. For details of the simplification procedure, see Content Models of Deliberation RuleML 1.02.

    From: http://deliberation.ruleml.org/1.02/relaxng/nafhologeq_normal.rnc

    dc:rights [ 'Copyright 2015 RuleML Inc. -- Licensed under the RuleML Specification License, Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://ruleml.org/licensing/RSL1.0-RuleML. Disclaimer: THIS SPECIFICATION IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, ..., EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. See the License for the specifics governing permissions and limitations under the License.' ]
    dcterms:rights [ "http://ruleml.org/licensing/RSL1.0-RuleML" ]
    dcterms:relation [ "http://deliberation.ruleml.org/1.02" ]
    
    default namespace = "http://ruleml.org/spec"
    namespace ns1 = "http://www.w3.org/2001/XMLSchema-instance"
    
    start =
      RuleML
      | Assert
      | Retract
      | Query
      | Atom
      | Rel
      | And
      | Or
      | Implies
      | Forall
      | Exists
      | Expr
      | Fun
      | Rulebase
      | Entails
      | Neg
      | Naf
      | Equivalent
      | Equal
      | Data
      | Skolem
      | Reify
      | Ind
      | Var
      | Plex
      | formula
      | formula_2
      | op
      | formula_3
      | formula_4
      | then
      | if
      | declare
      | formula_5
      | formula_6
      | op_2
      | formula_7
      | then_2
      | if_2
      | degree
      | strong
      | weak
      | meta
      | torso
      | oid
      | slot
      | left
      | right
      | arg
      | resl
      | repo
    RuleML =
      element RuleML {
        (attribute node {
           xsd:string {
             pattern =
               "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
             minLength = "1"
           }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        act*
      }
    Assert =
      element Assert {
        (attribute mapMaterial {
           "yes"
           | "no"
           | xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute mapDirection {
             "bidirectional"
             | "forward"
             | "backward"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute mapClosure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        formula*
      }
    Retract =
      element Retract {
        (attribute mapMaterial {
           "yes"
           | "no"
           | xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute mapDirection {
             "bidirectional"
             | "forward"
             | "backward"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute mapClosure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        formula*
      }
    Query =
      element Query {
        (attribute mapMaterial {
           "yes"
           | "no"
           | xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute mapDirection {
             "bidirectional"
             | "forward"
             | "backward"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute closure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute mapClosure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        formula_2*
      }
    Atom =
      element Atom {
        (attribute closure {
           "universal"
           | "existential"
           | xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        oid?,
        degree?,
        op,
        arg*,
        repo?,
        slot*,
        resl?
      }
    Rel =
      element Rel {
        (attribute iri {
           xsd:string {
             pattern =
               "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
             minLength = "1"
           }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute type {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        xsd:token
      }
    And =
      element And {
        (attribute mapMaterial {
           "yes"
           | "no"
           | xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute mapDirection {
             "bidirectional"
             | "forward"
             | "backward"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute closure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute mapClosure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        degree?,
        formula_3*
      }
    Or =
      element Or {
        (attribute mapMaterial {
           "yes"
           | "no"
           | xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute mapDirection {
             "bidirectional"
             | "forward"
             | "backward"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute closure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute mapClosure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        degree?,
        formula_4*
      }
    Implies =
      element Implies {
        (attribute direction {
           "bidirectional"
           | "forward"
           | "backward"
           | xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute material {
             "yes"
             | "no"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute mapMaterial {
             "yes"
             | "no"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute mapDirection {
             "bidirectional"
             | "forward"
             | "backward"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute closure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute mapClosure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        degree?,
        if,
        then
      }
    Forall =
      element Forall {
        (attribute mapMaterial {
           "yes"
           | "no"
           | xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute mapDirection {
             "bidirectional"
             | "forward"
             | "backward"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute closure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute mapClosure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        degree?,
        declare+,
        formula_5
      }
    Exists =
      element Exists {
        (attribute mapMaterial {
           "yes"
           | "no"
           | xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute mapDirection {
             "bidirectional"
             | "forward"
             | "backward"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute closure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute mapClosure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        degree?,
        declare+,
        formula_6
      }
    Expr =
      element Expr {
        (attribute per {
           "copy"
           | "value"
           | "open"
           | xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute type {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        oid?,
        op_2,
        arg*,
        repo?,
        slot*,
        resl?
      }
    Fun =
      element Fun {
        (attribute per {
           "copy"
           | "value"
           | "open"
           | xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute val {
             "1"
             | "0.."
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute iri {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute type {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        xsd:token
      }
    Rulebase =
      element Rulebase {
        (attribute mapMaterial {
           "yes"
           | "no"
           | xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute mapDirection {
             "bidirectional"
             | "forward"
             | "backward"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute mapClosure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        formula_7*
      }
    Entails =
      element Entails {
        (attribute node {
           xsd:string {
             pattern =
               "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
             minLength = "1"
           }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        if_2,
        then_2
      }
    Neg =
      element Neg {
        (attribute mapMaterial {
           "yes"
           | "no"
           | xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute mapDirection {
             "bidirectional"
             | "forward"
             | "backward"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute closure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute mapClosure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        degree?,
        strong
      }
    Naf =
      element Naf {
        (attribute mapMaterial {
           "yes"
           | "no"
           | xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute mapDirection {
             "bidirectional"
             | "forward"
             | "backward"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute closure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute mapClosure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        degree?,
        weak
      }
    Equivalent =
      element Equivalent {
        (attribute mapMaterial {
           "yes"
           | "no"
           | xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute mapDirection {
             "bidirectional"
             | "forward"
             | "backward"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute closure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute mapClosure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        degree?,
        torso,
        torso
      }
    Equal =
      element Equal {
        (attribute oriented {
           "no"
           | "yes"
           | xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute closure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        degree?,
        left,
        right
      }
    Data =
      element Data {
        attribute node {
          xsd:string {
            pattern =
              "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
            minLength = "1"
          }
          | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
        }?
        & attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & text
        & _1*
      }
    Skolem =
      element Skolem {
        (attribute type {
           xsd:string {
             pattern =
               "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
             minLength = "1"
           }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        xsd:token
      }
    Reify =
      element Reify {
        attribute node {
          xsd:string {
            pattern =
              "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
            minLength = "1"
          }
          | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
        }?
        & attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (RuleML
           | Assert
           | Retract
           | Query
           | Atom
           | Rel
           | And
           | Or
           | Implies
           | Forall
           | Exists
           | Expr
           | Fun
           | Rulebase
           | Entails
           | Neg
           | Naf
           | Equivalent
           | Equal
           | Data
           | Skolem
           | Reify
           | Ind
           | Var
           | Plex
           | formula
           | formula_2
           | op
           | formula_3
           | formula_4
           | then
           | if
           | declare
           | formula_5
           | formula_6
           | op_2
           | formula_7
           | then_2
           | if_2
           | degree
           | strong
           | weak
           | meta
           | torso
           | oid
           | slot
           | left
           | right
           | arg
           | resl
           | repo)*
      }
    Ind =
      element Ind {
        (attribute iri {
           xsd:string {
             pattern =
               "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
             minLength = "1"
           }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute type {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        xsd:token
      }
    Var =
      element Var {
        (attribute type {
           xsd:string {
             pattern =
               "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
             minLength = "1"
           }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        xsd:token
      }
    Plex =
      element Plex {
        (attribute node {
           xsd:string {
             pattern =
               "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
             minLength = "1"
           }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        arg*,
        repo?,
        slot*,
        resl?
      }
    formula =
      element formula {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Atom
           | Uniterm
           | Equal
           | And_2
           | Or_2
           | Neg
           | Implies
           | Equivalent
           | Forall
           | Exists
           | Entails
           | Rulebase)
      }
    formula_2 =
      element formula {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Atom
           | Uniterm
           | Equal
           | And
           | Or
           | Neg
           | Naf
           | Implies
           | Equivalent
           | Forall
           | Exists
           | Entails
           | Rulebase)
      }
    op =
      element op {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Rel
           | Skolem
           | Reify
           | Const
           | Ind
           | Data
           | Var
           | Expr
           | Uniterm_2
           | Plex)
      }
    formula_3 =
      element formula {
        attribute index { xsd:positiveInteger }
        & attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Atom
           | Uniterm
           | Equal
           | And_2
           | Or_2
           | Neg
           | Naf
           | Implies
           | Equivalent
           | Forall
           | Exists)
      }
    formula_4 =
      element formula {
        attribute index { xsd:positiveInteger }
        & attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Atom
           | Uniterm
           | Equal
           | And_2
           | Or_2
           | Neg
           | Naf
           | Implies
           | Equivalent
           | Forall
           | Exists)
      }
    then =
      element then {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Atom
           | Uniterm
           | Equal
           | And_2
           | Or_2
           | Neg
           | Implies
           | Equivalent
           | Forall
           | Exists)
      }
    if =
      element if {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Atom
           | Uniterm
           | Equal
           | And_2
           | Or_2
           | Neg
           | Naf
           | Implies
           | Equivalent
           | Forall
           | Exists)
      }
    declare =
      element declare {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & Var
      }
    formula_5 =
      element formula {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Atom
           | Uniterm
           | Equal
           | And_2
           | Or_2
           | Neg
           | Implies
           | Equivalent
           | Forall
           | Exists)
      }
    formula_6 =
      element formula {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Atom
           | Uniterm
           | Equal
           | And_2
           | Or_2
           | Neg
           | Implies
           | Equivalent
           | Forall
           | Exists)
      }
    op_2 =
      element op {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Fun
           | Skolem
           | Reify
           | Const
           | Ind
           | Data
           | Var
           | Expr
           | Uniterm_2
           | Plex)
      }
    formula_7 =
      element formula {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Atom
           | Uniterm
           | Equal
           | And_2
           | Or_2
           | Neg
           | Implies
           | Equivalent
           | Forall
           | Exists)
      }
    then_2 =
      element then {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Atom
           | Uniterm
           | Equal
           | And_2
           | Or_2
           | Neg
           | Implies
           | Equivalent
           | Forall
           | Exists
           | Rulebase)
      }
    if_2 =
      element if {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Atom
           | Uniterm
           | Equal
           | And_2
           | Or_2
           | Neg
           | Implies
           | Equivalent
           | Forall
           | Exists
           | Rulebase)
      }
    degree =
      element degree {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & Data
      }
    strong =
      element strong {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Atom
           | Uniterm
           | Equal
           | And_2
           | Or_2
           | Neg
           | Implies
           | Equivalent
           | Forall
           | Exists)
      }
    weak =
      element weak {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Atom
           | Uniterm
           | Equal
           | And_2
           | Or_2
           | Neg
           | Implies
           | Equivalent
           | Forall
           | Exists)
      }
    meta =
      element meta {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Atom
           | Uniterm
           | Equal
           | And_2
           | Or_2
           | Neg
           | Implies
           | Equivalent
           | Forall
           | Exists
           | Entails
           | Rulebase)
      }
    torso =
      element torso {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Atom
           | Uniterm
           | Equal
           | And_2
           | Or_2
           | Neg
           | Implies
           | Equivalent
           | Forall
           | Exists)
      }
    oid =
      element oid {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Skolem
           | Reify
           | Const
           | Ind
           | Data
           | Var
           | Expr
           | Uniterm_2
           | Plex)
      }
    slot =
      element slot {
        (attribute card { xsd:nonNegativeInteger }?
         & attribute weight {
             xsd:decimal { minInclusive = "0.0" maxInclusive = "1.0" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        (Const | Ind | Data | Expr | Uniterm_2 | Plex),
        (Skolem
         | Reify
         | Const
         | Ind
         | Data
         | Var
         | Expr
         | Uniterm_2
         | Plex)
      }
    left =
      element left {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Skolem
           | Reify
           | Const
           | Ind
           | Data
           | Var
           | Expr
           | Uniterm_2
           | Plex)
      }
    right =
      element right {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Skolem
           | Reify
           | Const
           | Ind
           | Data
           | Var
           | Expr
           | Uniterm_2
           | Plex)
      }
    arg =
      element arg {
        (attribute index { xsd:positiveInteger }
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        (Skolem
         | Reify
         | Const
         | Ind
         | Data
         | Var
         | Expr
         | Uniterm_2
         | Plex)
      }
    resl =
      element resl {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Var | Plex_2)
      }
    repo =
      element repo {
        attribute ns1:schemaLocation { text }?
        & attribute xml:id { xsd:NCName }?
        & attribute key {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & attribute keyref {
            xsd:string {
              pattern =
                "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
              minLength = "1"
            }
            | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
          }?
        & (Var | Plex_3)
      }
    act =
      element act {
        (attribute index { xsd:positiveInteger }
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        (Assert | Retract | Query)
      }
    _1 =
      element * {
        attribute * { text }*,
        (text & _1*)
      }
    Uniterm =
      element Uniterm {
        (attribute closure {
           "universal"
           | "existential"
           | xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        oid?,
        degree?,
        op,
        arg*,
        repo?,
        slot*,
        resl?
      }
    And_2 =
      element And {
        (attribute mapMaterial {
           "yes"
           | "no"
           | xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute mapDirection {
             "bidirectional"
             | "forward"
             | "backward"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute closure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute mapClosure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        degree?,
        formula_3*
      }
    Or_2 =
      element Or {
        (attribute mapMaterial {
           "yes"
           | "no"
           | xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute mapDirection {
             "bidirectional"
             | "forward"
             | "backward"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute closure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute mapClosure {
             "universal"
             | "existential"
             | xsd:string {
                 pattern =
                   "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
                 minLength = "1"
               }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        degree?,
        formula_4*
      }
    Const =
      element Const {
        (attribute iri {
           xsd:string {
             pattern =
               "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
             minLength = "1"
           }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute type {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        xsd:token
      }
    Uniterm_2 =
      element Uniterm {
        (attribute per {
           "copy"
           | "value"
           | "open"
           | xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute node {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute type {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        oid?,
        op_2,
        arg*,
        repo?,
        slot*,
        resl?
      }
    Plex_2 =
      element Plex {
        (attribute node {
           xsd:string {
             pattern =
               "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
             minLength = "1"
           }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        slot*,
        resl?
      }
    Plex_3 =
      element Plex {
        (attribute node {
           xsd:string {
             pattern =
               "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
             minLength = "1"
           }
           | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
         }?
         & attribute ns1:schemaLocation { text }?
         & attribute xml:id { xsd:NCName }?
         & attribute key {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute keyref {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?
         & attribute style {
             xsd:string {
               pattern =
                 "(([\i-[:]][\c-[:]]*)?:)(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)"
               minLength = "1"
             }
             | xsd:string { pattern = "[\i-[:]][\c-[:]]+:.+" }
           }?),
        meta*,
        arg*,
        repo?
      }
    

    14.3 Appendix 3: Validating a RuleML Instance Against a Relax NG Schema

    For a description of an online tool that can be used to validate a RuleML instance against a Relax NG Schema, see Validating_with_Relax_NG_for_RuleML_1.02

    14.3.1 Testing of Relax NG Schemas

    The RuleML documents used to test the Relax NG schemas are available in the rnc-test-suites directory, while the Bash scripts for testing are in the bash directory. The script used to validate the rnc-test-suite documents is batch_rnc-test-suite.sh . All the scripts for testing the Relax NG schemas are designed to run offline in a clone of the Github repository, using the Jing[32] engine to validate the test documents against local copies of the Relax NG schemas. The build_rnc.sh master script executes the rnc-test-suite tests as well as the following additional tests:

    14.4 Appendix 4: Validating a RuleML Instance Against an NVDL Schema

    For a description of an online tool that can be used to validate a RuleML instance against an NVDL Schema, see Validating_with_NVDL_for_RuleML_1.02.

    14.5 Appendix 5: Instructions on Validating a RuleML Instance Online with XSD

    For a description of an online tool that can be used to validate a RuleML instance against an XSD Schema, see Validation_with_XSD_Schemas_for_RuleML_1.02.

    14.6 Appendix 6: Formatting or Upgrading RuleML Files with XSLT

    For a description of an online tool that can be used to apply an XSLT formatter to a RuleML instance, see XSLT_Processing_for_Deliberation_RuleML_1.02.

    14.7 Appendix 7: Changes

    The issues that have been resolved through the changes between Deliberation RuleML version 1.01 and 1.02 are listed at Category:Changes for Deliberation RuleML 1.02.

    Backward incompatible changes are listed at Category:Backward-Incompatible Changes for Deliberation RuleML 1.02. Constructs that may no longer appear in Deliberation RuleML 1.02 instances include the following:

    • The @xml:base attribute, except in a Data element with datatype of xsd:anyURI.
    • Relative IRI references as values of the @iri and @node attributes.
    • String values of the @type attribute that are neither a CURIE [28] nor IRI.
    • SWSL constructs other than <Const>, <Reify>, and <Uniterm>. These are
      • <Get>
      • <InstanceOf>
      • <Set>
      • <Signature>
      • <SlotProd>
      • <SubclassOf>
      • @minCard
      • @maxCard

    Backward incompatible changes of the normalized serialization include the following:

    • Explicit formula edges within <And> or <Or> that do not have an @index attribute may not appear in the normalized serialization.

    Backward incompatible changes of terminology include the following:

    • The terms "Node" and "type" were considered synonyms in earlier versions, as a category (or "type") of RuleML/XML elements. In RuleML 1.02 as a whole, the term "Node" retains this meaning, as referring to the XML syntactic component, while "type" finds a new usage in the metamodel, where each instance of a Node denotes an instance of the corresponding type. For example,
      <And>
         <Atom><Rel>P</Rel></Atom>
         <Atom><Rel>Q</Rel></Atom>
      </And>
    

    is a RuleML/XML Node which denotes a logical conjunction of two atoms. Similarly, "edge" and "role" were earlier considered synonyms, and now, as of RuleML 1.02, refer to RuleML/XML elements and their denotations, resp.

    The commits to the Deliberation RuleML Github repository during the development and review of Deliberation RuleML 1.02 are summarized in the Github Change Log.

    14.8 Appendix 8: Issues

    See Category:Errata of Deliberation RuleML 1.02 for a summary of reported errata of Deliberation RuleML 1.02, including errata of Deliberation RuleML 1.02, and errata of earlier versions of Deliberation RuleML that have not been resolved as of Version 1.02.

    See Category:Enhancements of Deliberation RuleML 1.02 for a summary of requests for enhancement of Deliberation RuleML, including enhancements of Deliberation RuleML 1.02, and enhancements of earlier versions of Deliberation RuleML that have not been resolved as of Version 1.02.

    14.8.1 Deprecation Candidates

    The role of the xml:base attribute has been greatly curtailed in Deliberation RuleML 1.02, due to the use of CURIEs rather than relative IRI references for abbreviation of IRIs (see Attribute_xml:base_Should_Be_Deprecated). This attribute is only relevant in version 1.02 for Data elements that have datatype of xsd:anyURI, as these can contain relative IRI references. Consequently, the xml:base attribute has been restricted to occur only on these relevant Data elements, which is a backward-incompatible change, as discussed in the Upgrader section. Hence, the MYNG GUI option for the xml:base attribute has little value - it could instead be combined with the option for explicit datatyping. Therefore, this GUI option is deprecated in version 1.02, but it is expected to be retained in the myng-code for advanced users as well as backward compatibility in the myng-code.

    For Deprecation Candidates of previous versions of Deliberation RuleML, see

    15 References

    1. XML Technology. Available from World Wide Web: https://www.w3.org/standards/xml/
    2. Relax NG: ISO. 2008. ISO/IEC 19757-2: Information Technology - Document Schema Definition Language (DSDL) Part 2: Regular-grammar-based validation - RELAX NG [online]. Available from World Wide Web: http://standards.iso.org/ittf/PubliclyAvailableStandards/c052348_ISO_IEC_19757-2_2008(E).zip
    3. SWSL: Semantic Web Services Language (SWSL) W3C Member Submission 9 September 2005. Available from World Wide Web: https://www.w3.org/Submission/SWSF-SWSL/
    4. Deliberation RuleML Version 1.02 Glossary: http://deliberation.ruleml.org/1.02/glossary/ Glossary
    5. Deliberation RuleML Version 1.02 Relax NG Schemas: http://deliberation.ruleml.org/1.02/relaxng/
    6. XSD: W3C XML Schema Definition Language (XSD) 1.1 Part 1: Structures W3C Recommendation 5 April 2012 https://www.w3.org/TR/xmlschema11-1/
    7. Deliberation RuleML Version 1.02 XSD Schemas: http://deliberation.ruleml.org/1.02/xsd/
    8. Trang: http://www.thaiopensource.com/relaxng/trang.html
    9. MYNG GUI: http://deliberation.ruleml.org/1.02/myng
    10. MYNG engine: https://github.com/RuleML/deliberation-ruleml/blob/1.02/relaxng/schema_rnc.php
    11. Content Models of Deliberation RuleML 1.02: http://deliberation.ruleml.org/1.02/content_models
    12. 12.0 12.1 Content models in Relax NG Compact syntax: http://deliberation.ruleml.org/1.02/simplified/
    13. Schema docs: http://deliberation.ruleml.org/1.02/doc/
    14. XSLT 2.0: XSL Transformations (XSLT) Version 2.0 W3C Recommendation 23 January 2007 https://www.w3.org/TR/xslt20/
    15. Deliberation RuleML Version 1.02 Normalizer Directory: http://deliberation.ruleml.org/1.02/xslt/normalizer/
    16. Deliberation RuleML Version 1.02 Compactifier Directory: http://deliberation.ruleml.org/1.02/xslt/compactifier/
    17. Deliberation RuleML Version 1.02 Upgrader Directory: http://deliberation.ruleml.org/1.02/xslt/upgrader/
    18. Deliberation RuleML 1.02 Examples: http://deliberation.ruleml.org/1.02/exa
    19. 19.0 19.1 DTD Specification: http://www.w3.org/XML/1998/06/xmlspec-report-19980910.htm
    20. RuleML 0.85: http://ruleml.org/0.85
    21. XMLSpy http://www.altova.com/xml-editor/
    22. oXygen http://oxygenxml.com
    23. RuleML 1.02: Deliberation, Reaction and Consumer Families http://ceur-ws.org/Vol-1417/paper6.pdf
    24. https://en.wikipedia.org/wiki/Arity#Variable_arity
    25. https://en.wikipedia.org/wiki/Variadic_function
    26. http://www.ihmc.us/users/phayes/CL/SCL2004.html
    27. 27.0 27.1 RFC 3987: https://www.ietf.org/rfc/rfc3987.txt
    28. 28.0 28.1 https://www.w3.org/TR/rdfa-syntax/#s_curies RDFa Core 1.1 - Third Edition 6. CURIE Syntax Definition
    29. Default Upgrader: http://deliberation.ruleml.org/1.02/xslt/upgrader/1.02_upgrader.xslt
    30. Upgrader with Hash-Prepending on @type: http://deliberation.ruleml.org/1.02/xslt/upgrader/1.02_upgrader_hash.xslt
    31. RDF: https://www.w3.org/RDF/
    32. 32.0 32.1 Jing: http://www.thaiopensource.com/relaxng/jing.html
    33. http://deliberation.ruleml.org/1.02/relaxng/modules/
    34. http://deliberation.ruleml.org/1.02/relaxng/schema_rnc.php


    Site Contact: Harold Boley