Tabled CLP for Reasoning over Stream Data
October 18, 2016
Joaquín Arias1,2
1IMDEA Software Institute, 2Technical University of Madrid
Tabled CLP for Reasoning over Stream Data Joaqun Arias 1 , 2 1 IMDEA - - PowerPoint PPT Presentation
October 18, 2016 Tabled CLP for Reasoning over Stream Data Joaqun Arias 1 , 2 1 IMDEA Software Institute, 2 Technical University of Madrid madrid institute for advanced studies in software development technologies www.software.imdea.org Goal:
1IMDEA Software Institute, 2Technical University of Madrid
1 / 18
www.software.imdea.org
2 / 18
www.software.imdea.org
2 / 18
www.software.imdea.org
3 / 18
www.software.imdea.org
4 / 18
www.software.imdea.org
ce1 ( Result ) <− e (Name, Result ) SEQ e (Name, Result ) WHERE (Name = "a " , Result = 1 ) . ce2 ( Result ) <− ce1 ( Result ) AND ce1 ( Result ) WHERE ( Result = 1 ) .
−−−−−−−−−−−−−−−−−−−−−−−−
<Query name= " ce1 " t e x t =" i n s e r t i n t o tmpE(ceName, Result ) select " ce1 " as ceName, e1 . Result as Result from pattern [ every ( + e1=e ( e1 .Name="a" and e1 . Result =1) −> e2=e ( e2 .Name="a" and e2 . Result =1) ) ] " / > <Query name= " ce2 " t e x t =" select " ce2 " as Name, e1 . Result as Result from pattern [ every ( + e1=tmpE( e1 .ceName="ce1 " and e1 . Result =1) and e2=tmpE( e2 .ceName="ce1 " and e2 . Result =1) ) ] " / >
vs ESPER, a relational database language (below)
5 / 18
www.software.imdea.org
:− rdf_register_ns ( ffd , ’ http : / / f a s t _ f l o w e r _ d e li v e r y .com / ’ ) . delivery_ranking_position ( Delivery , Area , Rank) :− rdf_s (Shop , f f d : request , Delivery , _Time ) , r d f (Shop , f f d : area , Area ) , r d f (Shop , f f d : ranking , Rank ) .
6 / 18
www.software.imdea.org
7 / 18
www.software.imdea.org
8 / 18
www.software.imdea.org
9 / 18
www.software.imdea.org
10 / 18
www.software.imdea.org
11 / 18
www.software.imdea.org
12 / 18
www.software.imdea.org
13 / 18
www.software.imdea.org
d i s t (X, Y, D) :− d i s t (X, Z , D1) , edge (Z , Y, D2) , D i s D1 + D2. d i s t (X, Y, D) :− edge (X, Y, D) . edge (1 , 2 , 9 ) . edge (2 , 3 , 13). edge ( . . . ?− d i s t (X,Y,D) , D < K. d i s t (X, Y, D) :− D1 #> 0 , D2 #> 0 , D #= D1 + D2, d i s t (X, Z , D1) , edge (Z , Y, D2 ) . d i s t (X, Y, D) :− edge (X, Y, D) . edge (1 , 2 , 9 ) . edge (2 , 3 , D) :− D #> 11 , D #< 15. edge ( . . . ?− D #< K, d i s t (X,Y,D) .
14 / 18
www.software.imdea.org
Termination properties of similar programs.
15 / 18
www.software.imdea.org
Run time (ms) for dist/3. A ‘–’ means no termination.
1Graph of 25 nodes and 584 edges. 2Graph of 25 nodes and 785 edges.
16 / 18
www.software.imdea.org
17 / 18
www.software.imdea.org
18 / 18
www.software.imdea.org
18 / 18
www.software.imdea.org
19 / 18
www.software.imdea.org
20 / 18
www.software.imdea.org
21 / 18
www.software.imdea.org
22 / 18
www.software.imdea.org