<!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>Towards Translating Natural Language Sentences into ASP</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Stefania Costantini</string-name>
          <email>stefania.costantini@univaq.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Alessio Paolucci</string-name>
          <email>alessio.paolucci@univaq.it</email>
          <email>u@X</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Dip. di Informatica, Universitaμ di L'Aquila</institution>
          ,
          <addr-line>Coppito 67100, L'Aquila</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>We build upon recent work by Baral, Dzifcak and Son that de¯ne the translation into ASP of (some classes of) natural language sentences from the lambda-calculus intermediate format generated by CCG grammars. We introduce automatic generation of lambda-calculus expressions from template ones, thus improving the e®ectiveness and generality of the translation process.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Many intelligent systems have to deal with knowledge expressed in natural
language, either extracted from books, web pages and documents in general, or
expressed by human users. Knowledge acquisition from these sources is a
challenging matter, and many attempts are presently under way towards automatically
translating natural language sentences into an appropriate knowledge
representation formalism [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. The selection of a suitable formalism plays an important
role but ¯rst-order logic, that would under many respects represent a natural
choice, is actually not appropriate for expressing various kinds of knowledge, i.e.,
for dealing with default statements, normative statements with exceptions, etc.
Recent work has investigated the usability of non-monotonic logics, like Answer
Set Programming (ASP)[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>
        The so-called Web 3.0 [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ][
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], despite its de¯nition is not well-established
yet, makes the important assumption that applications should accept knowledge
expressed in a human-like form, transform it into a machine processable form
and take this step as the basis for semantic applications. This bears a similarity
with the Semantic Web objectives [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], though Web 3.0 is a much wider vision,
where arti¯cial intelligence techniques play a central role. Also in the Semantic
Web scenario however, automatically extracting semantic information from web
pages or text documents requires to deal with natural language processing, and
requires forms of reasoning.
      </p>
      <p>
        Translating natural language sentences into a logic knowledge representation
is a key point on the applications side as well. In fact, designing applications
such as semantic search engines implies obtaining a machine-processable form
of the extracted knowledge that makes it possible to perform reasoning on the
data so as to suitably answer (possibly in natural language) to the user's queries,
as such an engine should interact with the user like a personal agent. We have
practically demonstrated in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] that for extracting semantic information from a
large dataset like Wikipedia, a reasoning process on the data is needed, e.g., for
semantic disambiguation of concepts.
      </p>
      <p>
        A central aspect of knowledge acquisition is related to the automation of
the process. Recent work in this direction has been presented in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
In our opinion, the latter represents a signi¯cant advancement towards
automatic translation of natural language sentences into a knowledge representation
format that allows for automated reasoning. This works outlines a method for
translating natural language sentences into ASP, so as to be able to reason on
the extracted knowledge. In [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], the authors try in particular to take
into account sentences de¯ning uncertain and defeasible knowledge. In this
paper, we extend their approach by introducing a new more abstract intermediate
representation to be instantiated on practical cases.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Background</title>
      <p>
        Before entering into the details of our proposal, we need to introduce the
necessary building blocks of the work of [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] and of our extensions. In [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ],
the authors use CCG grammars to produce a ¸-calculus intermediate form of a
given sentences. Then, they introduce a variant of this intermediate form so as
to cope with uncertain knowledge, and ¯nally they propose a translation into
ASP. Below we shortly recall the basics of ¸-calculus, ASP and CCG grammars,
and then we illustrate the method of [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
2.1
      </p>
      <sec id="sec-2-1">
        <title>Preliminaries</title>
        <p>Lambda Calculus ¸-calculus is a formal system designed to investigate
function de¯nition, function application and recursion. Any computable function can
be expressed and evaluated via this formalism.</p>
        <p>The central concept in ¸-calculus is the \expression", de¯ned recursively as
follows (where a \variable", is an identi¯er which can be any of the letters a, b,
c, . . . ):</p>
        <p>M ::=&lt; name &gt; j &lt; f unction &gt; j &lt; application &gt;
&lt; f unction &gt;::= ¸ &lt; name &gt; :M
&lt; application &gt;::= M M</p>
        <p>Parentheses can be used for clarity. Lambda-calculus has only two keywords:
¸ and the dot. A single identi¯er is a valid ¸-expression, like, e.g., ¸x:x that
de¯nes the identity function. The name after the ¸ is the identi¯er of the
argument of this function. The expression after the point is called the body of
the de¯nition. Functions can be applied to expressions, like, e.g., (¸x:x)y is the
identity function applied to y. Parentheses are used to avoid ambiguity. Function
applications are evaluated by substituting the value of the argument x (in this
case 'y') in the body of the function de¯nition. The names of the arguments in
function de¯nitions do not carry any meaning by themselves, they are just place
holders. In ¸-calculus all names are local to de¯nitions. In the function ¸x:x, x
is bound since its occurrence in the body of the de¯nition is preceded by ¸x. A
name not preceded by a ¸ is called a free variable. The same identi¯er can occur
free and bound in the same expression.</p>
        <p>Substitution corresponds to the operation that will replace in a term all the
free occurrences of x with y, like [y=x]M .</p>
        <p>An ®-conversion allows bounded variables to change their name, like ¸x:M =
¸y:[y=x]M where [y=x]M is the result of substituting y for free occurrences of x
in M and y cannot already appear in M .</p>
        <p>
          Reduction (also called ¯-reduction) is the only rule of computation. It
concerns the replacement of a formal parameter by an actual one. It can only occur
if a functional term has been applied to some other term. The ¯-reduction of
((¸x:M )N ) is [N=x]M where [N=x]M denotes the substitution of the formal
parameter x with the argument N throughout the expression M . ¯-reduction will
be denoted by the connective @. Reduction is nothing other than the textual
replacement of a formal parameter in the body of a function by the actual
parameter supplied, for example ¸x:f lies(x) @ tweety results in f lies(tweety). We can
have ¸ expressions with various arguments, e.g., ¸x¸y:M . In this case, we assume
¯-reduction to be possible on one variable at a time, and to be performed on the
leftmost free variable. E.g., ¸x¸y:likes(x; y) @ mary results in ¸y:likes(mary; y)
and ¸x:likes(mary; x) @ john results in likes(mary; john). We use parentheses
to indicate successive ¯-reductions, like in
((¸x¸y:likes(x; y) @ mary) @ john) that gives the same result as before.
ASP Answer Set Programming (ASP) is a form of logic programming based on
the answer set semantics [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ], where solutions to a given problem are represented
in terms of selected models (answer sets) of the corresponding logic program [
          <xref ref-type="bibr" rid="ref8 ref9">8,
9</xref>
          ]. Rich literature exists on applications of ASP in many areas, including
problem solving, con¯guration, information integration, security analysis, agent
systems, Semantic Web, and planning (see among many [10{14] and the references
therein).
        </p>
        <p>In this logical framework, a problem can be encoded |by using a
functionfree logic language| as a set of properties and constraints which describe the
(candidate) solutions. More speci¯cally, an ASP-program is a collection of rules
of the form</p>
        <p>H Ã L1; : : : ; Lm; not Lm+1; : : : ; not Lm+n
where H is an atom m ¸ 0, n ¸ 0 and each Li is an atom. The symbol not
stands for negation-as-failure. Various extensions to the basic paradigm exist,
that we do not consider here since they are not essential in the present context.
The left-hand side and the right-hand side of the clause are called head and body,
respectively. A rule with empty head is a constraint. (The literals in the body of
a constraint cannot be all true, otherwise they would imply falsity.)</p>
        <p>
          The semantics of ASP is expressed in terms of answer sets (or equivalently
stable models, [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]). Consider ¯rst the case of a ground ASP-program P which
does not involve negation-as-failure (i.e., n = 0). In this case, a set of atoms X
is said to be an answer set for P if it is the (unique) least model of P . Such a
de¯nition is extended to any ground program P containing negation-as-failure
by considering the reduct P X (of P ) w.r.t. a set of atoms X. P X is de¯ned as
the set of rules of the form H Ã L1; : : : ; Lm for all rules of P such that
X does not contain any of the literals Lm+1; : : : ; Lm+n. Clearly, P X does not
involve negation-as-failure. The set X is an answer set for P if it is an answer
set for P X .
        </p>
        <p>
          Once a problem is described as an ASP-program P , its solutions (if any) are
represented by the answer sets of P . Unlike other semantics, a logic program
may have several or no answer sets, because conclusions are included in an
answer set only if they can be justi¯ed. The following program has no answer
sets: fa Ã not b; b Ã not c; c Ã not ag. The reason is that in every minimal
model of this program there is a true atom that depends (in the program) on the
negation of another true atom. Whenever a program has no answer sets, we will
say that the program is inconsistent. Correspondingly, checking for consistency
means checking for the existence of answer sets. For a survey of this and other
semantics of logic programs with negation, the reader may refer to [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ].
        </p>
        <p>Let us consider the program P consisting of the three rules fr Ã p, p Ã
not q, q Ã not pg. Such a program has two answer sets: fp; rg and fqg. If we
add the rule (actually, a constraint) Ã q to P , then we rule-out the second of
these answer sets, because it violates the new constraint.</p>
        <p>
          To ¯nd the solutions of an ASP-program, an ASP-solver is used. We used
Clasp solver [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ]. The reader can see [
          <xref ref-type="bibr" rid="ref10 ref17">10, 17</xref>
          ], among others, for a presentation
of ASP as a tool for declarative problem-solving.
        </p>
        <p>
          CCG Combinatorial Categorial Grammars (CCGs) [
          <xref ref-type="bibr" rid="ref18 ref19">18, 19</xref>
          ] have the aim of
providing high expressive power while keeping automata-theoretic complexity to
a minimum. CCG is a form of lexicalized grammar in which the application of
syntactic rules is entirely conditioned on the syntactic type, or category, of their
inputs. No rule is structure- or derivation-dependent. A categorial grammar (CG)
speci¯es a language by describing the combinatorial possibilities of its lexical
items directly, without the mediation of phrase-structure rules like in traditional
grammars. Consequently, two grammars in the same categorial grammar system
di®er only in the lexicon.
        </p>
        <p>Categories identify constituents as either primitive categories or functions.
Primitive categories, such as N (noun), NP (noun phrase), S (sentence), and
so on, may be regarded as further distinguished by features, such as number,
case, in°ection, and the like. Functions (such as verbs) bear categories
identifying the type of their result (such as VP, verb phrase) and that of their
argument(s)/complements(s) (both may themselves be either functions or primitive
categories). Function categories also de¯ne the order(s) in which the arguments
must combine, and whether they must occur to the right or the left of the functor.
Each syntactic category is associated with a logical form whose semantic type
is entirely determined by the syntactic category. The slash '/' and 'n' operators
allow a category to combine by any combinatory rule.</p>
        <p>In summary, a CCG grammar is composed of: a set of basic categories; a set
of derived categories, constructed from the basic categories; and some syntactical
rules describing via the slash operators the concatenation and determining the
category of the result of the concatenation. For instance, assume that a CCG
contains the following objects: Tweety whose category is NP (noun phrase) and
°ies whose category is (SnNP). The category of °ies being SnNP means that
if an NP (a noun phrase) is concatenated to the left of °ies then we obtain a
string of category S, i.e., a sentence. In other words, the category SnNP of °ies
indicates that it is a verb, and that whenever it occurs in a natural language
sentence its argument (namely the subject of the verb) is to be found at its left.
As another example, sentence mary likes joe is of category (SnNP)/NP meaning
that this time there are two arguments, one on the right and the other one on
the left of the verb.</p>
        <p>Categorial grammars have been widely used in linguistic research concerning
semantics of natural language. In fact, lexical items are associated with semantic
functions which correspond to the syntactic functions implicit in their categories.
For instance, a phrase of category S/NP can be represented, from a semantic
point of view, by a function from NP-type items to S-type items. By adopting
¸-calculus, the sentence will be associated with a lambda expression of the form
¸x:Á, e.g., ¸x:f lies(x). Similarly, for the category (SnNP)/NP we get ¸x:¸Á,
e.g., ¸x¸y:likes(x; y).
2.2</p>
      </sec>
      <sec id="sec-2-2">
        <title>Automated Translation of Natural Language into ASP</title>
        <p>
          The problem CCG do not cope with is that of approximate linguistic
expressions that involve \fuzzy" assertions like, e.g., `normally', `most', etc. that do
not have a direct correspondence in existentially / universally quanti¯ed
sentences. Thus, an intermediate form is needed that is able to take this kind of
sentences into account. This intermediate form should be such as to allow a
translation/transposition into some executable formalism that allows the extracted
knowledge to be reasoned about. Recent relevant work presented in [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ] proposes
the use of an intermediate ¸-ASP-calculus representation, to be then translated
into ASP. This calculus is an adaptation of ¸-calculus to take the ASP rule
format into account, so as to be able to represent fuzzy assertions and to translate
them in a standard way into ASP.
        </p>
        <p>
          The sample language discussed as a running example in [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ], that they consider
as a representative of a class of languages which are su±cient to represent an
interesting set of sentences (including default statements and strong exceptions),
is the following:
{ Most birds °y.
{ Penguins are birds.
{ Penguins do swim.
{ Penguins do not °y.
{ Tweety is a penguin.
        </p>
        <p>{ Tim is a bird.</p>
        <p>The ¯rst sentence is a normative sentence expressing a default: namely, it states
that birds normally °y. The second sentence represents a subclass relationship,
while third and fourth sentences represent di®erent properties of the class of
penguins. The last two sentences are statements about individuals.</p>
        <p>It is important to notice that none of previous approaches to automatic
translation of natural language sentences is able to deal with default statements.
The authors show how it is possible to automatically translate these sentences
into ASP rules.</p>
        <p>As ¯rst step, a CCG grammar for this sentences set is de¯ned, Lbird. The
CCG grammar is used because it gives information to \drive" the application
of ¸-expressions. However, as the goal is to obtain an ASP representation, the
notion of ¸-representation is expanded to ¸-ASP-expression which allows for
construction of ASP rules. Then, the second step is the development of
¸-ASPexpressions for words and categories in the language of interest. For example, for
the Lbird grammar, the ¸-ASP-expressions are (where variables denoting domain
constants are indicated, as customary in ASP, in uppercase):</p>
        <sec id="sec-2-2-1">
          <title>Word Cat ¸-ASP-expression</title>
          <p>°y
most
birds</p>
          <p>Notice that the formula for `most' is a schema to be instantiated to speci¯c
cases, while the other expressions are directly related to the example at hand.</p>
          <p>Given this theoretical tool an example of translation is the following. Given
the sentence \Most birds °y", the CCG derivation tells how this sentence is
constructed (where S=Sentence, NP=Noun phrase):</p>
          <p>The word `birds' is concatenated to the right of `most', creating `most birds'.
This will be concatenated to the left of `°y', creating a sentence whose category
is S.</p>
          <p>The ¸-ASP-expressions for the categories of interest are:</p>
          <p>The concatenation is driven by the CCG derivation, so the ¯rst step implies
to concatenate `birds' to `most' and thus applying M to B2:</p>
          <p>The ¸-ASP-expression for `Most birds °y' is obtained by applying the above
expression to F1, i.e.:
f ly(X) Ã bird(X); not :f ly(X):
3</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Enhanced Automated Translation of Natural Language into ASP</title>
      <p>In this section, we propose an improved fully automated methodology for
generating ASP rules from natural language sentences of the kind discussed above,
i.e., involving determiners and thus uncertain knowledge. We remind the reader
that the objective of producing an ASP representation of natural language
sentences is that of adding the resulting ASP code to a knowledge base and then
being able to reason and draw consequences from the knowledge extracted form
the sentence. This on the one hand allows a system to enlarge its knowledge
and on the other hand may improve the system capabilities: for instance, the
system can provide the user with \intelligent" answers to her/his questions. Our
proposal copes with the following aspects.</p>
      <p>{ Meta-¸-ASP-expressions</p>
      <p>
        In our proposal, we go farther in the direction of replacing domain-dependent
¸-expressions with templates. We associate to grammar categories
expressions which are `meta' in the sense that they are associated to sets of
sentences rather than, like in the work of [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], to speci¯c instances. In particular,
we allow meta-variables to denote function symbols in ¸-expressions. We
illustrate how to instantiate these meta-rules to the functional lexical elements
thus obtaining speci¯c expressions to be reduced w.r.t. their arguments. We
will then be able to automatically generate ASP rules form this extended
intermediate formalism. This alleviates the problem, mentioned in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], that
the construction of ¸-expressions requires human engineering, and it is a ¯rst
step towards their automatic generation.
{ Managing several kinds of determiners, and conjunctions The
approach of [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] consider only the determiner `most'. The reason of this lies in
our opinion in the fact that other determiners, like `some' or `many' would
produce basically the same expression, where what changes is the relative
incidence of the set of exceptions. While `most' admits few exceptions `some'
admits a lot of them, while `many' is similar, though less committing, to
`most'. The representation of these subtle forms of commonsense
connectives may pro¯t from allowing meta-level statements to be represented in
the background knowledge base that state the incidence of the exceptions.
As we illustrate below, determiners `some' and `many' can be managed by
including meta-level representations directly in the Meta-¸-ASP-expressions.
A further improvement that we propose, in the direction of coping with more
complex sentences, consists in dealing with conjunctions.
3.1
      </p>
      <sec id="sec-3-1">
        <title>Abstract ¸-ASP-expressions</title>
        <p>In our methodology, we associate grammar rules to meta-¸-ASP-expressions.
These expressions are `meta' in the sense that they are associated to categories
rather than to speci¯c instances. This alleviates the problem of the construction
of ¸-expressions, and is a ¯rst step towards their automatic generation. We
de¯ne ¸-ASP-expressionsT (template ¸-ASP-expressions) as a meta extension
of ¸-ASP-expressions. These expressions may contain lexical placeholders of the
form &lt; nt &gt;, where &lt; nt &gt; is a non-terminal of the given grammar, in place of
function symbols. In the context of the meta-expressions, they play the role of
meta-variables that are intended to be instantiated to functional representatives
of these syntactic categories. I.e., basic template ¸-ASP-expressions are of the
form ¸x: &lt; nt &gt; (x) where &lt; nt &gt; can be instantiated for instance to °ies. The
instantiation of a ¸-ASP-expressionT expression produces a ¸-ASP-expression.</p>
        <p>We also extend the templates of ASP rules to include meta-axioms to be
evaluated in the background knowledge base in order to better represent
plausible knowledge. We give below the example of determiners `most', `some' and
`many'.</p>
        <p>
          Notice that we modify the de¯nition of `most' provided in [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]. In fact, we not
only state that property v must hold for the set of objects u provided that given
object is not an exception: we additionally state that for objects of kind u it is
actually abnormal not to enjoy v. For determiner `some' we take a
complementary stance, stating that enjoying v is abnormal, e.g., in the sentence `Some birds
swim' (penguins, again!). Determiner `many' is treated by stating that enjoying
v is possible and also usual for objects of kind u. This and similar statements
are able to cope with properties resulting from habits or preferences, like e.g.
`Many cats eat ¯sh' or `Many people like pasta'.
        </p>
        <p>We de¯ne ¯ as the ¸ ¡ ASP ¡ expressionT Base, i.e., the set of meta
¸expression upon which the translation into ASP of given sentences is based. For
the running example, the ¸-ASP-expressionT Base is:
most
some
many
noun
verb
det
det
det
We have to suitably de¯ne the instantiation and application operations. The
instantiation, denoted with the symbol @@, is the operation that will replace
the lexical placeholder in a ¸-ASP-expressionT with the given parameter.
The syntax of instantiation is the following:</p>
        <p>¸x: &lt; noun &gt; (x)
The result of instantiation is a ¸-ASP-expression. For example, given the
¸-ASPexpressionT :
The instantiation of noun with 'home', is performed as follows:
and the resulting ¸-ASP-expression is:</p>
        <p>¸x:home(x)
For the instantiation operation we adopt the same convention as for ¯-reduction,
i.e., an instantiation refers to the leftmost metavariable, and parentheses have
to be used in case of successive instantiations.</p>
        <p>An application operation is the transposition of the ¸-calculus application to the
¸-ASP-expression realm.</p>
        <p>The translation of a given sentence into a corresponding ¸-ASP-expression
starts from the leaves of the parse tree and go backwards to the root symbol. The
bottom-up visit of the parse tree drives the translation execution. For each
terminal symbol an instantiation operation is performed, while each non-terminal
implies an application operation to be performed.
3.2</p>
      </sec>
      <sec id="sec-3-2">
        <title>The Enhanced Methodology</title>
        <p>We illustrate the proposed methodology again with the help of the sentence
Most birds °y . For the sake of simplicity, instead of the CCG parse tree we
adopt in the example a more \traditional" parse tree, that looks as follows:</p>
        <p>Starting a left-to-right bottom-up visit of the parse tree, we retrieve in the
¸-ASP-Template Expression Base the class det (semantic match) and the exact
lexical match for the most lexicon. Since most is a terminal symbol, according
to previous de¯nitions we have to perform an instantiation operation.
The ¸-ASP-Template-expression for most is:
By the instantiation
we obtain the ¸ ¡ ASP ¡ expression:
In this case, the instantiation operation returns the same ¸-ASP-expression,
because no placeholders needs to be instantiated. This happens when both semantic
and syntactic match occurs. This is seldom the case in complex sentences, where
instantiation will in general perform constrains checks and syntactic
manipulation.</p>
        <p>The next leave of the parse tree is the lexicon birds. It has the semantic role of
\noun" in the context of the sentence. We ¯nd in the template base a match for
all lexicons of the semantic class noun. As the birds lexicon is a terminal symbol,
according to previous de¯nitions we perform an instantiation. The appropriate
¸-ASP-Template-expression is ¸x: &lt; noun &gt; (x),</p>
        <p>The instantiation operation is performed with birds as parameter, obtaining:
¸x:bird(x)
Thus, the resulting ¸ ¡ ASP ¡ expression is:
Going up the parse tree, we ¯nd non-terminal np. According to previous
de¯nitions, an application operation needs to be performed. In this case, semantic
information drive the application of the ¸-ASP-expression
and thus we get
which produces:
Now, we encounter the °y lexicon (verb), thus we look for a match concerning
the verb semantic class, applicable to all lexicons of this class. We use this
¸ ¡ ASP ¡ expressionT to instantiate the °y lexicon
and we get</p>
        <p>¸y:f ly(y).</p>
        <p>For the vp class, the application is an identity, so we can skip to root symbol s,
and thus perform the ¯nal application:
from which we get the ¯nal ASP expression:</p>
        <p>f ly(X) Ã bird(X); not :f ly(X); abnormal(:f ly(X); bird(X))
Below we illustrate the automatic translation process of another sentence, namely
Some robots walk . This sentence make use of some determiner. The parse tree is
trivial. We As ¯rst step we retrieve from the ¸-ASP-Template Expression Base
the expression that matches the class det (semantic match) and the some
lexicon. some is a terminal symbol and thus we perform an instantiation operation.
The ¸-ASP-Template-expression for some is:</p>
        <sec id="sec-3-2-1">
          <title>By the instantiation</title>
          <p>we obtain the ¸ ¡ ASP ¡ expression:
The robots lexicon is the next leaf of the parse tree that we have to process. We
¯nd in the template base a match for all lexicons of the semantic class noun to
which this lexicon belongs. According to de¯nition we perform an instantiation
from ¸-ASP-Template-expression: ¸x: &lt; noun &gt; (x), obtaining:
Thus, the resulting ¸ ¡ ASP ¡ expression is: ¸x:robot(x)
Traversing the parse tree, we ¯nd the non-terminal symbol np. In this case,
according to the semantic information the application of the ¸-ASP-expression
produces:
When encountering the walk lexicon (verb), we ¯nd the match with the verb
semantic class that is applicable to all lexicons of this class. We use this ¸ ¡
ASP ¡ expressionT to instantiate the walk lexicon</p>
          <p>For the vp class, the application is an identity, so we can skip to root symbol s,
and thus perform the ¯nal application:
which produces
Finally, we get the ¯nal ASP expression:</p>
          <p>
            walk(X) Ã robot(X); not :walk(X); abnormal(walk(X); robot(X))
We now illustrate how it is possible to translate sentences including conjunctions
(like and ). This is an important step that allows us to capture more complex
sentences. The hardest problem in dealing with these constructs lies in the
requirement to properly specify the correct category representing each word. [
            <xref ref-type="bibr" rid="ref2">2</xref>
            ]
Assume to translate the following sentence: Parrots and Penguins are birds .
The parse tree is:
          </p>
          <p>The ¸-ASP-expressionT Base is extended to include more elements:
Lexicon SemClass ¸ ¡ ASP ¡ expression T emplate
are
and
most
some
many
noun
verb
verb
conj
det
det
det
As a ¯rst step, we retrieve the ¸ ¡ ASP ¡ ExpressionT from the ¸ ¡ ASP ¡
ExpressionT emplateBase for the semantic class noun, and Parrots lexicon.
According to our de¯nition, we have to perform an instantiation, The
¸-ASPTemplate-expression for noun semantic class is ¸x: &lt; noun &gt; (x).
We use this ¸ ¡ ASP ¡ expressionT to instantiate the Parrots lexicon
and we get</p>
          <p>¸x:parrot(x).
and we get</p>
          <p>¸x:penguin(x)
Then we move to the Penguins lexicon. This lexicon was recognized as belonging
to the noun semantic class by semantic analysis, so, similarly to previous step
and according to the ¸ ¡ ASP ¡ expressionT instantiation, we obtain
We retrieve from the ¸ ¡ ASP ¡ expressionT that the expression for the and
conjunction is:</p>
          <p>
            ¸u¸v:u ^ ¸u¸v:v shortened as ¸u¸v:ujv
Note that due the di®erent nature of translation process achieved through the
parse tree returned by our enhanced methodology, the ¸ ¡ ASP ¡ expression
for the and conjunction is di®erent from previous ones de¯ned in literature [
            <xref ref-type="bibr" rid="ref2">2</xref>
            ].
In fact, we have to perform an instantiation with the two previous obtained
subexpressions as arguments.
          </p>
          <p>From ¸u¸v:ujv, the two arguments are
We obtain:
and then
that reduces to:
¸x:parrot(x) and ¸x:penguin(x).
(¸v:(¸x:parrot(x))jv)
Then:
That simpli¯es to:</p>
          <p>¸x:bird(x)
Finally, we have to perform some ¸ ¡ calculus operations to obtain the ¯nal
expression:
(¸v:v@X Ã parrot(X)jpenguin(X))
(¸x:bird(x)@X Ã parrot(X)jpenguin(X))
bird(X) Ã parrot(X)jpenguin(X)
To have an expression that is consistent with ASP de¯nition we can divide the
expression above into the two following rules:</p>
          <p>bird(X) Ã parrot(X)
and</p>
          <p>bird(X) Ã penguin(X)
4</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Concluding remarks and future work</title>
      <p>
        In this paper, we have introduced an advancement over [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] towards a fully for
translating natural language sentences into ASP theories, taking uncertain and
defeasible knowledge into account. In particular, we have proposed the adoption
of meta-level axioms to be evaluated in a background knowledge base.
      </p>
      <p>A main future direction is that of improving the present representation on
the one hand by introducing more abstract templates and meta-axioms able to
cope with functions with an arbitrary number of arguments and on the other
hand by expressing more forms of plausible/uncertain knowledge, and dealing
with the translation of complex sentences including other kinds of conjunctions
and, in perspective, pronouns and adverbs.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Bos</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Markert</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Recognising textual entailment with logical inference</article-title>
          .
          <source>In: HLT '05: Proceedings of the conference on Human Language Technology and Empirical Methods in Natural Language Processing</source>
          , Association for Computational Linguistics (
          <year>2005</year>
          )
          <volume>628</volume>
          {
          <fpage>635</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Baral</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dzifcak</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Son</surname>
          </string-name>
          , T.C.:
          <article-title>Using answer set programming and lambda calculus to characterize natural language sentences with normatives and exceptions</article-title>
          . (
          <year>2008</year>
          )
          <volume>818</volume>
          {
          <fpage>823</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Lassila</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hendler</surname>
          </string-name>
          , J.:
          <source>Embracing "web 3.0". IEEE Internet Computing</source>
          <volume>11</volume>
          (
          <issue>3</issue>
          ) (
          <year>2007</year>
          )
          <volume>90</volume>
          {
          <fpage>93</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Berners-Lee</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hendler</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lassila</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          :
          <article-title>The semantic web: A new form of web content that is meaningful to computers will unleash a revolution of new possibilities</article-title>
          . Scienti¯c American, issue of May,
          <volume>17</volume>
          (
          <year>2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Costantini</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Paolucci</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Semantically augmented DCG analysis for next-generation search engines</article-title>
          . In: A. Formisano, ed.,
          <source>Online Proc. of CILC2008</source>
          ,, Italian Conference on Computational Logic. (
          <year>2008</year>
          ) URL http://www.dipmat.unipg.it/CILC08/programma.html.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Moldovan</surname>
            ,
            <given-names>D.I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Harabagiu</surname>
            ,
            <given-names>S.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Girju</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Morarescu</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lacatusu</surname>
            ,
            <given-names>V.F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Novischi</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Badulescu</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bolohan</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          :
          <article-title>Lcc tools for question answering</article-title>
          , TREC
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Gelfond</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lifschitz</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          :
          <article-title>The stable model semantics for logic programming</article-title>
          . In Kowalski, R.,
          <string-name>
            <surname>Bowen</surname>
          </string-name>
          , K., eds.
          <source>: Proc. of the 5th Intl. Conference and Symposium on Logic Programming</source>
          , The MIT Press (
          <year>1988</year>
          )
          <volume>1070</volume>
          {
          <fpage>1080</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Lifschitz</surname>
          </string-name>
          , V.:
          <article-title>Answer set planning</article-title>
          .
          <source>In: Proc. of the 16th Intl. Conference on Logic Programming</source>
          . (
          <year>1999</year>
          )
          <volume>23</volume>
          {
          <fpage>37</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Marek</surname>
            ,
            <given-names>V.W.</given-names>
          </string-name>
          , Truszczyn¶ski, M. In:
          <article-title>Stable logic programming - an alternative logic programming paradigm</article-title>
          . Springer (
          <year>1999</year>
          )
          <volume>375</volume>
          {
          <fpage>398</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Baral</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Knowledge representation, reasoning and declarative problem solving</article-title>
          . Cambridge University Press (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Anger</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schaub</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          , Truszczyn¶ski, M.:
          <article-title>ASPARAGUS { the Dagstuhl Initiative</article-title>
          .
          <source>ALP Newsletter</source>
          <volume>17</volume>
          (
          <issue>3</issue>
          ) (
          <year>2004</year>
          ) See http://asparagus.cs.uni-potsdam.de.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Leone</surname>
          </string-name>
          , N.:
          <article-title>Logic programming and nonmonotonic reasoning: From theory to systems and applications</article-title>
          . In Baral,
          <string-name>
            <given-names>C.</given-names>
            ,
            <surname>Brewka</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            ,
            <surname>Schlipf</surname>
          </string-name>
          , J.S., eds.:
          <source>Logic Programming and Nonmonotonic Reasoning</source>
          , 9th International Conference,
          <string-name>
            <surname>LPNMR</surname>
          </string-name>
          <year>2007</year>
          .
          <article-title>(</article-title>
          <year>2007</year>
          )
          <fpage>1</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Truszczynski</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Logic programming for knowledge representation</article-title>
          . In Dahl, V.,
          <string-name>
            <surname>NiemelÄa</surname>
          </string-name>
          , I., eds.: Logic Programming, 23rd International Conference, ICLP 2007
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Gelfond</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Answer sets</article-title>
          . In:
          <article-title>Handbook of Knowledge Representation, chapter 7</article-title>
          .
          <string-name>
            <surname>Elsevier</surname>
          </string-name>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Apt</surname>
            ,
            <given-names>K.R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bol</surname>
            ,
            <given-names>R.N.</given-names>
          </string-name>
          :
          <article-title>Logic programming and negation: A survey</article-title>
          .
          <source>J. of Logic Programming</source>
          <volume>19</volume>
          /20 (
          <year>1994</year>
          )
          <volume>9</volume>
          {
          <fpage>72</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>16. : Clasp asp solver http://www.cs.uni-potsdam.de/clasp.</mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Dovier</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Formisano</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pontelli</surname>
          </string-name>
          , E.:
          <article-title>A comparison of CLP(FD) and ASP solutions to NP-complete problems</article-title>
          . In Gabbrielli,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Gupta</surname>
          </string-name>
          , G., eds.: Logic Programming, 21st International Conference, ICLP 2005,
          <article-title>Proceedings</article-title>
          . Volume
          <volume>3668</volume>
          of LNCS., Springer (
          <year>2005</year>
          )
          <volume>67</volume>
          {
          <fpage>82</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Steedman</surname>
            ,
            <given-names>M.J.</given-names>
          </string-name>
          :
          <article-title>Gapping as constituent coordination</article-title>
          .
          <source>Linguistics and Philosophy</source>
          <volume>13</volume>
          (
          <issue>2</issue>
          ) (
          <year>1990</year>
          )
          <volume>207</volume>
          {
          <fpage>263</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <surname>Steedman</surname>
            ,
            <given-names>M.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Baldridge</surname>
          </string-name>
          , J.:
          <article-title>Combinatory categorial grammar</article-title>
          . To appear in Robert Borsley and Kersti Borjars (eds.)
          <article-title>Constraint-based approaches to grammar: alternatives to transformational syntax. Oxford: Blackwell, draft available on the web sites of the authors (</article-title>
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>