1 / 12

2. Constraint Databases

2. Constraint Databases. Next level of data abstraction: Constraint level – finitely represents by constraints the logical level. 2.1 Constraints Arithmetic Atomic Constraints Equality: u = v

alicedow
Download Presentation

2. Constraint Databases

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 2. Constraint Databases Next level of data abstraction: Constraint level– finitely represents by constraints the logical level

  2. 2.1 Constraints Arithmetic Atomic Constraints Equality: u = v Inequality: u ≠ v Lower bound: u ≥ b Upper bound: – u ≥ b Order: u ≥ v Gap-order: u – v ≥ b where b ≥ 0 Difference: u – v ≥ b

  3. Half-Addition: ± u ± v ≥ b where b ≥ 0 Addition: ± u ± v ≥ b Linear: c1x1 + ……+ cnxn ≥ b Polynomial: p( x1,……..,xn ) ≥ b Note: Instead of ≥ we can also use >

  4. Boolean Atomic Constraints Boolean Algebra < D, Λ, V, ‘, 0, 1 > D – domain, 0 – zero element, 1 – one element. such that the following axioms hold:

  5. Commutative: x V y = y V x x Λ y = y Λ x Distributive: x V ( y Λ z ) = ( x V y ) Λ ( x V z ) x Λ ( y V z ) = ( x Λ y ) V ( x Λ z ) Inverse: x V x’ = 1 x Λ x’ = 0 Zero and one element properties: x V 0 = x x Λ 1 = x 0 ≠ 1

  6. Boolean equality constraints: T =B 0 Boolean inequality constraints: T ≠B 0 where T is a Boolean term built from domain elements and operations of the boolean algebra. Example: ( x’ Λ z ) V ( y Λ z ) V ( x Λ y’ Λ z’ ) =B 0

  7. Constraint Formulas: • each atomic constraint • if F and G are formulas, then (F and G) is a formula and (F or G) is a formula. • if F is a formula, then (not F) is a formula.

  8. Let F(x1,…,xn) be a formula with n rows, t = (c1,…,cn) a tuple with n constants. t satisfies F (t F) – substituting each xi by ci makes F true.

  9. Interpretation of free Boolean algebra: Symbols are interpreted to be concrete operators or values. Example: D – all subsets of 1 Λ – intersection V – union ‘ – complement 0 – emptyset 1 – set of names of all animals {cat, dog, parrot,…} Question: What would be the meaning of the example Boolean constraint under this interpretation ?

  10. Constants in constraints are also interpreted Example: Suppose we have the constraint b Λ m = 0 and we interpret b as {canary, parrot, falcon} m as {cat, dog} Question: Is the Boolean constraint true under this interpretation ?

  11. 2.2 The Constraint Data Model Constraint relation – a finite set of constraint tuples. Constraint tuples – tuples with variables and constraints that restrict the variables. Example: ( i, t : 0 ≤ i , i ≤ 24000, t = 0.15 i ) is a constraint tuple of Taxtable(Income, Tax). It means that the tax is 15% on any income below $24,000.

  12. 2.3 Data Abstraction Logical level – infinite relation r, tuple t Constraint level – finite relation R, constraint tuple C, t є r iff t |= C for some C є R Physical level – the way the data is actually stored in the computer system

More Related