Algorithm for reduction of Element Calculus to Element Algebra

Similar documents
Our focus will be on linear systems. A system is linear if it obeys the principle of superposition and homogenity, i.e.

Excess Error, Approximation Error, and Estimation Error

Computational and Statistical Learning theory Assignment 4

04 - Treaps. Dr. Alexander Souza

Denote the function derivatives f(x) in given points. x a b. Using relationships (1.2), polynomials (1.1) are written in the form

The Parity of the Number of Irreducible Factors for Some Pentanomials

1 Definition of Rademacher Complexity

ON THE NUMBER OF PRIMITIVE PYTHAGOREAN QUINTUPLES

Quantum Particle Motion in Physical Space

find (x): given element x, return the canonical element of the set containing x;

A CLASS OF RECURSIVE SETS. Florentin Smarandache University of New Mexico 200 College Road Gallup, NM 87301, USA

On the set of natural numbers

System in Weibull Distribution

Finite Fields and Their Applications

Xiangwen Li. March 8th and March 13th, 2001

NOTES FOR QUANTUM GROUPS, CRYSTAL BASES AND REALIZATION OF ŝl(n)-modules

Applied Mathematics Letters

6. Stochastic processes (2)

6. Stochastic processes (2)

Appendix B. Criterion of Riemann-Stieltjes Integrability

Multipoint Analysis for Sibling Pairs. Biostatistics 666 Lecture 18

On Pfaff s solution of the Pfaff problem

COS 511: Theoretical Machine Learning

Gradient Descent Learning and Backpropagation

1 Matrix representations of canonical matrices

PHYS 705: Classical Mechanics. Calculus of Variations II

Lecture 21: Numerical methods for pricing American type derivatives

Two Conjectures About Recency Rank Encoding

Least Squares Fitting of Data

Multiplicative Functions and Möbius Inversion Formula

Chapter 13. Gas Mixtures. Study Guide in PowerPoint. Thermodynamics: An Engineering Approach, 5th edition by Yunus A. Çengel and Michael A.

What is LP? LP is an optimization technique that allocates limited resources among competing activities in the best possible manner.

XII.3 The EM (Expectation-Maximization) Algorithm

Time and Space Complexity Reduction of a Cryptanalysis Algorithm

Designing Fuzzy Time Series Model Using Generalized Wang s Method and Its application to Forecasting Interest Rate of Bank Indonesia Certificate

APPENDIX A Some Linear Algebra

Ballot Paths Avoiding Depth Zero Patterns

A Radon-Nikodym Theorem for Completely Positive Maps

Solving Fuzzy Linear Programming Problem With Fuzzy Relational Equation Constraint

Finite Vector Space Representations Ross Bannister Data Assimilation Research Centre, Reading, UK Last updated: 2nd August 2003

Solutions for Homework #9

Least Squares Fitting of Data

Canonical transformations

On the number of regions in an m-dimensional space cut by n hyperplanes

Introducing Entropy Distributions

Foundations of Arithmetic

An Optimal Bound for Sum of Square Roots of Special Type of Integers

Special Relativity and Riemannian Geometry. Department of Mathematical Sciences

Inner Product. Euclidean Space. Orthonormal Basis. Orthogonal

Week 2. This week, we covered operations on sets and cardinality.

Revision: December 13, E Main Suite D Pullman, WA (509) Voice and Fax

Representation theory and quantum mechanics tutorial Representation theory and quantum conservation laws

AN ANALYSIS OF A FRACTAL KINETICS CURVE OF SAVAGEAU

Turing Machines (intro)

1 Generating functions, continued

PARTITIONS WITH PARTS IN A FINITE SET

Lecture 12: Discrete Laplacian

Chapter 12 Lyes KADEM [Thermodynamics II] 2007

Slobodan Lakić. Communicated by R. Van Keer

Math Review. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University

1. Statement of the problem

Affine transformations and convexity

arxiv: v2 [math.co] 3 Sep 2017

NP-Completeness : Proofs

International Journal of Mathematical Archive-9(3), 2018, Available online through ISSN

SL n (F ) Equals its Own Derived Group

DISCRIMINANTS AND RAMIFIED PRIMES. 1. Introduction A prime number p is said to be ramified in a number field K if the prime ideal factorization

U.C. Berkeley CS294: Beyond Worst-Case Analysis Luca Trevisan September 5, 2017

Outline. Bayesian Networks: Maximum Likelihood Estimation and Tree Structure Learning. Our Model and Data. Outline

Need for Probabilistic Reasoning. Raymond J. Mooney. Conditional Probability. Axioms of Probability Theory. Classification (Categorization)

More metrics on cartesian products

Expected Value and Variance

Problem Set 6: Trees Spring 2018

Differential Polynomials

10-701/ Machine Learning, Fall 2005 Homework 3

An Introduction to Morita Theory

INPUT-OUTPUT PAIRING OF MULTIVARIABLE PREDICTIVE CONTROL

Descriptional Complexity of Determinization and Complementation for Finite Automata

Lecture 3 January 31, 2017

Compilers. Spring term. Alfonso Ortega: Enrique Alfonseca: Chapter 4: Syntactic analysis

CHAPTER 10 ROTATIONAL MOTION

Complete subgraphs in multipartite graphs

First day August 1, Problems and Solutions

C/CS/Phy191 Problem Set 3 Solutions Out: Oct 1, 2008., where ( 00. ), so the overall state of the system is ) ( ( ( ( 00 ± 11 ), Φ ± = 1

Introductory Cardinality Theory Alan Kaylor Cline

On quasiperfect numbers

The Order Relation and Trace Inequalities for. Hermitian Operators

Structure and Drive Paul A. Jensen Copyright July 20, 2003

Introduction to Algorithms

Solutions to exam in SF1811 Optimization, Jan 14, 2015

ALGEBRA MID-TERM. 1 Suppose I is a principal ideal of the integral domain R. Prove that the R-module I R I has no non-zero torsion elements.

MATH 829: Introduction to Data Mining and Analysis The EM algorithm (part 2)

Graph Reconstruction by Permutations

CHAPTER 6 CONSTRAINED OPTIMIZATION 1: K-T CONDITIONS

Implicit Integration Henyey Method

Preference and Demand Examples

Yong Joon Ryang. 1. Introduction Consider the multicommodity transportation problem with convex quadratic cost function. 1 2 (x x0 ) T Q(x x 0 )

The Impact of the Earth s Movement through the Space on Measuring the Velocity of Light

ON SEPARATING SETS OF WORDS IV

FACTORIZATION IN KRULL MONOIDS WITH INFINITE CLASS GROUP

Transcription:

Algorth for reducton of Eleent Calculus to Eleent Algebra Introducton M. Manukyan, V. Harutunyan The XML databases currently act defnte nterest aong researchers of databases for the followng reasons: 1. DTD s a coprose between the strct-schea odels such as the relatonal or object odels and the copletely schealess world of se-structured data, 2. In contrast to se-structured data odel, the concept of database schea n the sense of conventonal data odels s supported, 3. In contrast to conventonal data odels strct-scheas, there s possblty to defne ore flexble database scheas (DTD s often allow optonal felds or ssng felds, for nstance) [4]. It s coon n database theory to translate a query language nto an algebra. The XML algebra s used to: 1. Defne seantcs of a query language, 2. Analyze power of ts expressons, 3. Perfor optzaton of queres. There are any approaches n lterature to solve the query proble over XML DB [for exaple, 1,3,5,8,9]. In ths paper we consder an algorth for reducton of eleent calculus [6] to eleent algebra [7]. Prelnares Eleent Calculus: Eleent calculus forulas (sply forulas) are used to gve assertons (e.g., consstency constrants of xd-database to support vrtual eleents and trggers, to express declaratve queres to xd-database. To specfy forulas a varant of the ultsorted frst order predcate logc language s used. Notce that eleent calculus s developed n the style of object calculus. If e s a path expresson (e) s the result of ths path expresson converted to ultset. The atos are defned accordng to the followng rules: ( e )( x1, x2,..., x k ) s an ato, where k ] x s eleent calculus varable. y1θ y2, where y 1, y 2 are ters, θ { =,, >,, <, }. Assung that ψ, ψ 1 and ψ 2 are forulas, the followng expressons wll be forulas: ψ, ψ 1 ψ 2, ψ 1 ψ 2, ψ 1 ψ 2, x( ψ x( ψ ( ψ ) x : = e, ( groupby( x1, x2,..., xk, ψ ( x), dstnct( ψ ) orderby( x ord x ord,..., xk ord, ψ ψ wth dentfcatonlst 1, 2 Algebrac Model: To drectly apply the standard algebrac operatons to xd-eleents we need: foralze the xd-eleent n coplance wth the theory of relatonal databases, defne the nference rules of the resultng scheas of algebrac expressons, prove equvalence of eleent calculus to eleent algebra.

Defnton 1: We say that S s an xd-eleent schea, f S = nae, atoctype, f, where f {?,*, +, }, or S = nae typeop( S, S,..., S n ), f, typeop { sequence, choce, all}, S s an xd-eleent schea, 1 n. Defnton 2: The xd-eleent s of schea S s a fnte collecton of S doan frstcop S doan sec ondcop S ; appngs ( ( ( ( f ondcop ( S ) typeop( S, S,..., ) and sec = S n the followng constrant should be hold for all e s : e[ S ] doan( S 1 n. The frstcop, sec ondcop, doan functons have an obvous seantcs n the prevous defnton. Notce that doan ( sec ondcop( S = ( f sec ondcop( S ) = atoctype valset n = 1 ( atoctype) else doan ( ) S. Defnton 3: Let R and Q be xd-eleents scheas. We say that R and Q are slar, f sec ondcop ( R) atoctype1,sec ondcop( Q) = atoctype2, = and atoctype 1 = atoctype2, or ondcop ( R) typeop( R, R,..., R sec ondcop( Q) = typeop( Q, Q,..., Q sec = n n and R, Q are slar, 1 n. att book2 book1 slar sequence att att sequence app OneorMor ttle type strng author type strng ttle2 type strng author type strng Defnton 4: Let R and Q be xd-eleents scheas. We say that R s subschea of Q ( R Q), f frstcop ( R) = nae1,sec ondcop( R) = atoctype1, frstcop( Q) = nae 2, sec ondcop ( Q) = atoctype 2, and nae 1 = nae 2, atoctype1 = atoctype 2, or frstcop( R) = nae1,sec ondcop( R) = typeop( R1, R2,..., Rk frstcop( Q) = nae 2, ondcop ( Q) = typeop( Q, Q,..., Q and nae 1 = nae 2, and k] j ] sec 2 that R Q. j 1

book subschea book type app sequence app sequen att OneorMore ttle type strng ttle type strng author type strng author type strng Defnton 5: Let r and q be xd-eleents wth R and Q slar scheas correspondngly. Let us say that r and q are equal, f sec ondcop ( R) sec ondcop( Q) = atoctype, content ( r) = content( q or sec ondcop ( R) = typeop( R1, R2,..., Rn sec ondcop ( Q) = typeop( Q1, Q2,..., Qn ): a) typeop = sequance n] frstcop( R ) = frstcop( ) = and, Q, and xd-eleents wth slar scheas R and Q correspondngly, b) typeop = all, n] j n] frstcop( R ) = frstcop( Q j and equal xd-eleents wth slar scheas R and c) typeop = choce, there s a unque [ 1, n] unque j [ 1, n] R frstcop frstcop = Q j, and : ( ) ( ) wth slar scheas Algorth Descrpton R and Q j correspondngly. Algorth: ECToEA (ec, ea) Input: ec - a forula of eleent calculus. Output: ea - an equvalent expresson of eleent algebra for ec. Method: Step1. Create prefx representaton for ec. Step2. Create Eleent Calculus tree. Step3. Create Eleent Algebra tree. Q j correspondngly, r and q are equal r and q j are such that the followng holds for soe r and Create the prefx representaton for an expresson of Eleent Calculus. Eleent Calculus tree creaton. Algorth: CreateECTree (eprefx, ECTree) Input: eprefx - a prefx expresson of eleent calculus forula. q j are equal xd-eleents

Output: ECTree - an equvalent eleent calculus tree. Step1. [Tree creaton] (a) If current token s and, or, plcaton, create correspondng node based on recursvely created left and rght subtrees. (b) If current token s ether wth, forall, exst, negaton, dstnct, groupby or orderby, create correspondng node and recursvely create ts subtree (operand (s) of operaton). (c) If current token s predcate, assgnent, xpath, create correspondng node and coplete recurson for ths subtree (operand (s) of operaton). Step2. [Tree traversal] (a) For each assgent node ove to the root untl a subtree whch set of free varables contans the varables set of consdered assgnent wll be found. (b) For each predcate node ove to the root untl a subtree whch set of free varables contans the varables set of consdered predcate wll be found. Step3. [Elnaton of the negaton nodes fro eleent calculus tree] For each negaton do For each node apply the negaton operaton. For the xpath nodes do: If there s a predcate n xpath negate the predcate, else ove to the root fro the current leaf untl the frst or node wll be reached, delete the subtree contanng the consdered leave, delete or node and lnk t wth the other subtree of ts parent. Creaton of Eleent Algebra tree. Algorth: Algebra (ECTree, EATree) Input: ECTree - an Eleent Calculus tree. Output: EATree - an Eleent Algebra tree. [Tree traversal] (a) If ( pe )( x1, x2,..., xk ( pe) = [/ //] Step0 [/ //] Step1... [/ //] Stepn Step = ( f condton not gve π L ( Step else +1 ( ) f condton s sple predcate π σ ( ) else σ γ ( Step ) L ρ Step = 0,1,..., n 1, Step0 = ntal xd eleent. (b) If ω( y 1, y2,..., y ) = ω1( u1, un ) ω2( v1, vl ) 1. If { u 1,,..., un} { v1,,..., vl } = A lg ebra( ω 1( u1,,..., un Alg ebra( ω2 ( v1,,..., v l 2. If { u 1,,..., u n } = { v1,,..., v l } A lg ebra( ω1( u1,,..., un Alg ebra( ω2 ( v1,,..., v l 3. If { u 1, u n } { v1, v l }, { v1, v l } { u1, u n } { u 1,,..., un} { v1,,..., vl } = v l 4. If { u 1, u n } { v1, v l } v l 5. If { v 1, v l } { u1, u n } v l (c) If ω( y y,..., y ) = ω ( u, u,..., u ) ( v, v,..., v ) and 1, 2 1 n ω2 l L ( ( ) π ρ, L

π y, y,..., y ( Alg ebra( ω ( u, u,..., un ) y y y ( Alg ebra( ( v, v,..., vl ) 1 π 1, 2,..., ω 2 (d) If ω ( y1, y2,..., y ) = ( y+ 1) ω( y1, y2,..., y, y+ 1) π y,,..., ( lg ( ( 1, 2,...,, 1) 1 y2 y A ebra ω y y y y + (e) If ω ( y1, y2,..., y ) = ( y+ 1) ω( y1, y2,..., y, y+ 1) Alg ebra( ω ( y1, y2,..., y, y+ 1) ) π y ( Alg ebra( ω( y1, y2,..., y, 1) +1 y + (f) If groupby( y1, y2,..., y, ω ( y1, y2,..., y, u1,,..., un ( x) γ x x x ( Alg ebra( ( y, y,..., y, u, u,..., un ) 1, 2,..., ω k (g) If orderby( y order, y order,..., y order, ω ( y, y,..., y 1 2 l τ y y y ( A ebra( ( y y y ), lg,,...,,..., ω l (h) If dstnct ( ω ( y y,..., δ ( A ebra( ω( y, y,..., ) () If 1, 2 y dentfca tonlst ρ (j) If predcate (k) If assgnent Algorth Correctness σ predcate π assgnentattrbutes lg The correctness of the suggested algorth s proved n the sae way as correctness of Codd s algorth [2] for reducton the relaton calculus to relatonal algebra as: Op ψ = Op ψ, Op wth, dstnct, groupby, orderby, assgnent. ( ) ( ) { } References 1. D. Beech, A. Malhotra & M. Rys (eds.) A foral data odel and algebra for XML. Councaton W3C, 1999. 2. E. F. Codd. Relatonal Copleteness of Data Base Sublanguages, Data Base Systes, R. Rustn (ed. Prentce Hall, 1972. 3. F. Frasncar, Geert-Jan Houben, C. Pau. XAL: an Algebra for XML Query Optzaton. In Proc. of 13th Australasan Database Conference, 2002. 4. H. Garca-Molna, J. Ullan, J. Wdo, Database Systes: The Coplete Book, Prentce Hall, 2002. 5. H. V. Jagadsh, et. al. TAX: A Tree Algebra for XML, In Proc. DBLP Conference Italy, 2001. 6. M.G.Manukyan, Extensble Data Model, In Proc. of ADBIS 08 Conference, pp. 42-57, 2008. 7. Manukyan M. G., Eleent Algebra. In Proc. of ADBIS'09, LNCS 5968, Sprnger, pp. 113-120, 2009.. 8. J. Shanugasundara, K. Tufte, G. He, C. Zhang, D. DeWtt, and J. Naughton, Relatonal Databases for Querng XML Docuents: Ltatons and Opportuntes. In Proc. VLDB Conference, pp. 47-52, 2000. 9. S. D. Vglas, et. al. Puttng XML Query Algebras nto Context, 2002, http://www.cs.wsc.edu/nagara/publcatons.htl. 10. M. Zhang, J. T. Yao. XML Algebra for Data Mnng, In Proc. SPIE'04, 2004. y