• Keine Ergebnisse gefunden

2 Constraint Logic Programming and Constraint Logic Grammars

N/A
N/A
Protected

Academic year: 2022

Aktie "2 Constraint Logic Programming and Constraint Logic Grammars"

Copied!
20
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

In Logical Aspects of Computational Linguistics, 1996, Nancy, France.

Quantitative Constraint Logic Programming for Weighted Grammar Applications

?

Stefan Riezler

Graduiertenkolleg ILS, Seminar für Sprachwissenschaft, Universität Tübingen, Wilhelmstr. 113, 72074 Tübingen, Germany.

riezler@sfs.nphil.uni-tuebing en.de

Abstract. Constraint logic grammars provide a powerful formalism for expressing complex logical descriptions of natural language phenomena in exact terms. Describing some of these phenomena may, however, re- quire some form of graded distinctions which are not provided by such grammars. Recent approaches to weighted constraint logic grammars at- tempt to address this issue by adding numerical calculation schemata to the deduction scheme of the underlying CLP framework.

Currently, these extralogical extensions are not related to the model- theoretic counterpart of the operational semantics of CLP, i.e., they do not come with a formal semantics at all.

The aim of this paper is to present a clear formal semantics for weighted constraint logic grammars, which abstracts away from specic interpreta- tions of weights, but nevertheless gives insights into the parsing problem for such weighted grammars. Building on the formalization of constraint logic grammars in the CLP scheme of [11], this formal semantics will be given by a quantitative version of CLP. Such a quantitative CLP scheme can also be valuable for CLP tasks independent of grammars.

1 Introduction

Constraint logic grammars (CLGs) provide a powerful formalism for complex logical description and ecient processing of natural language phenomena. Lin- guistic description and computational practice may, however, often require some form of graded distinctions which are not provided by such grammars.

One such issue is the task of ambiguity resolution. This problem can be illus- trated for formal grammars describing a nontrivial domain of natural language as follows: For such grammars every input of reasonable length may receive a large number of dierent analyses, many of which are not in accord with human perceptions. Clearly there is a need to distinguish more plausible analyses of an input from less plausible or even totally spurious ones.

?I am greatly indebted to Steven Abney, Thilo Götz and Paul King for their valuable comments on this paper. Furthermore, I would like to thank Graham Katz, Frank Morawietz and two anonymous LACL referees for their helpful suggestions.

(2)

This problem has successfully been addressed by the use of weighted gram- mars for disambiguation in regular and context-free grammars. Weighted gram- mars assign numerical values, or weights, to the structure-building components of the grammars and calculate the weight of an analysis from the weights of the structural features that make it up. The correct analysis is chosen from among the in-principle possible analyses by assuming the analysis with the greatest weight to be the correct analysis. This approach also allows parsing to be speeded up by pruning low-weighted subanalyses.

The idea of weighted grammars recently has been transferred to highly ex- pressive weighted CLGs by [8,9] and [7]. The approaches of Erbach and Eisele are based on the feature-based constraint formalism CUF ([5,4]), which can be seen as an instance of the constraint logic programming (CLP) scheme of [11]. These approaches extend the underlying formalism by assigning weights to program clauses, but dier with respect to an interpretation of weights in a preference-based versus probabilistic framework. Erbach calculates a preference value of analyses from the preference values of the clauses used in the analyses, whereas Eisele assigns application probabilities to clauses from which a proba- bility distribution over analyses is calculated.

There is an obvious problem with these approaches, however. Even if the formal foundation of the underlying framework is clear enough, there is no well- dened semantics for the weighted extensions. This means that these extralogical extensions of the deduction scheme of the underlying constraint logic program are not related to the model-theoretic counterpart of this operational seman- tics, i.e., they do not come with a formal semantics at all. This is clearly an undesirable state of aairs. Rather, in the same way as CLGs allow for a clear model-theoretic characterization of linguistic objects coupled with the opera- tional parsing system, one would prefer to base a quantitative deduction system on a clear quantitative model-theory in a sound and complete way.

The aim of this paper is to present a clear formal semantics for weighted CLGs, which abstracts away from specic interpretations of weights, but gives insight into the parsing problem for weighted CLGs. Building on the formal- ization of CLGs in the CLP scheme of [11], this formal semantics will be given by a quantitative version of CLP. Such a quantitative CLP scheme can also be valuable for CLP tasks independent of grammars.

Previous work on related topics has been conned to quantitative extensions of conventional logic programming. A quantitative deduction scheme based on a xpoint semantics for sets of numerically annotated conventional denite clauses was rst presented by van Emden in [26]. In this approach numerical weights are associated with denite clauses as a whole. The semantics of such quantitative rule sets is based upon concepts of fuzzy set algebra and crucially deals with the truth-functional propagation of weights across denite clauses. Van Emden's approach initialized research into a now extensively explored area of quantitative logic programming. For example, annotated logic programming as introduced by [25] extends the expressive power of quantitative rule sets by allowing variables and evaluable function terms as annotations. Such annotations can be attached

(3)

to components of the language formula and come with more complex mappings as a foundation for a multivalued logical semantics. Such extended theories are interpreted in frameworks of lattice-based logics for generalized annotated logic programming ([15]), possibilistic logic for possibilistic logic programming ([6]) or logics of subjective probability for probabilistic logic programming ([20,21]) and probabilistic deductive databases ([17,18]).

Aiming at a formal foundation of weighted CLGs in a framework of quan- titative CLP, we can start from the ideas developed in the simple and elegant framework of [26], but transfer them to the general CLP scheme of [11]. This means that the form of weighted CLGs under consideration allows us to restrict our attention to numerical weights associated with CLP clauses as a whole. Fur- thermore, the simple concepts of fuzzy set algebra can also provide a basis for an intuitive formal semantics for quantitative CLP. Such a formal semantics will be suciently general in that it is itself not restricted by a specic interpretation of weights. Further extensions should be straightforward, but have to be deferred to future work. Our scheme will straightforwardly transfer the nice properties of the CLP scheme of [11] into a quantitative version of CLP.

2 Constraint Logic Programming and Constraint Logic Grammars

Before discussing the details of our quantitative extension of CLP, some words on the underlying CLP scheme and grammars formulated by these means are necessary. In the following we will rely on the CLP scheme of [11], which gener- alizes conventional logic programming (see [19]) and also the CLP scheme of [12]

to a scheme of denite clause specications over arbitrary constraint languages.

A very general characterization of the concept of constraint language can be given as follows.

Denition 1 (

L

).

A constraint languageLconsists of

1. an L-signature, specifying the non-logical elements of the alphabet of the language,

2. a decidable innite setVARwhose elements are called variables,

3. a decidable set CON of L-constraints which are pieces of syntax with un- known internal structure,

4. a computable functionV assigning to every constraint2CON a nite set

V ()of variables, the variables constrained by,

5. a nonempty set ofL-interpretationsINT, where each L-interpretationI 2

INTis dened w.r.t. a nonempty setD, the domain ofI, and a set ASS of variable assignmentsVAR!D,

6. a function [[]]I mapping every constraint2CON to a set[[]]I of variable assignments, the solutions ofinI.

7. Furthermore, a constraint constrains only the variables in V(), i.e., if 2[[]]I and is a variable assignment that agrees with on V(), then 2[[]]I.

(4)

To obtain constraint logic programs, a given constraint languageLhas to be extended to a constraint language R(L) providing for the necessary relational atoms and propositional connectives.

Denition 2 (

R(L)

).

A constraint language R(L)extending a constraint lan- guage Lis dened as follows:

1. The signature ofR(L)is an extension of the signature of Lwith a decidable setRof relation symbols and an arity functionAr:R!IN.

2. The variables of R(L)are the variables ofL. 3. The set of R(L)-constraints is the smallest set s.t.

is an R(L)-constraint if is anL-constraint,

r(x )is anR(L)-constraint, called an

atom

, ifr2Ris a relation symbol with arity n andxis an n-tuple of pairwise distinct variables,

;, F&G,F !GareR(L)-constraints, if F and G areR(L)-constraints,

& B1 & ::: & Bn ! A is an R(L)-constraint, called a

denite clause

, if A;B1;:::;Bn are atoms and is an L-constraint. We may write a denite clause also asA &B1 &::: &Bn.

4. The variables constrained by an R(L)-constraint are dened as follows: If is an L-constraint, then V () is dened as in L; V (r(x1;:::;xn)) :=

fx1;:::;xng;V(;):=;;V(F &G):=V(F)[V(G); V(F !G):=V (F)[

V (G).

5. For eachL-interpretationI, anR(L)-interpretationAis an extension of an

L-interpretationI with relationsrAon the domainDofAwith appropriate arity for everyr2Rand the domain of A is the domain ofI.

6. For each R(L)-interpretation A, for each L-interpretation I, [[ ]]A is a function mapping every R(L)-constraint to a set of variable assignments s.t.

[[]]A=[[]]I if is anL-constraint,

[[r(x ) ]]A=f2ASSj(x)2rAg,

[[;]]A=ASS,

[[F &G]]A=[[F]]A\[[G]]A,

[[F !G]]A=(ASSn[[F]]A)[[[G]]A.

A constraint logic program then is dened as a denite clause specication over a constraint language.

Denition 3 (denite clause specication).

A denite clause specication

P over a constraint language Lis a set of denite clauses from a constraint language R(L)extendingL.

Relying on terminology well-known for conventional logic programming, Höh- feld and Smolka's generalization of the key result of conventional logic program- ming can be stated as follows:1 First, for every denite clause specication P

1 Further conditions for this generalization to hold are decidability of the satisability problem, closure under variable renaming and closure under intersection for the constraint languages under consideration.

(5)

in the extension of an arbitrary constraint language L, every interpretation of

Lcan be extended to a minimal model ofP. Second, the SLD-resolution method for conventional logic programming can be generalized to a sound and complete operational semantics for denite clause specications not restricted to Horn theories. In contrast to [12], in this scheme constraint languages are not required to be sublanguages of rst order predicate logic and do not have to be inter- preted in a single xed domain. This makes this scheme usable for a wider range of applications. Instead, a constraint is satisable if there is at least one interpre- tation in which it has a solution. Moreover, such interpretations do not have to be solution compact. This was necessary in [12] to provide a sound and complete treatment of negation as failure, which is not addressed in [11].

The term constraint logic grammars expresses the connection between CLP and constraint-based grammars. Constraint-based grammars allow for a clear model-theoretic characterization of linguistic objects by stating grammars as sets of axioms of suitable logical languages. However, such approaches do not necessarily provide an operational interpretation of their purely declarative spec- ications. This may lead to problems with an operational treatment of declara- tively well-dened problems such as parsing. CLP provides one possible approach to an operational treatment of various such declarative frameworks by an em- bedding of arbitrary logical languages into constraint logic programs. CLGs thus are grammars formulated by means of a suitable logical language which can be used as a constraint language in the sense of [11].2

For example, for feature based grammars such as HPSG ([23]), a quite direct embedding of a logical language close to that of [24] into the CLP scheme of [11] is done in the formalism CUF ([5,4]). This approach directly oers the operational properties of the CLP scheme by simply redening grammars as constraint logic programs, but is questionable in losing the connection to the model-theoretic specications of the underlying feature-based grammars. A dierent approach is given by [10] where a compilation of a logical language close to that of [16]

into constraint logic programs is dened. This translation procedure preserves important model-theoretic properties by generating a constraint logic program

P(G)from a feature-based grammarGin an explicit way.

The parsing/generation problem for CLGs then is as follows. Given a program

P (encoding a grammar) and a denite goalG(encoding the string/logical form we want to parse/generate from), we ask if we can infer an answer'ofG(which is a satisableL-constraint encoding an analysis) proving the implication'!G to be a logical consequence ofP.

2 Clearly, a direct denition of an operational semantics for specic constraint-based grammars is possible and may even better suit the particular frameworks. However, such approaches have to rely directly on the syntactic properties of the logical lan- guages in question. Under the CLP approach, arbitrary constraint-based grammars can receive a unique operational semantics by an embedding into denite clause spec- ications. The main advantage of this approach is the possibility to put constraint- based grammar processing into the well-understood paradigm of logic programming.

This allows the resulting programs to run on existing architectures and to use well- known optimization techniques worked out in this area.

(6)

3 Quantitative Constraint Logic Programming

3.1 Syntax and Declarative Semantics of Quantitative Denite Clause Specications

Building upon the denitions in [11], we can dene the syntax of a quantitative denite clause specication PFvery quickly. A denite clause specication P in R(L)can be extended to a quantitative denite clause specication PFin

R(L)simply by adding numerical factors to program clauses.

The following denitions are made with respect to implicit constraint lan- guagesLandR(L).

Denition 4 (

PF

).

A quantitative denite clause specication PFin R(L)is a nite set of quantitative formulae, called quantitative denite clauses, of the form: & B1 &::: &Bn f!A, where A,B1;:::;Bn are R(L)-atoms, is anL-constraint,n0,f 2(0;1]. We may write a quantitative formula also as A f &B1 &::: &Bn.

Such factors should be thought of as abstract weights which receive a concrete interpretation in specic instantiations ofPFby weighted CLGs.

In the following the notation R(L)will be used more generally to denote relationally extended constraint languages which possibly include quantitative formulae of the above form.

To obtain a formal semantics for PF, rst we have to introduce an ap- propriate quantitative measure into the set-theoretic specication of R(L)- interpretations. One possibility to obtain quantitative R(L)-interpretations is to base the set algebra ofR(L)-interpretations on the simple and well-dened concepts of fuzzy set algebra (see [27]).

Relying on Höhfeld and Smolka's specication of base equivalent R(L)- interpretations, i.e.,R(L)-interpretations extending the sameL-interpretation, in terms of the denotations of the relation symbols in these interpretations, we can fuzzify such interpretations by regarding the denotations of their relation symbols as fuzzy subsets of the set of tuples in the common domain.

Given constraint languages Land R(L), we interpret each n-ary relation symbolr2R as a fuzzy subset ofDn, for eachR(L)-interpretationAwith do- main D. That is, we identify the denotation ofrunder Awith a total function:

(_;rA):Dn![0;1], which can be thought of as an abstract membership func- tion. Classical set membership is coded in this context by membership functions taking only 0 and 1 as values.

Next, we have to give a model-theoretic characterization of quantitative def- inite clauses. Clearly, any monotonous mapping could be used for the model- theoretic specication of the interaction of weights in quantitative denite clauses and accordingly for the calculation of weights in the proof-theory of quantitative CLP. For concreteness, we will instantiate such a mapping to the specic case of Denition 5 resembling [26]'s mode of rule application. This will allow us to state the proof-theory of quantitative CLP in terms of min/max trees which in

(7)

turn enables strategies such as alpha/beta pruning to be used for ecient search- ing. However, this choice is not crucial for the substantial claims of this paper and generalizations of this particular combination mode to specic applications should be straightforward, but are beyond the scope of this paper.

The following denition of model corresponds to the denition of model in classical logic when considering only clauses with f = 1 and mappingsDn !

f0;1g.

Denition 5 (model).

AnR(L)-interpretationAextending someL-interpre- tation Iis a model of a quantitative denite clause specication PFi for each 2ASS, for each quantitative formula r(x) f &q1(x1)&::: &qk(xk)in

P

F: If 2[[]]I, then((x);rA)fminf((xj);qAj )j1j kg. Note that the notation of anR(L)-interpretation Awill be used more gen- erally to include interpretations of quantitative formulae. R(L)-solutions of a quantitative formula are dened as [[r(x ) f &q1(x1)& ::: &qk(xk)]]A =

f2ASSjIf2[[]]I, then((x );rA)fminf((xj);qjA)j1jkgg. The concept of logical consequence is dened as usual.

Denition 6 (logical consequence).

A quantitative formula r(x ) f is a logical consequence of a quantitative denite clause specication PFi for each R(L)-interpretation A, Ais a model of PFimplies that Ais a model of

fr(x) f g.

Furthermore, we have thatr(x ) f is a logical consequence ofPFimplies that r(x ) f0 is a logical consequence ofPFfor everyf0 f.

A

goal

G is dened to be a (possibly empty) conjunction of R(L)-atoms andL-constraints. We can, without loss of generality, restrict goals to be of the form r(x )& , i.e., a (possibly empty) conjunction of a single relational atom r(x )and anL-constraint. This is possible as for each goalG=r1(x1)&:::

&rk(xk)& containing more than one relational atom, we can complete the program with a new clauseC =r(x1;:::;xk) 1 r1(x1) &::: & rk(xk) &

withGas antecedent and a new predicate with all variables inGas arguments as consequent. Submitting the new predicate r(x1;:::;xk)as query yields the same results as would be obtained when querying with the compound goalG.

Given some PFand some goal G, a PF

-answer

' of G is dened to be a satisable L-constraint ' s.t. ' f ! G is a logical consequence of PF. A quantitative formula' f! r(x )& is dened to be a logical consequence of

P

Fi every model ofPFis a model off'f!r(x)&g. AnR(L)-interpretation

Ais dened to be a a model of f'f!r(x )& gi [[']]A [[]]A andAis a model offr(x ) f 'g.

Aiming to generalize the key result in the declarative semantics of CLP the minimal model semantics of denite clause specications over arbitrary con- straint languagesto our quantitative CLP scheme, rst we have to associate a complete lattice of interpretations with quantitative denite clause specica- tions.

(8)

Adopting Zadeh's denitions for set operations, we can dene a partial order- ing on the set of base equivalentR(L)-interpretations. This is done by dening set operations on these interpretations with reference to set operations on the denotations of relation symbols in these interpretations. We get for all base equivalentR(L)-interpretationsA; A0:

A A0 i for each n-ary relation symbol r 2 R, for each 2 ASS, for eachx2VARn:((x );rA)((x);rA0),

A =SX i for each n-ary relation symbolr 2R, for each2ASS, for eachx2VARn:((x );rA)=supf((x);rA0)jA02Xg,

A =TX i for each n-ary relation symbolr 2R, for each2ASS, for eachx2VARn:((x );rA)=inff((x);rA0)jA02Xg,

sup;=0,inf;=1.

Clearly, the set of all base equivalentR(L)-interpretations is a

complete lattice

under the partial ordering of set inclusion.

Next we have to apply the syntactic notions of renaming and variant to the quantitative case. A

renaming

is a bijection VAR ! VAR which is the identity except for nitely many exceptions andVARis a decidable innite set of variables.

A quantitative formula 0 is a

-variant

of a quantitative formula under a renaming iV(0)=(V()), where Vis a computable function assigning to every quantitative formulathe set V()of variables occurring in ; 0 =, i.e., 0 is the quantitative formula obtained from by simultaneously replacing each occurrence of a variable X in by (X) for all variables in V (); and

[[]]A=[[0]]A:=fj2[[0]]Agfor each interpretationA.

A quantitative formula0is a

variant

of a quantitative formulaif there exists a renamings.t.0 is a-variant of.

Using these denitions, we can state the central equations which link the declarative and procedural semantics ofPF.

Denition 7.

Let PFbe a quantitative denite clause specication in R(L),

Ibe anL-interpretation. Then the countably innite sequence hA0;A1;A2;:::i of R(L)-interpretations extending Iis a PF-chain i for each n-ary relation symbol r2R, for each2ASS, for each x2VARn:

((x);rA0):=0,

((x);rAi+1):=maxffminf((xj);qAij )j 1jngjthere is a variant r(x ) f &q1(x1)&::: &qn(xn)of a clause inPFand2[[]]Aig. Before stating the central theorem concerning the declarative semantics of quantitative denite clause specications, we have to prove the following useful lemma (cf. [26], Lemmata 2.10', 2.11'):

Lemma 1.

For each PF, for each PF-chain hA0;A1;A2;:::i, for each n-ary relation symbol r2R, for each2ASS, for each x2VARn, there exists some n2IN s.t. ((x);rSi0Ai)=((x );rAn).

(9)

Proof. We have to show that the supremumv =supf((x);rAi)j i0gcan be attained for somen2IN.

v=0

:

Forv=0, we haven=0.

v >0

:

For v >0, we have to show for any real, 0< < v: f((x);rAi)ji

0and ((x);rAi)gis nite.

Let F be the nite set of real numbers of factors of clauses in PF, m be the greatest element inF s.t.m < 1 and letq be the smallest integer s.t.

mq< .

Then, since each real number ((x );rAi) is a product of a sequence of elements ofF, the number of dierent productsis not greater thanjFjq (in combinatorics' talk, the permutation ofjFjdierent things takenqat a time with repetitions) and thus nite.

Hence, the supremum is the maximum attained for somen2IN. ut Now we can obtain minimal model properties for quantitative denite clause specications similar to those for the non-quantitative case of [11]. Theorem 1 states that we can construct a minimal modelAofPFfor each quantitative def- inite clause specicationPFin the extension of an arbitrary constraint language

Land for each L-interpretation. This means thatdue to the deniteness of

P

Fwe can restrict our attention to a minimal model semantics ofPF.

Theorem 1 (deniteness).

For each quantitative denite clause specication

P

Fin R(L), for each L-interpretationI, for each PF-chain hA0;A1;A2;:::i of R(L)-interpretations extending someL-interpretationI:

(i)

A0A1:::,

(ii)

the unionA :=Si0Ai is a model ofPFextendingI,

(iii)

Ais the minimal model of PFextendingI.

Proof.

(i)

We have to show thatAiAi+1. We prove by induction onishowing for each constraint languageL, for each quantitative denite clause specication

P

FinR(L), for eachL-interpretationI, for eachPF-chainh A0;A1;A2;:::iof

R(L)-interpretations extending some L-interpretation I, for each n-ary rela- tion symbol r 2 R, for each 2 ASS, for each x 2 VARn, for eachi 2 IN: ((x );rAi)((x );rAi+1).

Base: ((x);rA0)=0((x );rA1).

Hypothesis: Suppose((x );rAn?1)((x );rAn). Step: ((x );rAn)=v >0

=) there exists a variantr(x ) f &q1(x1)&::: & qk(xk)of a clause inPFs.t.v=fminf((x1);q1An?1);:::;((xk);qkAn?1)gand2

[[]]An?1, by Denition 7

=) ((x1);q1An)((x1);q1An?1);

:::;((xk);qkAn)((xk);qkAn?1)and2[[]]An, by the hypothe- sis

(10)

=) ((x );rAn+1)v, by denition of((x );rAi+1)

=) ((x );rAn)((x );rAn+1).

For v=0follows immediately((x );rAn)((x );rAn+1). Claim (i) follows by arithmetic induction.

(ii)

We have to show that A := Si0Ai is a model of PFextending I. We prove that for each clauser(x ) f &q1(x1)&::: &qk(xk)in PF, for each 2ASS: If2[[]]A, then((x );rA)fminf((xj);qjA)j1jkg.

Note that since everyAiis anR(L)-interpretation extendingI,Ais anR(L)- interpretation extendingI.

Now let r(x ) f & q1(x1)& ::: & qk(xk) be a clause in PFs.t. for some 2ASS:2[[]]Aand((xi);qiA)=minf((xj);qjA)j1j kg=v. Then there exists somen2INs.t.v=((xi);qiAn)=minf((xj);qjAn)j

1j kg, by Lemma 1 and since for allj s.t.1jk:((xj);qjA)= supf((xj);qjAi)ji0g

=) ((x );rAn+1)fv, by Denition 7

=) ((x );rA)((x);rAn+1), since((x);rA)= supf((x);rAi)ji0g

=)((x );rA)fminf((xj);qjA)j1jkg. This completes the proof for claim (ii).

(iii)

We have to show thatAis the minimal model ofPFextendingI. We prove for every base equivalent modelBofPF:AiB, which givesA B, by induc- tion onishowing for each constraint languageL, for each quantitative denite clause specicationPFinR(L), for eachL-interpretationI, for eachPF-chain

hA

0;A1;A2;:::i of R(L)-interpretations extending some L-interpretation I, for each n-ary relation symbolr2R, for each2ASS, for eachx2VARn, for eachi2IN:((x );rAi)((x );rB).

Base: ((x);rA0)=0((x );rB).

Hypothesis: Suppose((x );rAn?1)((x );rB). Step: ((x );rAn)=v >0

=) there exists a variantr(x ) f &q1(x1)&::: & qk(xk)of a clause inPFs.t.v=fminf((x1);q1An?1);:::;((xk);qkAn?1)g

and2[[]]An?1, by Denition 7

=) ((x1);q1B)((x1);q1An?1);

:::;((xk);qkB)((xk);qkAn?1)and2[[]]B, by the hypothesis

=) ((x );rB)v, sinceBis a model ofPF

=) ((x );rAn)((x );rB).

(11)

For v=0follows immediately((x );rAn)((x );rB).

Claim (iii) follows by arithmetic induction. ut

Proposition 1 allows us to link the declarative description of the desired output fromPFand a goal, i.e., a PF-answer, to the minimal model semantics of PF. This is done by connecting the concept of logical consequence with the concept of minimal model.

Proposition 1.

LetPFbe a quantitative denite clause specication inR(L), 'be anL-constraint andGbe a goal. Then'v!Gis a logical consequence of

P

Fi every minimal modelAofPFis a model off'v!Gg.

Proof. if: For each minimal modelAof PF:Ais a model off'v!Gg

=) for every base equivalent model B ofPF: B is a model off'v!Gg, sinceAB by Theorem 1, (iii)

=) 'v!Gis a logical consequence of PF. only if: 'v!Gis a logical consequence ofPF

=) every model ofPFis a model off'v!Gg, by Denition 6

=) Ais a model off'v!Gg. ut

The following toy example will illustrate the basic concepts of the declarative semantics of quantitative denite clause specications.

Example 1. Consider a simple program PFconsisting of clauses1,2and3. Let for the sake of the example be[[X =&X= ]]I =;for eachL-interpretation

I.

1p(X) :7X=.

2p(X) :5X=.

3p(X) :9X= .

APF-chain for predicatepand an object(X)allowed by theL-constraint X =is constructed as follows.

(h(X)i;pA0)=0,

(h(X)i;pA1)=maxf:7min;;:5min;g=:7, (h(X)i;pA2)=maxf:7min;;:5min;g=:7, ...

The membership value of this object in the denotation ofpunder the minimal model AofPFis attained in step 1 and calculated as follows.

(h(X)i;pSi0Ai)=supf0;:7;:7;:::g=:7.

Clearly,Ais a model of clauses1 and 2. A similar calculation can be done for clause3.

(12)

3.2 Operational Semantics of Quantitative Denite Clause Specications

The proof procedure for quantitative CLP is a search of a tree, corresponding to the search of an SLD-and/or tree in conventional logic programming and CLP.

Such a tree is dened with respect to the inference rules?r!and?c!of [11] and a specic calculation of node values. The structure of such a tree exactly reects the construction of a minimal model and thus may be dened as a min/max tree.

In the following we will assume implicit constraint languagesLandR(L)and a given quantitative denite clause specicationPFin R(L). Furthermore,Vwill denote the nite set of variables in the query and the V-solutions of a constraint in an interpretation Iare dened as[[]]IV :=fjVj2[[]]IgandjV is the restriction ofto V.

The rst inference rule is given by a binary relation?r!, called goal reduc- tion, on the set of goals.

A & G?r! F &G ifA F is a variant of a clause in P s.t.(V[V(G))\V(F)V(A).

A second rule takes care of constraint solving for theL-constraints appearing in subsequent goals. The rule takes the conjunction of the L-constraints from the reduced goal and the applied clause and gives, via the black box of a suitable

L- constraint solver, a satisable L-constraint in solved form if the conjunction ofL-constraints is satisable. The constraint solving rule can then be dened as a total function?c!on the set of goals.

&0 &G ?c! 00 &G if[[&0]]IV [V (G)=[[00]]IV [V (G)

for eachL-interpretationI and for allL-constraints;0 and00.

Denition 8 (min/max tree).

A min/max tree determined by a query G1 and a quantitative denite clause specication PFhas to satisfy the following conditions:

1. Each max-node is labeled by a goal. The value of each nonterminal max-node is the maximum of the values of its descendants.

2. Each min-node is labeled by a clause from PFand a goal. The value of each nonterminal min-node isf m, where f is the factor of the clause and m is the minimum of the values of its descendants.

3. The descendants of every max-node are all min-nodes s.t. for every clause Cwith ?r!-resolvent G0 obtained byC from goal Gin a max-node, there is a min-node descendant labeled byC andG0.

4. The descendants of every min-node are all max-nodes s.t. for every R(L)- atomr(x )in goalG&&0 in a min-node with?c!-resolventG&00, there is a max-node descendant labeled byr(x )&00.

5. The root node is a max-node labeled by G1.

6. A success node is a terminal max-node labeled by a satisable

L-constraint. The value of a success node is 1.

Referenzen

ÄHNLICHE DOKUMENTE

  Arc consistency does not guarantee that all possible combinations of domain values are solutions to the constraint problem..   Possibly no combination of values from reduced

[r]

While the satis- faction conditions for state constraints enforce the correctness of values in the problem space (if a relevant state constraint is unsatisfiable, then something in

We introduced a casual employee scheduling problem arising in an Austrian as- sociation, where employees have to be assigned to shifts to satisfy demands at locations for a

We assume the following sorts: FieldId for field identifiers, MethodId for method identifiers, CTypeId for class type identifiers, ITypeId for interface type identifiers, VarId

A Proof System for Higher-Order Logic 4.1 Methods and Rules.. 4.2 Rewriting

Program Verification 8.3 Formalization and soundness of the Hoare logic..

We presented three stepwise optimizations of a high-level declarative CLP program com- puting the solutions of a constraint satisfaction problem specifying ranking functions that