<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>ExpirationDate-&gt;phys:date</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Port Clearance Rules in PSOA RuleML: From Controlled-English Regulation to Object-Relational Logic</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Gen Zou</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Harold Boley</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Dylan Wood</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Kieran Lea</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Faculty of Computer Science, University of New Brunswick</institution>
          ,
          <addr-line>Fredericton</addr-line>
          ,
          <country country="CA">Canada</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>gen[DT]zou, harold[DT]boley, dylan[DT]wood1, kieran[DT]lea}[AT]unb[DT]ca</institution>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2020</year>
      </pub-date>
      <volume>1</volume>
      <abstract>
        <p>The Decision Management (DM) Community Challenge of March 2016 consisted of creating decision models from ten English Port Clearance Rules inspired by the International Ship and Port Facility Security Code. Based on an analysis of the moderately controlled English rules and current online solutions, we formalized the rules in PositionalSlotted, Object-Applicative (PSOA) RuleML. This resulted in: (1) a reordering, subgrouping, and explanation of the original rules on the specialized decision-model expressiveness level of (deontically contextualized) near-Datalog, non-recursive, near-deterministic, ground-queried, and non-subpredicating rules; (2) an object-relational PSOA RuleML rulebase which was complemented by facts to form a knowledge base queried in PSOATransRun for decision-making. Thus, the DM and logical formalizations get connected, which leads to generalized decision models with Hornlog, recursive, non-deterministic, non-ground-queried, and subpredicating rules.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>The English of each one of the independently given Port Clearance Rules
– as a kind of “legalese” 6 – is moderately controlled, some having a structured
‘if’ part, which supports their formalization. On the other hand, the textual
order of the rules – although logically immaterial – does not reflect their most
human-readable arrangement in the created decision models. At the time of this
writing, there are eight online solutions7, some using decision tables or decision
trees as their main modeling technique.</p>
      <p>
        Based on an analysis of the English Port Clearance Rules and several
solutions, we formalized the rules in Positional-Slotted, Object-Applicative (PSOA)
RuleML [
        <xref ref-type="bibr" rid="ref3 ref4 ref5 ref6">3–6</xref>
        ]8, complemented them by port clearance facts (data) directly in
PSOA RuleML, explored the resulting Knowledge Base (KB) with systematic
queries in PSOATransRun [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], and propose generalized decision models.
      </p>
      <p>The paper is organized as follows: Section 2 explains the basics of PSOA
RuleML as required for the subsequent sections. Section 3 describes the
formalization of the controlled English rules in PSOA RuleML. Section 4 complements
the PSOA rules by facts and demonstrates queries. Section 5 concludes the
paper. Appendix A provides the PSOA source of the entire Port Clearance KB.
2</p>
    </sec>
    <sec id="sec-2">
      <title>PSOA RuleML in a Nutshell</title>
      <p>PSOA RuleML is an object-relational Web rule language that generalizes
RIFBLD and POSL by a homogeneous integration of relationships (for composing,
e.g., SQL tables from rows) and frames (for composing, e.g., RDF graphs from
nodes &amp; outgoing labeled arcs) into positional-slotted object-applicative (psoa )
terms, for the often used single-tuple case having these forms (n 0 and k 0):9
Oidless :</p>
      <p>f(t1 : : : tn p1-&gt;v1 : : : pk-&gt;vk)
Oidful : o#f(t1 : : : tn p1-&gt;v1 : : : pk-&gt;vk)
(1)
(2)</p>
      <p>Both (1) and (2) apply a function or predicate f (acting as a relator) – in (2)
identified by an OID o via a membership, o # f, of o in f (acting as a class) – to
a tuple of arguments t1 : : : tn and to a bag of slots pj-&gt;vj, j = 1, : : : , k, each
pairing a slot name (attribute) pj with a slot filler (value) vj. An OID o typed
by the root (“universal”, “any”, ...) class f=Top is considered as untyped.</p>
      <p>
        A psoa term can be interpreted as a psoa expression, denoting an individual,
or a psoa atom, denoting a truth value, depending on whether f is a function
or predicate. A top-level psoa term is always interpreted as an atom. An
embedded psoa term is interpreted as an atom if it has the oidful form (2); else,
as an expression if it has the oidless form (1). An atomic formula containing an
embedded psoa atom can be unnested into a conjunction, as explained in [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
6 While these core rules are not meant as a law-interpretation challenge, they are rich
enough for development into a legal-informatics use case, as indicated in Section 5.
7 https://dmcommunity.org/challenge/challenge-march-2016/#Solutions
8 http://wiki.ruleml.org/index.php/PSOA_RuleML
9 We use the all-upper-case “PSOA” as a reference to the language and the
all-lowercase “psoa” for its terms. Earlier PSOA papers [
        <xref ref-type="bibr" rid="ref3 ref4 ref5 ref6">3–6</xref>
        ] show multi-tuple psoa terms.
      </p>
      <p>Constants include Top, numbers, strings, and Internationalized Resource
Identifiers (IRIs). An IRI has the full form &lt;...&gt; and can be abbreviated using a
namespace prefix ending with ‘:’, e.g., a full IRI &lt;http://ex.org/a&gt; can be
abbreviated as :a if the KB contains a declaration Prefix(: &lt;http://ex.org/&gt;)
for the prefix ‘:’. Variables in PSOA are ‘?’-prefixed names, e.g., ?x. The most
common atomic formulas are psoa atoms in the form of (1) or (2). Compound
formulas can be constructed using the Horn-like subset of First-Order Logic.</p>
      <p>A PSOA KB consists of clauses, mostly as ground facts and non-ground
rules: While facts are psoa atoms, rules are defined – within Forall wrappers
– using a Prolog-like conclusion :- condition syntax, where conclusion can be
a psoa atom and condition can be a psoa atom or an at is large and has a
validAnd-prefixed conjunction of psoa atoms.</p>
      <p>One PSOA KB can import other PSOA KBs using declarations having the
form Import(&lt;...&gt;), where &lt;...&gt; is a dereferencable IRI of an imported KB.</p>
      <p>
        The reference implementation of PSOA RuleML is the Prolog instantiation
of PSOATransRun [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]10, currently in version 1.3.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Formalizing the Port Clearance Rules in PSOA</title>
      <p>
        To arrive at a PSOA RuleML decision model for Port Clearance Rules, the
specific object-relational knowledge representation was chosen and the English Port
Clearance Rules were formalized in PSOA RuleML presentation syntax (PSOA
RuleML/PS).11 As indicated in Section 1, the original textual rule order calls
for a more human-readable version, although this entails that – to maintain the
correspondence with the original – the PSOA RuleML model’s rule numbers are
not consecutive (e.g., the original Rule 4 becomes one of the last rules in PSOA’s
textual as well as visual forms). Note that the model-theoretic semantics [
        <xref ref-type="bibr" rid="ref4 ref6">4, 6</xref>
        ] of
PSOA RuleML – not relying on rule order – is associated with the presentation
syntax rather than any decision-model visualization.12
      </p>
      <p>The PSOA RuleML decision model for Port Clearance Rules is visualized
in Fig. 1, an object-relational And-Or DAG (‘And’ branches are horizontally
cross-linked) with rule names as nodes, e.g. Rule 2, and conclusion predicates as
side labels of nodes, e.g. :MayEnterDutchPortUnloaded. For the not side-labeled
nodes Rule 9, 1&amp;5, and 4, the root-class predicate Top is understood, while slot
names, e.g. :size, and slot fillers, e.g. :small, are shown as, respectively, labels
of incoming arcs and top labels of the rule nodes (for the slot name :hull the
filler :double does not require any further rule).</p>
      <p>The blank, unlabeled node represents the only ‘Or’ branch in this model,
where Rules 8 and 7 are – operationally speaking – ‘pre-invoked’ via the
conclusion predicate :MeetsSafetyRequirementsUnloaded, having conditions with
10 http://wiki.ruleml.org/index.php/PSOA_RuleML#Prolog_Instantiation
11 See Section 5 for hints on the preliminary PSOA RuleML/XML serialization syntax.
12 While these two notions of “model” are quite unrelated, PSOA’s model theory applied
to PSOA’s Port Clearance Rules formalized in this section provides a semantics for
this decision model. Likewise, for any other decision model in PSOA RuleML.</p>
      <sec id="sec-3-1">
        <title>Rule 2 MayEnterDutchPortUnloaded</title>
        <sec id="sec-3-1-1">
          <title>Rule 3 CompliesInspectionRequirementsUnloaded</title>
          <p>HasValidCertificate
Rule
10</p>
        </sec>
      </sec>
      <sec id="sec-3-2">
        <title>MeetsSafetyRequirementsUnloaded Rule 8</title>
        <sec id="sec-3-2-1">
          <title>Rule 7 MeetsSafetyRequirementsUnloaded</title>
          <p>size
small
Rule 9
status
clean
Rule
1&amp;5
status size
large
hull</p>
          <p>double
Rule 4
a first conjunct immediately determining whether the slot :size is :small or
:large, so that only either Rule 8 or Rule 7, respectively, can be ‘fully invoked’,
causing near-deterministic behavior.</p>
          <p>
            The model is object-relational – combining frame (object-centered) and
relational representations – in that the upper part running to the conclusions
of Rules 8 and 7 involves unary relations applied to ships while the lower part
from the conditions of Rules 8 and 7 downward involves frames with ship OIDs
described by slots. Hence, the upper ‘And’ branch between Rule 10 and the blank
node corresponds to an explicit And in PSOA RuleML/PS, while the two lower
‘And’ branches between Rules 9 and 1&amp;5 as well as between Rule 1&amp;5, Rule 4
and slot :hull being :double correspond to the implicit conjunction of PSOA
RuleML slots13 (made explicit by slotribution, i.e. OID-over-slot distribution [
            <xref ref-type="bibr" rid="ref3">3</xref>
            ]).
          </p>
          <p>We now describe the rules, top-down, in five subgroups, referring to the first
half of Appendix A for the complete PSOA source.</p>
          <p>In the first subgroup of rules, the original Rule 2 is the (DAG-)root of the
decision model, passing on its ship argument to Rule 3, which conjoins the two
requirements for compliance:
2. An unloaded ship may only enter a Dutch port if the ship complies with the</p>
          <p>requirements of the Inspection for unloaded ships.
3. A ship must comply with the requirements of the Inspection for unloaded</p>
          <p>ships if the ship complies with all of the following: a) the ship meets the safety
13 We will later see that, of the conjoined slots, :size occurs directly in a :Ship frame</p>
          <p>while :status and :hull occur in its embedded :ShipHold frame.
requirements for unloaded ships; b) the ship has a certificate of registry that
is valid.</p>
          <p>In PSOA RuleML/PS, the subgroup is formalized as follows:
% Main relational rule invokes inspection rule for certificate And safety
% Object-relational certificate rule compares ship’s registry expiration with current date
While the original Rule 2’s conclusion-side word “may” – encoded in the
predicate name :MayEnterDutchPortUnloaded – creates a top-level context that
can be given a modal – specifically, a deontic – interpretation, the original
Rule 3’s conclusion-side “must” is not again encoded in the predicate name
:CompliesInspectionRequirementsUnloaded. Both rules are relational, on the
Datalog level of expressiveness (predicates only have a variable, ?s, no function
application, as their argument). The :Ship-type test for ?s is postponed to the
later object-centered rules, where :Ship becomes a class.</p>
          <p>The second subgroup consists of just the original Rule 10, which looks up
a ship’s certificate-validity date and checks whether the current date is before
that:
10. A ship’s certificate of registry must be considered valid if the date up to which</p>
          <p>the registration is valid of the certificate of registry is after the current date.</p>
          <p>In PSOA RuleML/PS, this subgroup has two formal options (local/fixed date):
As in Rule 3, the “must” is not explicitly encoded here or later on. Rule 10
transits from the relational to the object-centered paradigm: The relational
conclusion argument ?s becomes, in the first condition conjunct, the OID of class
:Ship of a query frame with a :registryExpirationDate slot, whose filler is
a date encoded as a Hornlog-expressiveness-level (constructor-)function
application phys:date(year month day) – this depth-1 nesting could be easily
eliminated, hence stays on what we refer to as the (Datalog-transformable)
nearDatalog expressiveness level.14 The second conjunct queries the current date in
that encoding, optionally yielding the local date or a fixed date.15 The third
conjunct then checks phys:lessThanDate between these dates.</p>
          <p>The third subgroup contains the complementary original Rules 8 resp. 7,
which – for :MeetsSafetyRequirementsUnloaded of small resp. large ships –
give two resp. three condition conjuncts, where the b) conjunct is shared (leading
to the DAG structure of the decision model visualized in Fig. 116):
8. A ship only meets the safety requirements for small unloaded ships if the
ship complies with all of the following: a) the ship is categorized as small; b)
the hold of the ship is clean.
7. A ship only meets the safety requirements for large unloaded ships if the
ship complies with all of the following: a) the ship is categorized as large; b)
the hold of the ship is clean; c) the hold of the ship is double hulled.</p>
          <p>In PSOA RuleML/PS, this subgroup has the following formalization:
% Object-relational size-switched safety rules check status (small) or status and hull (large)
)
)
Rules 8 and 7 each includes a disjunct of the original Rule 6, which uses two
intermediate predicates that are not needed for realizing the decision logic. Both
14 The ternary function phys:date becomes unnecessary when dividing the
slot :registryExpirationDate into three slots :registryExpirationYear,
:registryExpirationMonth, and :registryExpirationDay.
15 While for deployment the local date is computed by the phys:currentDate predicate
from the physics library, imported via http://psoa.ruleml.org/lib/phys.psoa, for
(test-suite) reproducibility a fixed date is looked up as a :currentDate ground fact.
16 For layout reasons, in the DAG visualization the b) conjunct is shown as the second
‘And’ branch of Rule 8 but as the first ‘And’ branch of Rule 7.
Rules 8 and 7 transit from the relational to the object-centered paradigm with
their frame conditions: The relational conclusion argument ?s becomes the OID
of class :Ship of a frame with :size and :hold slots, where the slot value of
:hold is an embedded frame with OID ?h of class :ShipHold and slots :status
and :clean. The :hold-embedded :ShipHold frame – corresponding to an
embedded :ShipHold function application – can be regarded as raising the
expressiveness level to Hornlog, but – being only a depth-1 nesting – can be easily
unnested, hence stays on the near-Datalog level. The nested frames of Rules
8 and 7 in PSOATransRun will be transformed into conjunctions via unnesting
followed by slotribution. For example, this is the unnesting result for Rule 7’s
condition (the two ?h occurrences are used for the referenced OID of the extracted
frame moved to the top-level and for the referencing OID in the :hold-filler
position of the main frame):
And(
?h#:ShipHold(:status-&gt;:clean :hull-&gt;:double)
?s#:Ship(:size-&gt;:large :hold-&gt;?h)
The subsequent slotribution result is as follows (all but one of the ?h and ?s
occurrences just use the root class Top):
And(</p>
          <p>And(?h#:ShipHold ?h#Top(:status-&gt;:clean) ?h#Top(:hull-&gt;:double))
And(?s#:Ship ?s#Top(:size-&gt;:large) ?s#Top(:hold-&gt;?h))</p>
          <p>The fourth subgroup includes the similar original Rules 9 resp. 4, which
determine whether a ship is small resp. large:
9. A ship must be categorized as small if the total length of the ship is less</p>
          <p>than 80 meters.
4. A ship must be categorized as large if the total length of the ship is at least</p>
          <p>80 meters.</p>
          <p>In PSOA RuleML/PS, this subgroup’s formalization is:
)
)
)
% Rule 9
Forall ?s ?l (
?s#Top(:size-&gt;:small)
:</p>
          <p>And(?s#:Ship(:totalLength-&gt;?l)</p>
          <p>math:lessThan(?l 80))
% Object-centered (except for math) rules to get qualitative size by thresholding length
Both rules are object-centered except for the relational math:lessThan and
math:greaterEq calls in their second conjuncts.17 Note that units of measure
– here, “meter” and, in Rule 5, “mg dry weight per cm” – are omitted on this
nearDatalog level of expressiveness, but could become Hornlog function applications
in slot fillers – here, :m(?l) and, in Rule 5, :mgDryWeightPerSqcm(?c).</p>
          <p>The fifth subgroup consists of the original Rules 1 and 5, where the
condition of Rule 1 negates the conclusion of Rule 5:
1. The hold of a ship must be considered clean if the hold does not contain</p>
          <p>remainders of cargo.
5. A ship’s hold contains remainders of cargo if the residual cargo measurement</p>
          <p>is higher than 0.5 mg dry weight per cm2.</p>
          <p>In PSOA RuleML/PS, this subgroup is formalized as one combined Rule 1&amp;5,
thus:
% Object-centered (except for math) rule to get qualitative status by thresholding residual
By propagating the negation into Rule 5’s condition, the negation of a
math:greaterThan call is simplified to a math:lessEq call, so that negation
is eliminated.18 The resulting Rule 1&amp;5 is again object-centered except for the
relational math:lessEq.
4</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Enrichment by Port Clearance Facts and Queries</title>
      <p>Since the March 2016 DM Community Challenge has introduced only ship rules,
we have developed ship facts for systematic testing of the rules in Section 3,
as shown in the second half of Appendix A. Each ship fact is a frame
having an OID :shipk, k = 1, 2, ..., and three slots, :registryExpirationDate,
:totalLength, and :hold. The value of the :hold slot is an embedded frame
having an OID :hk, k = 1, 2, ..., and two slots, :residualCargoMeasurement
and :hull. Following is an example of a ship fact.
17 The predicates having the math: prefix are defined in the imported mathematics
library http://psoa.ruleml.org/lib/math.psoa. They are shortcuts for external
built-in calls in PSOA.
18 Coincidentally, while for the PSOATransRun 1.3 implementation negation is
restricted to numeric disequality (math:notEq), in a future PSOATransRun a
Negation-as-failure (Naf) primitive could be mapped to the underlying Prolog’s Naf.
% Ship 7 - Yes, hold clean and double-hulled
:ship7#:Ship(:registryExpirationDate-&gt;phys:date(2020 1 1)
:totalLength-&gt;90
:hold-&gt;:h7#:ShipHold(:residualCargoMeasurement-&gt;0.4</p>
      <p>:hull-&gt;:double))</p>
      <p>The ship facts are covering all cases with qualitative slot-filler distinctions.
Each ship fact comes with a comment on whether the ship instance should be
allowed to enter a Dutch port, as of 2017-05-06, as well as the main reason.</p>
      <p>In the following, we pose representative copy&amp;paste-ready queries to the
KB and demonstrate the answers obtained by PSOATransRun. The queries that
answer Port Clearance questions such as for the DM Challenge are ground queries
using the top-level predicate :MayEnterDutchPortUnloaded applied to specific
ship instances, e.g. to :ship1 and :ship7, as shown below.
:MayEnterDutchPortUnloaded(:ship1)
No
:MayEnterDutchPortUnloaded(:ship7)
Yes</p>
      <p>We can also pose a generalized, symbolic-execution-style non-ground query to
:MayEnterDutchPortUnloaded, using output variable ?w to deduce ships that
may enter a Dutch port. Such non-ground queries can make predicates behave
non-deterministically: The multiple (here, four) ?w-answer bindings are shown
as full IRIs expanded from the ‘:’-prefixed :shipk abbreviations in the KB.19
:MayEnterDutchPortUnloaded(?w)
?w=&lt;http://psoa.ruleml.org/usecases/PortClearance#ship14&gt;
?w=&lt;http://psoa.ruleml.org/usecases/PortClearance#ship2&gt;
?w=&lt;http://psoa.ruleml.org/usecases/PortClearance#ship12&gt;
?w=&lt;http://psoa.ruleml.org/usecases/PortClearance#ship7&gt;
?w=&lt;http://psoa.ruleml.org/usecases/PortClearance#ship4&gt;</p>
      <p>The supporting computations for these top-level decision-making questions
can be revealed by specialized object-centered and relational queries. Let us thus
explore queries over the KB in a bottom-up traversal of parts of the DAG in
Fig. 1, explaining the answers obtained by PSOATransRun.</p>
      <p>We start with the object-centered-query portion of this traversal. The
following query asks whether :h7 is a ship hold and it is clean, which can be proved
by Rule 1&amp;5 and the :h7 frame embedded inside the :ship7 fact.
:h7#:ShipHold(:status-&gt;:clean)
Yes</p>
      <p>% Query centered on OID :h7
19 For queries with variable-binding results, Yes answers will be understood. Since
multiple variable-binding answers – like KB clauses – are semantically unordered,
implementations such as PSOATransRun can choose any enumeration order.</p>
      <p>Building on that, a query then asks whether the hold ?h of :ship7 is clean.
This can be proved by first binding ?h to (the expanded IRI of) the hold :h7 of
:ship7 and then check whether :h7 is clean using the previous (sub)query.
:ship7#:Ship(:hold-&gt;?h#:ShipHold(:status-&gt;:clean))
?h=&lt;http://psoa.ruleml.org/usecases/PortClearance#h7&gt;
% Main OID is :ship7</p>
      <p>The next query asks whether :ship7 is a large ship, which can be proved by
Rule 4 using its :totalLength slot in the :ship7 fact.
:ship7#:Ship(:size-&gt;:large)
Yes</p>
      <p>An extended query then asks whether :ship7 is a large ship and its hold is
clean and double hulled. The size and hold status of :ship7 have been proved
by the previous two (sub)queries while the hold-hull information can be proved
directly through the :ship7 fact.
:ship7#:Ship(:size-&gt;:large :hold-&gt;?h#:ShipHold(:status-&gt;:clean :hull-&gt;:double))
?h=&lt;http://psoa.ruleml.org/usecases/PortClearance#h7&gt;</p>
      <p>We now proceed to the relational-query portion of this traversal. The
following query asks whether :ship7 meets the safety requirements. It can be proved
by Rule 7 and the previous (sub)query.
:MeetsSafetyRequirementsUnloaded(:ship7) % Query with unary safety relator
Yes</p>
      <p>The sibling query in Fig. 1 asks whether :ship7 has a valid certificate, which
can be proved by Rule 10 based on its :registryExpirationDate slot in a fact.
% As of 2017-05-06
:HasValidCertificate(:ship7)
Yes</p>
      <p>The penultimate query of this traversal asks Whether :ship7 complies with
the requirements of the inspection for unloaded ships. It can be proved by
Rule 3 based on the previous two (sub)queries.
:CompliesInspectionRequirementsUnloaded(:ship7)
Yes
% As of 2017-05-06</p>
      <p>The top-level query :MayEnterDutchPortUnloaded(:ship7) can now be
proved by Rule 2 and the previous (sub)query.</p>
      <p>Next we explore some non-ground queries that can extract interesting content
from the KB.</p>
      <p>The following query asks for the :size of :ship1.</p>
      <p>The subsequent query asks for any large ship whose hold is clean. Here, the
stand-alone ‘?’ is an (anonymous) variable whose bindings are not needed.
?s#:Ship(:size-&gt;:large :hold-&gt;?#:ShipHold(:status-&gt;:clean))
?s=&lt;http://psoa.ruleml.org/usecases/PortClearance#ship7&gt;
?s=&lt;http://psoa.ruleml.org/usecases/PortClearance#ship13&gt;
?s=&lt;http://psoa.ruleml.org/usecases/PortClearance#ship10&gt;
?s=&lt;http://psoa.ruleml.org/usecases/PortClearance#ship14&gt;
?s=&lt;http://psoa.ruleml.org/usecases/PortClearance#ship6&gt;</p>
      <p>The next query asks for any ship that is large and has a valid certificate.
:HasValidCertificate(?s#:Ship(:size-&gt;:large))
?s=&lt;http://psoa.ruleml.org/usecases/PortClearance#ship5&gt;
?s=&lt;http://psoa.ruleml.org/usecases/PortClearance#ship14&gt;
?s=&lt;http://psoa.ruleml.org/usecases/PortClearance#ship6&gt;
?s=&lt;http://psoa.ruleml.org/usecases/PortClearance#ship9&gt;
?s=&lt;http://psoa.ruleml.org/usecases/PortClearance#ship13&gt;
?s=&lt;http://psoa.ruleml.org/usecases/PortClearance#ship7&gt;</p>
      <p>The final query asks for any ship that is small and meets the safety
requirements for unloaded ships.
:MeetsSafetyRequirementsUnloaded(?s#:Ship(:size-&gt;:small))
?s=&lt;http://psoa.ruleml.org/usecases/PortClearance#ship4&gt;
?s=&lt;http://psoa.ruleml.org/usecases/PortClearance#ship1&gt;
?s=&lt;http://psoa.ruleml.org/usecases/PortClearance#ship12&gt;
?s=&lt;http://psoa.ruleml.org/usecases/PortClearance#ship2&gt;
5</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusions</title>
      <p>
        In this paper, we have demonstrated the formalization of moderately controlled
English rules and a corresponding decision model as part of a logical KB. This
prepares the automation of such formalizations as well as enabling formal query,
proof, analysis, and translation. The Port Clearance Rules have already
progressed from a DM Challenge to a use case for comparing DM systems. With
their formalization in PSOA RuleML, they are also turning into a use case for
logical (e.g., object-relational) systems and for the interoperation between both
kinds of systems. This PSOA RuleML formalization of a DM Challenge, along
with Semantic DMN [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], can thus initiate Semantic Decision Rules.
      </p>
      <p>
        Since the original Port Clearance Rules were developed independently, the use
case provides extra evidence that PSOA RuleML is well-suited to capture
realworld problems and PSOATransRun is well-suited for KB development. While
this paper uses integrated object-relational modeling, the original English rules
are amenable also to purely object-centered modeling and to purely relational
modeling, where these paradigms are bridged within the PSOA language [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
Generalizations for Hornlog, non-deterministic, and non-ground-queried KBs
for advanced modeling have already been indicated earlier. Here are examples
for the other two generalizations: Recursion can realize the transitive closure,
:navigates, over a :connects base predicate, for ships finding an inspection
pier.20 Subpredicating, via PSOA’s ‘##’ infix, can taxonomically differentiate the
class :Ship into :ShipUnloaded vs. :ShipLoaded for precise semantic modeling.
      </p>
      <p>
        Future work includes the interchange of presentation-syntax and (XML-)
serialization formats of DM systems such as OpenRules21 – e.g. via the OMG
Decision Model and Notation (DMN)22 – with PSOA RuleML. For XML-based
interchange, PSOA RuleML already has a preliminary serialization, which will be
formally defined in Relax NG.23 One direction of interoperation can build on the
translator from DMN decision tables to RuleML [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. While Fig. 1 visualizes rules
only, a proof-explanation facility could be added to the PSOATransRun
environment which provides visualization, presentation, and serialization formats for
queries reduced, via rules, to facts, building on, e.g., Grailog24 and VProofH [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ].
Because of their relevance to (e.g., harbor-security) laws, extensions of the Port
Clearance Rules – including for loaded ships – should be of interest, e.g. as part of
legal-informatics efforts such as OASIS LegalRuleML25 and Stanford CodeX26.
6
      </p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgements</title>
      <p>We thank Jacob Feldman for pointing us to the DM Challenges, for hints about
the evolution of The Game of Rules / Port Clearance Rules, and for
encouraging better integration of business rule products and semantic rule products.
Moreover, we thank the organizers of the International Rule Challenge 2017 for
holding this event, and its reviewers for valuable comments.
20 Further exemplifying non-determinism, in case an inspection pier turns out to be
unavailable, backtracking as in the Prolog-targeting PSOATransRun instantiation
PSOATransRun[PSOA2Prolog,XSBProlog] can search for other inspection piers.
21 http://openrules.com
22 http://www.omg.org/spec/DMN
23 http://wiki.ruleml.org/index.php/PSOA_RuleML#Syntax
24 http://wiki.ruleml.org/index.php/Grailog
25 https://www.oasis-open.org/committees/legalruleml
26 https://law.stanford.edu/codex-the-stanford-center-for-legal-informatics/</p>
    </sec>
    <sec id="sec-7">
      <title>Port Clearance KB in PSOA RuleML</title>
      <p>Document (</p>
      <p>Prefix(: &lt;http://psoa.ruleml.org/usecases/PortClearance#&gt;)
Prefix(math: &lt;http://psoa.ruleml.org/lib/math#&gt;)
Prefix(phys: &lt;http://psoa.ruleml.org/lib/phys#&gt;)
Import(&lt;http://psoa.ruleml.org/lib/math.psoa&gt;)</p>
      <p>Import(&lt;http://psoa.ruleml.org/lib/phys.psoa&gt;)
Group (
% Port Clearance Knowledge Base
% Version: 2017-06-08
% Copy&amp;paste-ready KB file in presentation syntax (PSOA RuleML/PS):
% http://psoa.ruleml.org/usecases/PortClearance/PortClearance.psoa
% To be complemented by KB file in serialization syntax (PSOA RuleML/XML):
% http://psoa.ruleml.org/usecases/PortClearance/PortClearance.ruleml
% PSOA RuleML/PS can be directly used as a PSOATransRun input file:
% http://wiki.ruleml.org/index.php/PSOA_RuleML#PSOATransRun (Current Release)
% Reordering, subgrouping, and explaining the rules from
% https://dmcommunity.org/challenge/challenge-march-2016/
% Main relational rule invokes inspection rule for certificate And safety
% Object-relational certificate rule compares ship’s registry expiration with current date
% Object-relational size-switched safety rules check status (small) or status and hull (large)
% Object-centered (except for math) rules to get qualitative size by thresholding length
% Rule 4
Forall ?s ?l (
?s#Top(:size-&gt;:large)
:</p>
      <p>And(?s#:Ship(:totalLength-&gt;?l)</p>
      <p>math:greaterEq(?l 80))
% Rule 1&amp;5 (combines Rule 1 and Rule 5)
Forall ?h ?c (
?h#Top(:status-&gt;:clean)
:</p>
      <p>And(?h#:ShipHold(:residualCargoMeasurement-&gt;?c)</p>
      <p>math:lessEq(?c 0.5))
% Object-centered (except for math) rule to get qualitative status by thresholding residual
:currentDate(phys:date(2017 5 6))</p>
      <p>% Uncomment for fixed date (reproducibility)
% Ship facts (No or Yes refer to answers for queries, as of 2017-05-06, with :ship1, :ship2, ... as arguments)
% Facts covering all cases with qualitative slot-filler distinctions
% Explanatory comments for Yes answers focus on the most relevant slots
% Distinction for :registryExpirationDate
% Ship 1 - No, registry has expired
:ship1#:Ship(:registryExpirationDate-&gt;phys:date(2017 5 1)
:totalLength-&gt;20
:hold-&gt;:h1#:ShipHold(:residualCargoMeasurement-&gt;0.2</p>
      <p>:hull-&gt;:single))
% Ship 2 - Yes, registry is valid
:ship2#:Ship(:registryExpirationDate-&gt;phys:date(2017 10 1)
:totalLength-&gt;20
:hold-&gt;:h2#:ShipHold(:residualCargoMeasurement-&gt;0.2</p>
      <p>:hull-&gt;:single))
% Distinction for :residualCargoMeasurement
% Ship 3 - No, hold not clean
:ship3#:Ship(:registryExpirationDate-&gt;phys:date(2020 1 1)
:totalLength-&gt;70
:hold-&gt;:h3#:ShipHold(:residualCargoMeasurement-&gt;0.6</p>
      <p>:hull-&gt;:single))
% Distinctions for :residualCargoMeasurement and :hull
% Ship 5 - No, hold not clean
:ship5#:Ship(:registryExpirationDate-&gt;phys:date(2020 1 1)
:totalLength-&gt;90
:hold-&gt;:h5#:ShipHold(:residualCargoMeasurement-&gt;0.6</p>
      <p>:hull-&gt;:double))
% Ship 6 - No, size large yet hold single-hulled
:ship6#:Ship(:registryExpirationDate-&gt;phys:date(2020 1 1)
:totalLength-&gt;90
:hold-&gt;:h6#:ShipHold(:residualCargoMeasurement-&gt;0.4</p>
      <p>:hull-&gt;:single))
% Facts with multiple reasons for No or Yes
% Three reasons for No
% Ship 8 - No, registry expired, hold not clean, and size large yet hold single-hulled
:ship8#:Ship(:registryExpirationDate-&gt;phys:date(2017 1 1)
:totalLength-&gt;90
:hold-&gt;:h8#:ShipHold(:residualCargoMeasurement-&gt;0.9</p>
      <p>:hull-&gt;:single))
% Ship 9 - No, hold not clean and size large yet hold single-hulled
:ship9#:Ship(:registryExpirationDate-&gt;phys:date(2018 1 1)
:totalLength-&gt;90
:hold-&gt;:h9#:ShipHold(:residualCargoMeasurement-&gt;0.9</p>
      <p>:hull-&gt;:single))
% Ship 10 - No, registry expired and size large yet hold single-hulled
:ship10#:Ship(:registryExpirationDate-&gt;phys:date(2017 1 1)
:totalLength-&gt;90
:hold-&gt;:h10#:ShipHold(:residualCargoMeasurement-&gt;0.2</p>
      <p>:hull-&gt;:single))
% Ship 11 - No, registry expired and hold not clean
:ship11#:Ship(:registryExpirationDate-&gt;phys:date(2017 1 1)
:totalLength-&gt;90
:hold-&gt;:h11#:ShipHold(:residualCargoMeasurement-&gt;0.9</p>
      <p>:hull-&gt;:double))
% Two reasons for Yes
% Ship 12 - Yes, size small nevertheless hold double-hulled
:ship12#:Ship(:registryExpirationDate-&gt;phys:date(2020 1 1)
:totalLength-&gt;60
:hold-&gt;:h12#:ShipHold(:residualCargoMeasurement-&gt;0.1</p>
      <p>:hull-&gt;:double))
% Facts probing special cases
% Ship 13 - No, large ship must have some (a double) hull
:ship13#:Ship(:registryExpirationDate-&gt;phys:date(2020 1 1)
:totalLength-&gt;120
:hold-&gt;:h13#:ShipHold(:residualCargoMeasurement-&gt;0.2))
% Ship 14 - Yes, date, length, and measurement are at the threshold
:ship14#:Ship(:registryExpirationDate-&gt;phys:date(2017 5 7)
:totalLength-&gt;80
:hold-&gt;:h14#:ShipHold(:residualCargoMeasurement-&gt;0.5
:hull-&gt;:double))</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Tylkowski</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Müller</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Experiences Using Deliberation RuleML 1.01 as Rule Interchange Language: Do Rulebases Need an External Vocabulary</article-title>
          ? In Patkos, T.,
          <string-name>
            <surname>Wyner</surname>
            ,
            <given-names>A.Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Giurca</surname>
          </string-name>
          , A., eds.
          <source>: Proceedings of the RuleML</source>
          <year>2014</year>
          <article-title>Challenge and the RuleML 2014 Doctoral Consortium hosted by the 8th International Web Rule Symposium</article-title>
          , Challenge+DC@RuleML
          <year>2014</year>
          , Prague, Czech Republic,
          <source>August 18-20</source>
          ,
          <year>2014</year>
          . Volume 1211 of CEUR Workshop Proceedings., CEUR-WS.org (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Spreeuwenberg</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bouvy</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zoet</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          : Het spel met de regels.
          <source>Uitgave van BRPN, ISBN 978-90-815568-2-8</source>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Boley</surname>
          </string-name>
          , H.:
          <article-title>A RIF-Style Semantics for RuleML-Integrated Positional-Slotted, ObjectApplicative Rules</article-title>
          .
          <source>In: Proc. 5th International Symposium on Rules: Research Based and Industry Focused (RuleML-2011 Europe)</source>
          ,
          <source>Barcelona, Spain. Lecture Notes in Computer Science</source>
          , Springer (July
          <year>2011</year>
          )
          <fpage>194</fpage>
          -
          <lpage>211</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Boley</surname>
          </string-name>
          , H.:
          <article-title>PSOA RuleML: Integrated Object-Relational Data and Rules</article-title>
          . In Faber, W.,
          <string-name>
            <surname>Paschke</surname>
          </string-name>
          , A., eds.
          <source>: Reasoning Web. Web Logic Rules (RuleML</source>
          <year>2015</year>
          )
          <article-title>-</article-title>
          11th
          <source>Int'l Summer School</source>
          <year>2015</year>
          , Berlin, Germany,
          <source>July 31- August 4</source>
          ,
          <year>2015</year>
          ,
          <string-name>
            <given-names>Tutorial</given-names>
            <surname>Lectures</surname>
          </string-name>
          . Volume
          <volume>9203</volume>
          of LNCS., Springer (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Zou</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Boley</surname>
          </string-name>
          , H.:
          <article-title>PSOA2Prolog: Object-Relational Rule Interoperation and Implementation by Translation from PSOA RuleML to ISO Prolog</article-title>
          .
          <source>In: Proc. 9th International Web Rule Symposium (RuleML</source>
          <year>2015</year>
          ), Berlin, Germany. Lecture Notes in Computer Science, Springer (
          <year>August 2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Zou</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Boley</surname>
          </string-name>
          , H.:
          <article-title>Minimal Objectification and Maximal Unnesting in PSOA RuleML</article-title>
          . In Alferes,
          <string-name>
            <given-names>J.J.</given-names>
            ,
            <surname>Bertossi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.E.</given-names>
            ,
            <surname>Governatori</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            ,
            <surname>Fodor</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            ,
            <surname>Roman</surname>
          </string-name>
          , D., eds.: Rule Technologies. Research, Tools, and Applications - 10th
          <source>International Symposium, RuleML</source>
          <year>2016</year>
          ,
          <string-name>
            <surname>Stony</surname>
            <given-names>Brook</given-names>
          </string-name>
          ,
          <string-name>
            <surname>NY</surname>
          </string-name>
          , USA, July 6-
          <issue>9</issue>
          ,
          <year>2016</year>
          . Proceedings. Volume
          <volume>9718</volume>
          of Lecture Notes in Computer Science., Springer (
          <year>2016</year>
          )
          <fpage>130</fpage>
          -
          <lpage>147</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Calvanese</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dumas</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Maggi</surname>
            ,
            <given-names>F.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Montali</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <string-name>
            <surname>Semantic</surname>
            <given-names>DMN</given-names>
          </string-name>
          :
          <article-title>Formalizing Decision Models with Domain Knowledge</article-title>
          .
          <source>In: Proc. International Joint Conference on Rules and Reasoning (RuleML+RR</source>
          <year>2017</year>
          ), London, UK. Volume
          <volume>10364</volume>
          of Lecture Notes in Computer Science., Springer (July
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Paschke</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Könnecke</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          : RuleML
          <string-name>
            <surname>- DMN Translator</surname>
          </string-name>
          . In Athan, T.,
          <string-name>
            <surname>Giurca</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grütter</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Proctor</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Teymourian</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Woensel</surname>
          </string-name>
          , W.V., eds.:
          <source>Supplementary Proceedings of the RuleML 2016 Challenge</source>
          ,
          <article-title>Doctoral Consortium and Industry Track hosted by the 10th International Web Rule Symposium</article-title>
          ,
          <source>RuleML</source>
          <year>2016</year>
          , New York, USA, July 6-
          <issue>9</issue>
          ,
          <year>2016</year>
          . Volume 1620 of CEUR Workshop Proceedings., CEURWS.org (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Kontopoulos</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bassiliades</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Antoniou</surname>
          </string-name>
          , G.:
          <article-title>Visualizing Semantic Web Proofs of Defeasible Logic in the DR-DEVICE System</article-title>
          .
          <source>Knowledge-Based Systems 24(3)</source>
          (
          <year>2011</year>
          )
          <fpage>406</fpage>
          -
          <lpage>419</lpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>