<!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 />
    <article-meta>
      <title-group>
        <article-title>Computational Complexity of Controlled Natural Languages (Extended abstract)</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ian Pratt-Hartmann</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Manchester</institution>
          ,
          <addr-line>Manchester M13 9PL</addr-line>
          ,
          <country country="UK">UK</country>
        </aff>
      </contrib-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        A controlled natural language is a precisely delineated fragment of some
natural language (usually English), developed for the purpose of supporting some
technical activity—such as process specification [
        <xref ref-type="bibr" rid="ref5 ref6">5, 6</xref>
        ], hardware specification [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ],
database querying [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] or data-schema specification [
        <xref ref-type="bibr" rid="ref12 ref2">2, 12</xref>
        ]. The intention is that
the controlled natural language should provide an easy-to-use interface to some
underlying logical formalism, within which certain procedures—such as
queryanswering, model-checking or determining satisfiability or entailment—can then
be executed. The question therefore arises as to how the computational
complexity of these logical procedures depends on the grammar of the controlled
natural language through which their input is channelled.
      </p>
      <p>
        In this talk, I shall investigate the complexity of determining logical
relationships within controlled natural languages featuring a variety of grammatical
constructions. The constructions considered here are largely motivated by Attempto
Controlled English [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]; however, the analysis is intended to apply to (just about)
any conceivable controlled natural language. Most of the results mentioned in
this talk have already been published elsewhere: its primary contributions are to
organize these results into a coherent framework, and to make them accessible
to the controlled natural language community.
      </p>
      <p>Formally, we take a language to be a mapping from strings (over some
alphabet) to sets of formulas (in some logic). A string mapped to a non-empty
set of formulas is a sentence of the language in question, and the formulas to
which it is mapped are the possible meanings of that sentence. In the special
case where no sentence is given more than one meaning, the logical concepts of
satisfiability and entailment carry over naturally from logic to language: a set of
sentences E is satisfiable if the formulas Φ to which they translate are satisfiable
(in the usual logical sense); and E entails a sentence e if the formula to which e
translates is entailed (in the usual logical sense) by Φ. For any language defined
in this way we may ask: what is the computational complexity of determining
satisfiability and entailment in that language? In the sequel, we provide answers
to these questions for a range of such languages.</p>
    </sec>
    <sec id="sec-2">
      <title>Languages with the copula</title>
      <p>We begin with the simplest possible controlled natural languages: those whose
sentences are all of the forms Some p is a q, Every p is a q or No p is a q. Here,
p and q are taken from a countably infinite set of count-nouns, such as artist,
beekeeper, carpenter etc. We call this this fragment of English S−. Ignoring some
minor grammatical details, S− may be defined using a semantically annotated
context-free grammar, thus:
S/λy1λy2.(y1 y2) → NP, VP
NP/λy1λy2.(y1 y2) → Det, N0
VP/λy1.y1 → is, a, N0
N0/λy1.y1 → N</p>
      <p>Det/λx1λx2.((∃ x1) x2) → some
Det/λx1λx2.((∀ x1) x2) → all
Det/λx1λx2.((∀ x1) (λx.(¬ (x2 x)))) → no</p>
      <p>N/pi → pi (i = 1, 2, . . .).</p>
      <p>The semantic annotations in the rule-heads are expressions of the simply-typed
lambda calculus with constants. We denote the type of domain objects by e
and the type {&gt;, ⊥} of truth-values by t. If τ1 and τ2 are types, then hτ1 τ2i
is the type of functions from τ1 to τ2. The symbol ∀ is the obvious logical
constant of type hhe ti hhe ti tii (similarly, mutatis mutandis, for ∃ and ¬),
and the symbols p1, p2, . . . are non-logical constants (Urelemente) of type he ti,
representing the meanings of the count nouns p1, p2, . . . . Strings are parsed in
the normal way; and during parsing, the meaning of a phrase is computed by
applying the semantic annotation on the relevant rule to the already-computed
meanings of the non-terminals on its right-hand side, in left-to-right order. It is
routine to verify that the above grammar produces (following β-reduction and
conversion to first-order syntax) the familiar first-order translations for sentences
of S−.</p>
      <p>Now define the language S to comprise all the sentences of S− together with
Some p is not a q, Every p is not a q and No p is not a q, to which it assigns the
expected meanings. (The relevant defining grammar rule is easy to formulate.)
The language S is, in effect, the language of the classical syllogistic. We can
increase expressive power further by allowing the (slightly artificial) construction
non- in noun-phrases, with the interpretation that a non-p is simply anything
which is not a p. This gives us, amongst other things, the sentence-forms Some
non-p is not a q and Every non-p is a q, which are not logically equivalent to any
S-sentences. We call this language S†.</p>
      <p>The satisfiability problem for S† is essentially the same as 2-SAT (the
satisfiability problem for propositional clauses with at most two literals). Thus, it is
routine to show:
Theorem 1. The problem of determining the satisfiability of a set of sentences
in any of the languages S−, S or S† is NlogSpace-complete.</p>
      <p>Let us consider the addition of adjectives. We define the language S−A by
augmenting the grammar rules for S− with</p>
      <p>N0/λy1λy2λx.(∧ (y1 x) (y2 x)) → A, N0
A/ai → ai,
VP/λy1.y1 → is, A
where a1, a2, . . . are adjectives, having meanings a1, a2, . . . of type he ti. Thus,
S−A includes sentences such as Every tall intelligent artist is a beekeeper or No
carpenter is tall, with adjectives taken to have intersective semantics. The languages
SA and S†A may be defined analogously, using the additional rule</p>
      <p>VP/λyλx.(¬ (y1 x)) → is, not, A.</p>
      <p>The satisfiability problem for SA is essentially the same at the satisfiability
problem for propositional Horn clauses. Thus, it is routine to show:
Theorem 2. The problem of determining the satisfiability of a set of sentences
in either of the languages S−A or SA is PTime-complete. The problem of
determining the satisfiability of a set of sentences in the language S†A is
NPTimecomplete.</p>
      <p>Next, we consider languages with relative clauses. We define S−W, SW and
S†W by adding to S−, S and S† the grammar rules</p>
      <p>N0/λy1λy2λx.(∧ (y1 x) (y2 x)) → N, which, is, a, N</p>
      <p>N0/λy1λy2λx.(∧ (y1 x) (¬ (y2 x))) → N, which, is, not, a, N.</p>
      <p>Theorem 3. The problem of determining the satisfiability of a set of sentences
in any of the languages S−W, SW or S†W is NPTime-complete.
Notice that these rules do not permit nesting of relative clauses, thus avoiding
ambiguous and unnatural noun-phrases such as artist who is not a beekeeper who
is not a carpenter. In fact, allowing embedded relative clauses does not change
the complexity results reported in Theorem 3. Adjectives can be added to these
languages as well, resulting in languages S−AW, SAW and S†AW, defined in
the (more or less) obvious way. It is easily seen that this does not increase the
complexity of satisfiability either.</p>
      <p>
        More difficult to analyse is the effect of adding numerical quantifiers. Define
the language S−Q to feature sentences of the forms At least C p are q or At most
C p are q, where C is a string of decimal digits representing a natural number;
and define SQ and S†Q analogously. (We ignore the issue of plural inflections.)
Theorem 4 ([
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]). The problem of determining the satisfiability of a set of
sentences in any of the languages S−Q, SQ or S†Q is NPTime-complete.
Adding adjectives and relative clauses to these languages can be shown not to
affect the complexity of satisfiability.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Languages with transitive verbs</title>
      <p>The languages considered so far are too trivial to be of much practical use,
since they feature no relations of arity greater than 1. Accordingly, let us define
the language R− by augmenting S− with sentences involving transitive verbs,
such as Every boy loves some girl or No boy loves no girl. Helping ourselves to a
countable set of transitive verbs r1, r2, . . . , and corresponding binary predicates
r1, r2, . . . , this can be achieved by means of the additional grammar rules</p>
      <p>We can add expressive power by allowing verb-level negation. A rough-and-ready
attempt at this would be to take the rules for S and R− together with
S/λy1λy2.(y1 y2) → NP, NegP</p>
      <p>NegP/λy1λx.(¬ (y1 x)) → does, not, VP.</p>
      <p>Let us call this language R. These rules are very leaky. For one thing, they
ignore the need for the negative polarity determiner any in No boy loves any girl;
in addition, they accept strange sentences such as No boy does not love some
girl (which is assigned the same meaning as Every boy loves some girl). However,
these details are easily corrected, and anyway have no effect on the complexity
of the satisfiability problem.</p>
      <p>
        Theorem 5 ([
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]). The problem of determining the satisfiability of a set of
sentences in either of the languages R− or R is NlogSpace-complete.
Adding the non-construction, however, produces an unexpected jump in
complexity. Let R† be the language defined in the same way as R, but allowing
‘negated’ subjects and objects of transitive verbs, such as Every non-artist
admires some non-beekeeper.
      </p>
      <p>
        Theorem 6 ([
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]). The problem of determining the satisfiability of a set of
sentences in the language R† is ExpTime-complete.
      </p>
      <p>Relative clauses have a similar effect in the presence of transitive verbs. Define
the language R−W by adding suitable rules for relative clauses to R−. Thus,
R−W contains sentences such as Every artist who admires every carpenter admires
some beekeeper. Define RW and R†W analogously.</p>
      <p>
        Theorem 7 ([
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]). The problem of determining the satisfiability of a set of
sentences in any of the languages R−W, RW or R†W is ExpTime-complete.
      </p>
      <p>Numerical quantifiers have a greater effect on the complexity of satisfiability.
Let the language R−Q be obtained by augmenting R− with numerical
quantification. Thus, R−Q contains sentences such as At most 13 artists admire at least
4 beekeepers. Define RQ and R†Q analogously.</p>
      <p>
        Theorem 8 ([
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]). The problem of determining the satisfiability of a set of
sentences in any of the languages R−Q, RQ or R†Q is NExpTime-complete.
Adding adjectives to most of the above languages involving transitive verbs can
be shown not to affect the complexity of satisfiability.
4
      </p>
    </sec>
    <sec id="sec-4">
      <title>Languages with other constructions</title>
      <p>
        Languages involving ditransitive verbs can be defined in exactly the same way
as for transitive verbs. For example, let D− is defined analogously to R−, but
admits sentences such as Every artist introduces some beekeeper to some carpenter.
Only one result has been obtained in this case:
Theorem 9 ([
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]). The problem of determining the satisfiability of a set of
sentences in the language D− is in PTime.
      </p>
      <p>
        Finally, we consider languages featuring bound-variable anaphora (subject
to various restrictions). In [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], a very simple controlled natural language
involving transitive verbs, relative clauses and restricted anaphora is presented, and
shown to have a NExpTime-complete satisfiability problem. The satisfiability
problem for the same language, but with ditransitive verbs, is shown in [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] to
be undecidable.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>I.</given-names>
            <surname>Androutsopoulos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.D.</given-names>
            <surname>Ritchie</surname>
          </string-name>
          , and
          <string-name>
            <given-names>P.</given-names>
            <surname>Thanisch</surname>
          </string-name>
          .
          <article-title>Natural language interfaces to databases-an introduction</article-title>
          .
          <source>Natural Language Engineering</source>
          ,
          <volume>1</volume>
          (
          <issue>1</issue>
          ):
          <fpage>29</fpage>
          -
          <lpage>81</lpage>
          ,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>N. E.</given-names>
            <surname>Fuchs</surname>
          </string-name>
          ,
          <string-name>
            <given-names>U.</given-names>
            <surname>Schwertel</surname>
          </string-name>
          , and
          <string-name>
            <given-names>S.</given-names>
            <surname>Torge</surname>
          </string-name>
          .
          <article-title>Controlled natural language can replace first-order logic</article-title>
          .
          <source>In 14th IEEE International Conference on Automated Software Engineering</source>
          , pages
          <fpage>295</fpage>
          -
          <lpage>298</lpage>
          . IEEE Computer Society Press,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Norbert</surname>
            <given-names>E.</given-names>
          </string-name>
          <string-name>
            <surname>Fuchs</surname>
            , Uta Schwertel, and
            <given-names>Rolf</given-names>
          </string-name>
          <string-name>
            <surname>Schwitter</surname>
          </string-name>
          .
          <article-title>Attempto Controlled English-not just another logic specification language</article-title>
          . In Pierre Flener, editor,
          <source>Logic-Based Program Synthesis and Transformation</source>
          , volume
          <volume>1559</volume>
          of Lecture Notes in Computer Science, pages
          <fpage>1</fpage>
          -
          <lpage>20</lpage>
          , Berlin, June 1999. Eighth International Workshop LOPSTR'98, Springer.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Alexander</given-names>
            <surname>Holt</surname>
          </string-name>
          and
          <string-name>
            <given-names>Ewan</given-names>
            <surname>Klein</surname>
          </string-name>
          .
          <article-title>A semantically-derived subset of English for hardware verification</article-title>
          .
          <source>In Proceedings of the 37th Annual Meeting of the Association for Computational Linguistics</source>
          , pages
          <fpage>451</fpage>
          -
          <lpage>456</lpage>
          . Association for Computational Linguistics,
          <year>June 1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Benjamin</given-names>
            <surname>Macias</surname>
          </string-name>
          and
          <string-name>
            <given-names>Stephen</given-names>
            <surname>Pulman</surname>
          </string-name>
          .
          <article-title>A method for controlling the production of specifications in natural language</article-title>
          .
          <source>The Computer Journal</source>
          ,
          <volume>38</volume>
          (
          <issue>4</issue>
          ):
          <fpage>310</fpage>
          -
          <lpage>318</lpage>
          ,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>R.</given-names>
            <surname>Nelken</surname>
          </string-name>
          and
          <string-name>
            <given-names>N.</given-names>
            <surname>Francez</surname>
          </string-name>
          .
          <article-title>Automatic translation of natural-language system specifications into temporal logic</article-title>
          .
          <source>Lecture Notes in Computer Science</source>
          ,
          <volume>1102</volume>
          :
          <fpage>360</fpage>
          -
          <lpage>371</lpage>
          ,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7. I.
          <string-name>
            <surname>Pratt-Hartmann</surname>
          </string-name>
          .
          <article-title>A two-variable fragment of English</article-title>
          .
          <source>Journal of Logic, Language and Information</source>
          ,
          <volume>12</volume>
          :
          <fpage>13</fpage>
          -
          <lpage>45</lpage>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>Ian</given-names>
            <surname>Pratt-Hartmann</surname>
          </string-name>
          .
          <article-title>Fragments of language</article-title>
          .
          <source>Journal of Logic, Language and Information</source>
          ,
          <volume>13</volume>
          :
          <fpage>207</fpage>
          -
          <lpage>223</lpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>Ian</given-names>
            <surname>Pratt-Hartmann</surname>
          </string-name>
          .
          <article-title>On the computational complexity of the numerically definite syllogistic and related logics</article-title>
          .
          <source>Bulletin of Symbolic Logic</source>
          ,
          <volume>14</volume>
          (
          <issue>1</issue>
          ):
          <fpage>1</fpage>
          -
          <lpage>28</lpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Ian</surname>
          </string-name>
          Pratt-Hartmann and Lawrence S. Moss.
          <article-title>Logics for the relational syllogistic. ArXiv preprint server</article-title>
          , http://arxiv.org/abs/0808.0521,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Ian</surname>
            Pratt-Hartmann and
            <given-names>Allan</given-names>
          </string-name>
          <string-name>
            <surname>Third</surname>
          </string-name>
          .
          <article-title>More fragments of language</article-title>
          .
          <source>Notre Dame Journal of Formal Logic</source>
          ,
          <volume>47</volume>
          (
          <issue>2</issue>
          ):
          <fpage>151</fpage>
          -
          <lpage>177</lpage>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <given-names>Sunil</given-names>
            <surname>Vadera</surname>
          </string-name>
          and
          <string-name>
            <given-names>Farid</given-names>
            <surname>Meziane</surname>
          </string-name>
          .
          <article-title>From English to formal specifications</article-title>
          .
          <source>The Computer Journal</source>
          ,
          <volume>37</volume>
          (
          <issue>9</issue>
          ):
          <fpage>753</fpage>
          -
          <lpage>763</lpage>
          ,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>