1 / 80

Constraint Databases and Temporal Reasoning

Constraint Databases and Temporal Reasoning. Peter Revesz. University of Nebraska-Lincoln. Constraint Database. A generalization of relational database A set of constraint tables/relations Each constraint table consists of a set of constraint tuples

neylan
Télécharger la présentation

Constraint Databases and Temporal Reasoning

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. Constraint Databases and Temporal Reasoning Peter Revesz University of Nebraska-Lincoln

  2. Constraint Database • A generalization of relational database • A set of constraint tables/relations • Each constraint table consists of a set of constraint tuples • Each constraint tuple is a conjunction of allowed types of constraints over a set of variables and parameters

  3. Example Constraint Databases • Linear Constraint Databases (any conjunction of linear constraints over the attribute variables) • Parametric Rectangles • Periodic Parametric Rectangles • Parametric 2-Spaghetti • Geometric Transformations • etc

  4. Parametric Rectangles (P□) Scheme: (X, Y, T) Variables: x, y, t Constraints: x >= a1 t + b1 x <= a2 t + b2 y >= c1t + d1 y <= c2 t + d2 from ≤ t ≤ to

  5. Example: Parametric Rectangle

  6. Periodic Parametric Rectangle A PP□ is a parametric rectangle that repeats its motion every period (p) until t = end (e) • A PP□ is equivalent to a P□ when p = -1 • [from,to]p,end • Exa: [80,82]10,111 means union of [80,82], [90,92], [100,102], [110,111]

  7. Exa: Periodic Parametric Rectangle t’ = t mod 5

  8. N-dimensional PP □

  9. Parametric 2-Spaghetti • Constraint Level: • Scheme 1: (Ax, Ay, Bx, By, Cx, Cy, From, To) • Parameter: t • Scheme 2: (X, Y, T) • Variables: x, y, t • Conjunction of constraints over x, y, t that define a changing triangle ABC • Logical Level: • Variables: x, y, t • Tuples (x,y,t) such that (x,y) is in ABC at time t

  10. Expressive Power PP□ P∆

  11. Geometric Transformations [Chomicki & Revesz Time’99] • A triple (V, I, f) • V is d dimensional representative spatial object • I is time domain • f is V x t  V’, parametric geometric transformation function that maps the V at any time t in I to some V’ d dimensional spatial object.

  12. Exa: Geometric Transformation • Whale(V, I, f) where • V = [20, 30] x [20, 30] • I = [0, 20] • x -t f(x, y, t) = + y 0 Any (x,y) at time t is mapped to (x-t, y). The whale moves west with 1 unit speed.

  13. Interoperability of Data Models

  14. Raster  Parametric Rectangle • given the initial and final snapshots at time ti and tf • first, rectangulate the smaller snapshot: • next, rectangulate the bigger snapshot, ensuring that both have the same number of rows of rectangles

  15. Queries use the logical level Constraint level is for storage. Since logical level is the same*** as for relational databases, relational queries are possible. ***except the logical level can beinfinite set of points for constraint database

  16. Constraint Query Languages • Relational algebra • SQL Max op in LCDB  linear programming • Datalog • Spatial operators: Area, Buffer, etc. • Spatio-temporal operators: Animation (visualization by video) Block (find movement when …) Collide (find movement bouncing …) Deflect (find movement in gravitational field…) etc.

  17. A Query for Parametric Rectangles • Region(X, Y, T, temperature) • Clouds(X, Y, T, humidity) • Where and when will it snow? Relational algebra: PROJECT x,y,t (SELECT(temperature < 32) Region)  PROJECT x,y,t (SELECT(humidity > 80) Clouds)

  18. SQL: SELECT x, y, t FROM Region WHERE temperature < 32 INTERSECT SELECT x, y, t FROM Clouds WHERE humidity > 80 Datalog: Snow (x, y, t) : - Region(x, y, t, temperature), Clouds(x, y, t, humidity), temperature < 32, humidity > 80

  19. A Query for Parametric 2-Spaghetti • Region(Ax, Ay, Bx, By, Cx, Cy, F, T,temperature) • Clouds(Ax, Ay, Bx, By, Cx, Cy, F, T, humidity) • Where and when will it snow? Same as before

  20. Query Language Issues • High-level, user-friendly • Expressiveness • Termination • Closed-Form • Complexity Data complexity: fixed queries (as in a library/menu) and variable size input relations

  21. Theorem: Parametric Rectangles are Closed under Relational Algebra Queries Proof: Intersection R1 = ( [t+6, t+20], [5, 15], [0, 10] ) R2 = ( [2t, 3t+10], [0, 10], [0, 10] ) 0  t < 5 5  t < 6 6  t  10

  22. Complement of a Parametric Rectangle

  23. Theorem: Relational algebra can be evaluated in PTIME data complexity forParametric Rectangle Databases. Similar theorems for other combinations of constraint databases and query languages.

  24. Spatial Operators • Area Operator • computes the area of a relation R at a time ti • denoted by area (R, ti)

  25. Animation • Look at the examples.

  26. Other Spatiotemporal Operators • Block Operator • computes the change in a relation R2, as a result of being “blocked” by R1, until the time tk • denoted by block (R1, R2, tk) • if we view a parametric rectangle as a set of moving points, it can be defined as the set of moving points in R2 that did not intersect with R1 before tk

  27. Other Spatiotemporal Operators • Block Operator (contd.) • the second figure shows the result of difference operation and the third shows the result of block operation at t = 15

  28. Other Spatio-temporal Operators • Block Operator (contd.) • evaluation • instantiate R1, R2 at tk • successive partitioning • maximum depth

  29. Other Spatio-temporal Operators • Collide Operator • computes the result of a collision between two (moving) parametric rectangles (which do not grow or shrink) • denoted by collide (r1, r2) • assume that the collision is elastic • view the parametric rectangles as spherical bodies, with given fixed masses

  30. Other Spatio-temporal Operators • Collide Operator (contd.) • determine line joining centers (LC) at time of collision • resolve velocities along LC

  31. Other Spatio-temporal Operators • Collide Operator (contd.) • initial velocity (Vi) • LC velocity before collision (ViLC) • LC velocity after solving “head-on” collision (VfLC) • final velocity (Vf) = vector sum of [VfLC - ViLC, Vi] • PReSTO System Simulation

  32. PReSTO System • PReSTO System • Parametric Rectangles as SpatioTemporal Objects • Visual C++ implementation • GUI Queries • operator icons provided on the interface Other systems: CCUBE, DEDALE, MLPQ, etc.

  33. Uses of Constraint Databases • Decision Support Systems example: fire control • Approximate Reasoning example: approximation of Time Series (t1,y1), (t2,y2), …., (tn,yn) • Timed Automata Verification • Animation

  34. Forest Fire Control Problem • Problem Description • a fire starts in some portion of a forest • fire-fighters have several options to control the fire spread • option which minimizes damage must be chosen

  35. Forest Fire Control Problem • Problem Description (contd.) • assume that we can predict the fire spread from environmental conditions • two possible strategies of dropping foam could be:

  36. Forest Fire Control Problem • Problem Solution (contd.) • after applying the block and area operators in PReSTO, we get the following results: Strategy Burnt Area 16056 None 1 12426 2 7315

  37. Piecewise Linear Approximation Temperature Temperature PLA  =3 Constraint Database Relational Database

  38. US Precipitation (6,726 Stations, 96 Months)

  39. Querying Piecewise Linear Approximations • For the relation Temperature(Temp, t), find the temperatures at time 1.5 : select Temp from Temperature where t = 1.5; • For the relation Temperature(Temp, t), find the lowest temperature: select min(Temp) from Temperature;

  40. Update of Piecewise Linear Approximation

  41. TOURIST Timed Automata d >= 100 ? e := e + 198 d := d - 100 y >= 30,000 ? e := e + 198 y := y - 30000

  42. Timed Automata  Datalog • T(d, e’, y’) :- T(d, e, y), y >= 30000, y’ = y – 30000, e’ = e+198.

  43. Value-by-Area Cartogram A value-by-area cartogram is a map in which each display area is proportional to some geographically distributed “value”. Contiguous cartograms Noncontiguous cartograms

  44. Example: 1990 USA Population Distribution

  45. Some Disadvantages of Current Animation Algorithms • Current cartogram animation algorithms run very slowly. • Current cartogram animation algorithms require pre-computing and saving the snapshots. This greatly limits the number of snapshots that can be displayed in animation.

  46. Cartogram Animation Two snapshots of value-by-area cartogram animation for U.S. population in 1970 and 1990.

  47. Volume Animation Two snapshots of daily mean temperature in U.S. during a winter day and a summer day.

  48. Constraint-Based Animation Methods Avoid pre-computation Support animation with large number of snapshots Run fast

  49. Methods for Animation • Parallel Method • Serial Method • Hybrid Method

  50. Parallel Method

More Related