1.3. OBJETIVOS
2.2.4 EFECTO JURÍDICO DEL TESTIMONIO DEL PERITO CONTABLE EN
2.2.4.2 La duda a favor del reo
Given an XChange programP, the Web queriesQofP’s reactive rules are Xcerpt queries, that is conjunc- tions (denotedand{Q1,...,Qn},Q1∧ · · · ∧Qnor byV1≤i≤nQi), disjunctions (denotedor{Q1,...,Qn},
Q1∨ · · · ∨Qnor byW1≤i≤nQi) or negation (denotednot Qor by¬Q.) of query terms ofTq. Also, the deductive rulesDrkof the formtkc←Qkpart ofPare Xcerpt rules. The aim ofP’s deductive rules is to ”provide” (inferred or transformed) data for the Web queriesQ. This section presents the underlying ideas of the declarative semantics of the query language Xcerpt and shows how this fits into the framework of XChange.
A model theory for the query language Xcerpt has been developed (see [125], Chapter 7), which fol- lows the approach of classical Tarski-style semantics for first order logic. However, the distinctive fea- tures (such as the grouping constructs in the head of the rules and partial specifications of queries) of the
CHAPTER 5. SEMANTICS language Xcerpt entailed considerable differences from the classical logic. Classical logic differentiate betweenterms(representing objects) andatomic formulas(representing statements about objects); though, Xcerpt terms are atomic formulas expressing the statement that the respective term exists. Informally, an interpretationis a set of data terms that specifies what data terms exist and amodelis an interpretation containing the terms inferred by the given Xcerpt rules.
The model theory of Xcerpt considers Xcerpt programs (sets of Xcerpt rules) as formulas. Query, construct, and data terms, and⊥(falsity) and>(truth) are constituents of atomic formulas. The connectives ∨,∧,⇒,⇔, and¬, and the quantifiers∀and∃are used for constructing compound formulas. Atomic and compound formulas built this way are calledterm formulas. The formula representation of a set of rules{Dr1, . . . ,Drp}is the conjunction of the formula representation of eachDrk and of the data terms that represent the specified resources as internalised (data terms are considered part of the program). The grouping constructs need special treatment and, thus, symbols · are used for denoting the scope of all grouping constructs contained in the rules.
Example 5.1 (Formula Representation of Xcerpt Rules) Consider the following set of Xcerpt rules:
a{all var X, var Y} ← and{ b{{var X}}, c{{ d{var X,var Y} }} } b[ var X ] ← c{{ d[var X] }}
c[ d[e,f], d[g,h] ]
The above given set of rules is represented as formula as follows:
∀ Y a{all var X, var Y} ← b{{var X}} ∧ c{{ d{var X,var Y} }} ∧ ∀ X b[ var X ] ← c{{ d[var X] }} ∧
c[ d[e,f], d[g,h] ]
Interpretations An interpretation is a tupleM= (I,Σ): I is a set of data terms of Td andΣ6= /0 is a
grounding substitution set, i.e. provides assignments for all variables with at least one defining occurrence in the formulas considered.
Satisfaction and Models An atomic formulaF is considered to be satisfied in interpretationM if and only if its ground instance (obtained by applying the substitutions ofΣtoF) simulates into a term ofI. The satisfaction of a term formula (i.e. atomic or compound formula) is defined recursively over its structure. The following definition is taken from [125], Section 7.4.2, on pages 151-152:
Definition 5.5 (Satisfaction, Model)
1. LetM= (I,Σ)be an interpretation (i.e. a set of data termsIand a substitution setΣ), and lettbe a
construct or query term.
The satisfaction of a term formulaFinM, denoted byM|=F, is defined recursively over the structure
ofF:
M|=> holds M|=⊥ does not hold
M|=t iff for allt0∈Σ(t)there exists a termtd∈Isuch thatt0td
M|=¬F iff M6|=F
M|=F1∧ · · · ∧Fn iff M|=F1and . . . andM|=Fn
M|=F1∨ · · · ∨Fn iff M|=F1or . . . orM|=Fn
M|=F⇒G iff M|=¬F∨G
M|=∀x.F iff for allt∈Iholds thatM0 = (I,Σ0) |= F,
whereΣ0=σ
◦ {x7→t} |σ∈Σ
M|=∃x.F iff there exists at∈Isuch thatM0 = (I,Σ0) |= F,
whereΣ0=σ
◦ {x7→t} |σ∈Σ
M|=∀∗tc←Q iff M0= (I,Σ0)|=tcfor a maximal grounding substitution setΣ0 forQ
withM0|=Q
2. If a formulaFis satisfied in an interpretationM, i.e.M|=F, thenMis called amodelofF.
5.1. DECLARATIVE SEMANTICS
Notethat in the definition above∀∗is used to universally quantify all free variables in a formula. Given an Xcerpt programPr, a model forPris an interpretation(I,Σ)whereIcontainsalldata terms
that are inferred (or produced) by the rules ofPr.NotethatImay contain also data terms that are unrelated toPr. A concrete example for satisfaction of Xcerpt programs is given in [125], Chapter 7, pages 152- 153. However, the focus in this section is on the parts of XChange programs that are expressed in Xcerpt. Recall that an XChange program has the formP={Rr1, . . . ,Rrm,Tr1, . . . ,Trn,Dr1, . . . ,Drp}, whereRri, 1≤i≤mandTr j, 1≤j≤nare reactive rules that may have ’condition parts’ specifying Xcerpt queries. Also,Drk, 1≤k≤pare Xcerpt rules. ConsiderQl, 1≤l≤m+nthe Xcerpt queries associated with the reactive rules ofP. The interest is on the satisfaction of the formulas of the form:
Ql∧V
1≤k≤m+n∀∗tkc←Qrk ∧dh , 1≤l≤m+n ,
whereDrk is of the form tkc←Qrk , for 1≤k≤panddh∈Td are data terms that represent the internalised Web resources that are specified in the queries.Notethat the interest for XChange programs is not on the conjunctionV
1≤l≤m+nof the formulas given above. As the definition 5.5 covers also formulas of the form given above, the semantics of the ’condition parts’ of XChange reactive rules is given by the model theoretical approach of Xcerpt.
Example 5.2 (Formula Representation of XChange Condition Parts and Deductive Rules) Consider an XChange programPthat consists of the following rules:
<transaction_spec> ←r a {{ var Z }} ←r <event_query>
a{all var X, var Y} ← and{ b{{var X}}, c{{ d{var X,var Y} }} } b[ var X ] ← c{{ d[var X] }}
c[ d[e,f], d[g,h] ]
NotethatPcontains one transaction rule whose event query and transaction specification are not specified as they do not contribute to the formula representation of Web queries and deductive rules. The deductive rules ofPare the Xcerpt rules of Example 5.1 with a slight modification of the data term. The above given ’condition part’ and set of deductive rules is represented as formula as follows:
a {{ var Z }} ∧
∀ Y a{all var X, var Y} ← b{{var X}} ∧ c{{ d{var X,var Y} }} ∧ ∀ X b[ var X ] ← c{{ d[var X] }} ∧
c[ d[e,f], d[g,f] ]
A fixpoint semantics for Xcerpt programs without negation is proposed in [125], Chapter 7, Section 5. A fixpoint operatorTPis defined by applications of which a fixpoint for Xcerpt programs is iteratively constructed. It is proved that the fixpoint of a program is also a model of the program (Theorem 7.10 on page 155).