PathLP – Path-based Logic Programming Mira Balaban, Igal Khitron Computer Science Department Ben-Gurion University Mini-project-course Fall 20131.

Slides:



Advertisements
Similar presentations
Ontology-Based Computing Kenneth Baclawski Northeastern University and Jarg.
Advertisements

1 ICS-FORTH & Univ. of Crete SeLene November 15, 2002 A View Definition Language for the Semantic Web Maganaraki Aimilia.
Visual Model-based Software Development EUD-Net Workshop, Pisa, Italy September 23 rd, 2002 University of Paderborn Gregor Engels, Stefan Sauer University.
Profiles Construction Eclipse ECESIS Project Construction of Complex UML Profiles UPM ETSI Telecomunicación Ciudad Universitaria s/n Madrid 28040,
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML, Part 4 UML 2 Metamodel.
27 January Semantically Coordinated E-Market Semantic Web Term Project Prepared by Melike Şah 27 January 2005.
ISO DSDL ISO – Document Schema Definition Languages (DSDL) Martin Bryan Convenor, JTC1/SC18 WG1.
Answer Set Programming Overview Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de Guadalajara
Production Rule Representation Team Response Presentation to BEIDTF OMG Montreal Aug 2004 Ruleml.org.
Eco Imagine The Opportunity of the VESTA- GIS Technological Platform Anders Östman University of Gävle Sweden.
Building Enterprise Applications Using Visual Studio ®.NET Enterprise Architect.
2 Object-Oriented Analysis and Design with the Unified Process Objectives  Explain how statecharts can be used to describe system behaviors  Use statecharts.
Research on Intelligent Information Systems Himanshu Gupta Michael Kifer Annie Liu C.R. Ramakrishnan I.V. Ramakrishnan Amanda Stent David Warren Anita.
Institute For Software Integrated Systems Vanderbilt University Applications of Model Integrated Computing to The Synchronous Language Signal Ethan Jackson.
Ontologies Reasoning Components Agents Simulations An Overview of Model-Driven Engineering and Architecture Jacques Robin.
PathLP26/09/ Student: Igal Khitron. Advisors: Mira Balaban, Michael Kifer, Stony Brook University, NY, USA. Computer Science Department,
1 Conceptual Modeling of Topic Maps with ORM Versus UML Are D. Gulbrandsen The XML group, Center for Information Technology Services, University of Oslo,
Using the Vanderbilt Generic Modeling Environment (GME) to Address SOA QoS Sumant Tambe Graduate Intern, Applied Research, Telcordia Technologies Inc.
Model Driven Integrated Development Environment Barak Agiv Itamar Ben-Zaken Vladislav Smolensky Academic Advisor: Yuval Elovici Professional Advisor: Mira.
TIBCO Designer TIBCO BusinessWorks is a scalable, extensible, and easy to use integration platform that allows you to develop, deploy, and run integration.
Copyright © 2004 Pearson Education, Inc. Chapter 1 Introduction.
Knowledge Mediation in the WWW based on Labelled DAGs with Attached Constraints Jutta Eusterbrock WebTechnology GmbH.
Katanosh Morovat.   This concept is a formal approach for identifying the rules that encapsulate the structure, constraint, and control of the operation.
1COM6030 Systems Analysis and Design © University of Sheffield 2005 COM 6030 Software Analysis and Design Lecture 4 - System modelling Dr Richard Clayton.
Ontology Development Kenneth Baclawski Northeastern University Harvard Medical School.
Session II Chapter 2 – Chapter 2 – XSLhttp://
Databases ? 2014, Fall Pusan National University Ki-Joune Li.
Introduction to Database Systems
Assessing the Suitability of UML for Modeling Software Architectures Nenad Medvidovic Computer Science Department University of Southern California Los.
Agenda 1. Introduction 2. Overview of SU-MoVal 3. OCL-based Model Validation 4. QVT-based Transformations 5. Demo of SU-MoVal 6. Conclusion and Future.
Models for Language Engineering Bruno F. Barroca.
UDM An Infrastructure for Implementing Domain-Specific Modeling Languages Endre Magyari, Arpad Bakay, Andras Lang, Tamas Paka, Attila Vizhanyo, Aditya.
SaveUML System design. System overview Possible...
Information System Development Courses Figure: ISD Course Structure.
A Static Approach to Consistency Verification of UML Models Andrea Baruzzo Department of Computer Science University of Udine MoDeV.
Correctness of Software Models Mira Balaban, Azzam Maraee Computer Science Department Ben-Gurion University Model correctnessFall
XML Databases by Sebastian Graf Hier beginnt mein toller Vortrag.
Ontology-Based Computing Kenneth Baclawski Northeastern University and Jarg.
Week III  Recap from Last Week Review Classes Review Domain Model for EU-Bid & EU-Lease Aggregation Example (Reservation) Attribute Properties.
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
CS 157B: Database Management Systems II February 11 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron.
Systems Biology Markup Language Ranjit Randhawa Department of Computer Science Virginia Tech.
Metamodeling and Modeling language for Systems Biology SB-UML Magali ROUX-ROUQUIE CNRS, Paris.
Dr. Bhavani Thuraisingham September 24, 2008 Building Trustworthy Semantic Webs Lecture #9: RDF and RDF Security.
Reasoning about the Behavior of Semantic Web Services with Concurrent Transaction Logic Presented By Dumitru Roman, Michael Kifer University of Innsbruk,
Logic Programming. Formal Logics- Recap Formulas – w/out quantifiers Free Variables Bound Variables Assignments and satisfaction Validity and satisfiability.
Yu, et al.’s “A Model-Driven Development Framework for Enterprise Web Services” In proceedings of the 10 th IEEE Intl Enterprise Distributed Object Computing.
WonderWeb. Ontology Infrastructure for the Semantic Web. IST Project Review Meeting, 11 th March, WP2: Tools Raphael Volz Universität.
Ontologies Reasoning Components Agents Simulations An Overview of Model-Driven Engineering and Architecture Jacques Robin.
XSLT, XML Schema, and XPath Matt McClelland. Introduction XML Schema ▫Defines the content and structure of XML data. XSLT ▫Used to transform XML documents.
Comparison of ZOOM with other Formal Methodologies Hsiu-Chien Jing SE690 Initial Presentation School of CTI, DePaul University Supervised by Dr. Jia October,
Defects of UML Yang Yichuan. For the Presentation Something you know Instead of lots of new stuff. Cases Instead of Concepts. Methodology instead of the.
CENG 424-Logic for CS Introduction Based on the Lecture Notes of Konstantin Korovin, Valentin Goranko, Russel and Norvig, and Michael Genesereth.
DB/IR Research at Stony Brook
CSCE 548 Secure Software Development Use Cases Misuse Cases
The Object-Oriented Database System Manifesto
SysML v2 Formalism: Requirements & Benefits
Research topics: Mira Balaban
9/22/2018.
Database.
Systems Analysis Overview.
Implementing Language Extensions with Model Transformations
Design of Transmission Pipeline Modelling Language
2018, Fall Pusan National University Ki-Joune Li
Lecture #6: RDF and RDF Security Dr. Bhavani Thuraisingham
2/18/2019.
Query Optimization.
Implementing Language Extensions with Model Transformations
Microsoft Azure Services Platform
Software Architecture & Design
Presentation transcript:

PathLP – Path-based Logic Programming Mira Balaban, Igal Khitron Computer Science Department Ben-Gurion University Mini-project-course Fall 20131

PathLP compact logic programming A compact logic programming language Inspired from – Object-Oriented Logic Programming languages: F-Logic (Kifer, Lausen, Wu 1995) FLORA-2 ( 2009) – Object-Oriented database and web query languages : XSQL (Kifer, Kim, Sagiv 1992) XPATH – a query language over XML documents ( ( guarded path expressions Supports reasoning over guarded path expressions typing notions: Supports typing notions: – Hierarchy – Membership Mini-project-course Fall 20132

PathLP status PathLP is still under development by Mira Balaban, Igal Khitron, Michael Kifer (alphabetical order). Intended for: – Formal support for Model-Level Integrated Development Environments : Simultaneous reasoning over multiple models – Reasoning over applications that support hierarchical structures, like Access policy in Network Management Publications: – Mira Balaban and Michael Kifer: "An Overview of F-OML: An F-Logic Based Object Modeling Language", ECEASST'11 36."An Overview of F-OML: An F-Logic Based Object Modeling Language" – Mira Balaban and Michael Kifer: "Logic Based Model-Level Software Development with F- OML", MoDELS'2011."Logic Based Model-Level Software Development with F- OML" – Igal Khitron, Michael Kifer, Mira Balaban: “PathLP: A Logic Programming Language of Path Expressions”, PLDE Application: Version 1.4 PathLP1.4 PathLP1.4 Mini-project-course Fall 20133

Model-level IDE – Needed modeling services modeling Provide a modeling constraint language for extending UML diagrams: – Object Constraint Language (OCL) – PathLP Verification Verification of UML diagrams design patterns Specification of design patterns. Reasoning Reasoning about UML diagrams Testing Testing UML diagrams Model Model refactoring Meta-modeling Meta-modeling : – DSML specification – Formalize UML specification Mini-project-course Fall 20134

Model-level IDE – Integration with a modeling platform Diagrammatic models Diagrammatic models – concrete external syntax. Mini-project-course Fall Modeling services model 1 model n … UML development platform model 1 -module … model n -module Underlying formal modeling language transformations

Model-level IDE – Integration with a modeling platform Diagrammatic models Diagrammatic models – concrete external syntax. Mini-project-course Fall model 1 -module … model n -module F-OM L PathLP Modeling services model 1 model n … UML development platform transformations

PathLP constructs Path expressions Facts Rules Constraints Queries Mini-project-course Fall 20137

PathLP: Object path expressions constants, variables,., guards Consist of constants, variables,., guards objects Denote objects ?C.friend.student[?S].name The names of a student s of a friend of c, for some bindings s and c to variables ?S and ?C Mini-project-course Fall 2013 constant variable guard 8 denotation c friend student s name student … … …

PathLP: Object path expressions & Query formulas Query formula: John.childWith(Mary)[?C].name[?N], ?C:Student,?C.ageAt(2010)<20 The name ?N of ?C, who is a child with Mary of John, is a student and whose age at 2010 is less than 20 Mini-project-course Fall 2013 elementary formula 9 denotation John ?C Student childWith(Mary) name … … ageAt(2010) n<20 elementary formula ?N

PathLP: Type path expressions Person!spouse[Person]{0..1} The type of spouse s of nodes of type Person (nodes pointed by spouse edges) is Person (or a subtype of Person ), and there is at most 1 such edge Assume – ?n1.spouse[?n2] – Mini-project-course Fall ?n1 spouse ?n2 Cardinality constraint

PathLP: Type path expressions Person!spouse[Person]{0..1} The type of spouse s of nodes of type Person is Person (or a subtype of Person ), and there is at most 1 such edge Assume – ?n1.spouse[?n2] – ?n1:Person Mini-project-course Fall Person ?n1 spouse ?n2

PathLP: Type path expressions Person!spouse[Person]{0..1} The type of spouse s of nodes of type Person is Person (or a subtype of Person ), and there is at most 1 such edge Assume – ?n1.spouse[?n2] – ?n1:Person Mini-project-course Fall and Person ?n1 IF at most 1 spouse edge spouse ?n2 THEN  ?n2:Person

PathLP: Type path expressions Person!spouse[Person]{0..1} The type of spouse s of nodes of type Person is Person (or a subtype of Person ), and there is at most 1 such edge Assume – ?n1.spouse[?n2] – ?n1:Person Mini-project-course Fall and Person ?n1 spouse IF at most 1 spouse edge spouse ?n2 THEN Type edge spouse …  ?n2:Person

PathLP: Facts – specify assertions John.spouse[Mary]; John.child[Bob]; John.child[Bill]; – John has a spouse Mary and children Bob and Bill (and possibly others) Type hierarchy and membership assertions: : Bob:CS_teaching_committee; :: CS_teaching_committee::Teaching_committee; : Teaching_committee:Committee; :: Committee::Group; – Bob CS_teaching_committee Teaching_committee Committee Group ! A type assertion: Person!spouse[Person]{0..1}; – The type of spous es of Person is Person, or one of its subtypes, and the cardinality constraint is {0..1} Mini-project-course Fall

PathLP: Rules, Constraints, Queries Rules Rules – specify implications: – ?A:advisor :- ?T:Thesis, ?T.author.advisor[?A].read[?T],?A:Professor; ?A is an advisor if ?A has read a thesis ?T of an author that ?A advises Constraints Constraints – restrict legal states: – !- ?P:Professor, not ?P.degree[PhD]; forbid states with a professor ?P that does not have a PhD degree Queries Queries – trigger computation – ?- ?A:Professor, ?A.review[?Thesis], ?A.supervise.thesis-of[?Thesis]; Find a professor that reviews a thesis of somebody s/he supervises. A more compact expression: ?- ?A:Professor,?A.review.author.advisor[?A]; Mini-project-course Fall

PathLP – as a basis for Object-Oriented modeling Defines entities: paths – Inter-related by paths typed – Possibly typed inclusion inclusion “::” membership membership “:” Multi-level Multi-level modeling: – Unrestricted “ :: “ and “ : “ Polymorphism: Polymorphism: – Parameterized – Parameterized path expressions – Type hierarchy Mini-project-course Fall Object navigation Class Class hierarchy Object creation; Testing Reflection Patterns Model query Static analysis

PathLP – implementation Beta version 1.4: – pathlp.sf.net (Igal Khitron) pathlp.sf.net – Compiler and interpreter – In XSB prolog open source tabling prolog supports well-founded negation – Windows, Linux, Unix – Large test cases: 200,000 facts Mini-project-course Fall

Mini-Project subject – Develop a Graph Services library in PathLP An example library: JGraphTJGraphT From the JGraphT home page: – JGraphT is a free Java graph library that provides mathematical graph-theory objects and algorithms. JGraphT supports various types of graphs including: directed and undirected graphs. graphs with weighted / unweighted / labeled or any user-defined edges. various edge multiplicity options, including: simple-graphs, multigraphs, pseudographs. unmodifiable graphs - allow modules to provide "read-only" access to internal graphs. listenable graphs - allow external listeners to track modification events. subgraphs graphs that are auto-updating subgraph views on other graphs. all compositions of above graphs. – Although powerful, JGraphT is designed to be simple and type-safe (via Java generics). For example, graph vertices can be of any objects. You can create graphs based on: Strings, URLs, XML documents, etc; you can even create graphs of graphs! This code example shows how.code example Mini-project-course Fall

Mini-Project subject – Develop a Graph Services library in PathLP Why having “yet another JGraphT” in PathLP?JGraphT Mini-project-course Fall

Mini-Project subject – Develop a Graph Service library in PathLP Why having “yet another JGraphT” in PathLP?JGraphT What are the special features of Logic Programming languages? – Reasoning! – Answer queries! – Analysis! Mini-project-course Fall

Graph representation in PathLP Directed graph: – Facts: n1.edge[n2]; n1.edge[n3]; n1.edge[n4]; n2.edge[n3]; n2.edge[n5]; n4.edge[n2]; n4.edge[n4]; n5.edge[n2]; n5.edge[n4]; Mini-project-course Fall n1 n2 n4n3 n5

Querying the directed graph Directed graph: – Facts: n1.edge[n2]; n1.edge[n3]; n1.edge[n4]; n2.edge[n3]; n2.edge[n5]; n4.edge[n2]; n4.edge[n4]; n5.edge[n2]; n5.edge[n4]; – Queries: ?- n1.edge[?N]; ?- ?N1.edge[?N2]; ?- ?N1.edge[?_N2],?_N2.edge[?N1]; ?- ?n.edge[?n]; ?- not n1.edge[n2]; ?- ?N._size(edge)[?edge_number],?edge_number<2 ; Mini-project-course Fall n1 n2 n4n3 n5

Reasoning about the directed graph Paths in the directed graph: – Rules: ?n1.path[?n2]:- ?n1.edge[?n2]; ?n1.path[?n2]:- ?n1.path[?n3],?n3.edge[?n2]; – Facts: n1.edge[n3];n4.edge[n2]; n1.edge[n4];n4.edge[n4]; n2.edge[n3];n5.edge[n2]; n2.edge[n5];n5.edge[n4]; – Queries: ?- n5.path[n5]; ?- ?N.path[n5]; ?- ?N.path[n5],?N != n5; ?- ?n.path[?n]; ?- not(n1.path[n1]); ?- n1.path[?N],not(?N.path[?N]); – Rule: ?n.selfPath[true]:- ?n.path[?n]; – Query: ?- ?N._size(selfpath)[?path_num],?path_num>1; Mini-project-course Fall n1 n2 n4n3 n5

Reasoning about the directed graph Adding path details and node typing: – Rules: ?N1.path([?N1,?N2])[?N2]:- ?N1.edge[?N2]; ?N1.path([?N1|?P])[?N3]:- ?N1.edge[?N2],?N2.path(?P)[?N3]; ?N1.loop[?N2]:- ?N1.edge[?N2],?N2.edge[?N1]; ?N.origin[true]:- ?N:Node,not ?N.enter_edge[true]; ?N.enter_edge[true]:- ?N1.edge[?N]; ?N.sink[true]:- ?N:Node,not ?N.leaving_edge[true]; ?N.leaving_edge[true]:- ?N.edge[?N1]; isolated(?N)[true] :- origin(?N)[true],sink(?N)[true]; – Facts: n1:Node; n2:Node; n3:Node; n4:Node; n5:Node; n6:Node; n1.edge[n3];n4.edge[n2]; n1.edge[n4];n4.edge[n4]; n2.edge[n3];n5.edge[n2]; n2.edge[n5];n5.edge[n4]; – Queries: ?- n5.path(?P)[n5]; ?- ?N.path(?P)[n5]; ?- ?N.path(?_P)[n5]; is the same as ?- ?N.path[n5]; ?- ?N.path(?_P)[n5],not ?_P.member[n4]; ?- ?N.loop[n5]; ?- ?N1.origin[true],?N2.origin[true],?N1!=?N2; ?- ?_N.isolated[true]); Mini-project-course Fall n1 n2 n4n3 n5 n6

Reasoning about the directed graph Adding labeled edges, edge typing, path typing: – Rules: ?P:Path :-?N1.path(?P)[?N2]; % Bad modeling! Why? ?P.nodes[?P] :- ?P:Path,?N1.path(?P)[?N2]; ?P.node[?N] :- ?P.nodes[?Node_list],?Node_list.member[?N]; ?E:Edge :- ?N1.edge(?E)[?N2]; ?E.source[?N] :- ?E:Edge,?N.edge(?E)[?N1]; – Facts: n1:Node; n2:Node; n3:Node; n4:Node; n5:Node; n6:Node; n1.edge[n3];n4.edge[n2]; n1.edge[n4];n4.edge[n4]; n2.edge[n3];n5.edge[n2]; n2.edge[n5];n5.edge(e54)[n4]; – Note the different design decision about the status of nodes and edges: Node typing is mandatory Edge typing is inferred Mini-project-course Fall n1 n2 n4n3 n5 n6 e54

Reasoning about the directed graph Improved path modeling: – Rules: path(?node_list):Path :-?N1.path(?node_list)[?N2]; path(?node_list).nodes[?node_list] :-?N1.path(?node_list)[?N2]; ?P.node[?N] :- ?P.nodes[?Node_list], ?Node_list.member[?N]; ?P.first[?N] :- ?P:Path, ?P.nodes[ [?N|?rest_nodes] ]; ?P.last[?N] :- ?P:Path, ?P.nodes[?node_list], ?node_list.reverse[[?N|?rest_nodes]]; – Constraints: !- ?P:Path, ?P.first[?N1], ?P.last[?N2], ?P.nodes[?node_list], not ?N1.path(?node_list)[?N2]; – Facts: n1:Node; n2:Node; n3:Node; n4:Node; n5:Node; n6:Node; n1.edge[n3];n4.edge[n2]; n1.edge[n4];n4.edge[n4]; n2.edge[n3];n5.edge[n2]; n2.edge[n5];n5.edge(e54)[n4]; Mini-project-course Fall n1 n2 n4n3 n5 n6 e54

Reasoning about the directed graph Adding more constraints: – Rules: path(?node_list):Path :-?N1.path(?node_list)[?N2]; path(?node_list).nodes[?node_list] :-?N1.path(?node_list)[?N2]; ?E:Edge :- ?N1.edge(?E)[?N2]; ?E.source[?N] :- ?E:Edge,?N.edge(?E)[?N1]; – Constraint: !- ?E.source[?N1],?E.source[?N2], ?N1!=?N2; !- ?N1.path(?P)[?N2], ?P.member[?N],not ?N:Node; A single labeled edge between nodes: !- ?N1.edge(?L1)[?N2], ?N1.edge(?L2)[?N2], ?L1 != ?L2; A single labeled edge leaving a node: !- Node!edge(?L)[Node]{0..1}; Mini-project-course Fall n1 n2 n4n3 n5 n6 e54

Reasoning about the directed graph Adding path properties and sub-typing: – Rules: path(?node_list):Compact_Path :- path(?node_list):Path, ?node_list.compactList[true]; ?List.compactList[true] :- not ?L1.append([?N],?L2,[?N],?L3)[?List]; ?P:Cycle :- ?P:Path,?P.first[?N],?P.last[?N]; path(?node_list).length[?number] :- ?node_list.length[?number]; Compact_Path :: Path; Cycle :: Path; – Constraints: !- path(?node_list):Compact_Path, not ?node_list.compactList[true]; !- ?P:Cycle, ?P.first[?N1], ?P.last[?N2], ?N1 != ?N2; Mini-project-course Fall n1 n2 n4n3 n5 n6 e54

Reasoning about the directed graph Adding multiple graphs: – Rules: ?G.node[?N] :-?G.nodes[?Node_list],?Node_list.member[?N]; ?N.graph[?G] :-?G.node[?N]; ?G1.intersection(?G2)[?G] :- ?G1.nodes[?Ns1],?G2.nodes[?Ns2], ?G1.edges[?Es1],?G2.edges[?Es2], ?Ns1.intersection(?Ns2)[?Ns], ?Es1.intersection(?Es2)[?Es], ?G:Directed_graph,?G.nodes[?Ns],?G.edges[?Es]; ?G.is_empty[true] :- ?G:Directed_graph,?G.nodes[ [] ]; ?G1.disjoint[?G2] :- ?G1.intersection(?G2)[?G], ?G.is_empty[true]; ?G.path[?P]:- ?P.nodes[?Nodes_P],?G.nodes[?Nodes_G], ?Nodes_G.contains[?Nodes_P]; ?G:Cyclic_directed_graph :- ?G.path[?P],?P:Cycle; ?G:DAG :- not ?G:Cyclic_directed_graph; – A different modeling approach – using functional constructors: intersection(?G1,?G2):Directed_graph :- ?G1:Directed_graph,?G2:Directed_graph; intersection(?G1,?G2).nodes[intersection(?Ns1,?Ns2)] :- ?G1.nodes[?Ns1],?G2.nodes[?Ns2]; – A type Constraint: Directed_graph!nodes[List]{1..1}; – Facts: g1:Directed_graph; g1.nodes[[n1,n2,n3,n4,n5,n6]]; g1.edges[[e12,e13,e14,e25,e52,e23,e42,e44]]; Mini-project-course Fall

30Mini-project-course Fall 2013