PathLP26/09/ Student: Igal Khitron. Advisors: Mira Balaban, Michael Kifer, Stony Brook University, NY, USA. Computer Science Department, Ben-Gurion University of the Negev. Path oriented Logic Programming Language
PathLP26/09/2011 Models as program abstractions, could be huge. Ability to write a model as a programming code. To run queries about this code. To find an exact place and description of error. To fix and just recompile the code. MOTIVATION
PathLP26/09/2011 New Programming Language. Model terms (intersection, closure, disjoint, singleton). The language will support many types of models. F-OML – F-LOGIC (Kifer and Lausen, 1989) based Object Modeling Language. Top layer of PathLP (only PathLP syntax). Logic PathLP as a regular Logic programming language. SOLUTION
PathLP26/09/2011 Path Expression as the main structure. John.spouse.brother[?x -3.a.8[collect(4, 5, ?y, ?_, ‘^^p’(3, a))] John brother spouse sun brother spouse sister sun ?y Susan friend, Susan.friend sun ?y PATHLP SYNTAX ?y ?x Mary ?x ].sun[?y].
PathLP26/09/2011 Type path expression. person!spouse[person]{0..2} Membership. Bob:male. Subtype. female::person. Logic equality. Fact. John.spouse[Mary]. Rule. ?x.sonOf[?y] :- ?x.childOf[?y], ?x:male. Query: ?- ?x:person, ?x.ageof(2003)[?age], ?age>20. PATHLP SYNTAX – CONT’D
PathLP26/09/2011 Describe forbidden states. !- ?x.prop1[?y], ?y > 10. System stability check process. All deviations are printed. Cardinality constraints. {3..*} CONSTRAINTS
PathLP26/09/2011 Prolog as Logic language platform. Problem: reasoning order. Tabling prolog. Memoization. Infinite loops avoidance. Left Recursion. XSB (David Warren and others, including Kifer). 3-valued logic (true, undefined, false). Prolog as ultimate compiler language – DCG. IMPLEMENTATION 12 minregularfib(46) tabledfib(92) linearfib(92) 0.06 millisec 0.01 millisec
PathLP26/09/2011 Grammar as pure programming code. delimiter --> "\n"; "\t"; " ". Non context free grammar. digit(X) --> [Y], {X is Y - 48, X >= 0, X =< 9}. stateS(neg_num(X)) --> "-", stateS(nonneg_num(Y)), {X is -Y}. stateS(nonneg_num(X)) --> digit(Y), stateS(nonneg_num(Z)), {X is Y * 10 + Z}. stateS(nonneg_num(X)) --> digit(X). Pushdown automata support. DCG – DEFINITE CLAUSE GRAMMAR | ?- stateS(X,"-12e+4", Y). X = neg_num(-12) Y = [101,43,52] delimiter -> “\n” | “\t” | “ “ digit -> [0-9] S -> neg_num | nonneg_num neg_num -> ‘-’ nonneg_num nonneg_num -> digit+
PathLP26/09/2011 Interpreter ActionShell FULL LINUX KDE WORKING ENVIRONMENT
PathLP26/09/2011 ?- file(?x).inode[?i], file(?y).inode[?i], ?x < ?y. !- ?x:filetype, ?x.name[?name], \ \+ ?x.fullpath[[?name|?]]. ?x:int :- ?x >= 0. filetype!size[int]{1..1}. 'regular file'::plain. 'regular empty file'::plain. plain::filetype. 'symbolic link'::filetype. Regular checks. Huge test case. University CS Linux file system part (O:) – 200,000 facts (about 15 for each file). Name, size, permissions... Path and last change as lists. Type expressions, rules, constraints and queries about the file system correctness. RUNTIMEACTION 8 minutes≈Compilation 0.1 seconds ≈Reload 0.8 seconds ≈Stability & queries – O(n) 10 seconds <Stability & queries – O(n 3 ) TESTS
PathLP26/09/2011 All Prolog and XSB abilities. Linux executables. Multifile. Full preprocessor: #define, #include, #if, #ifdef, #eval, #exec... Improved list library. Difference and infinite lists can be treated. Special _size property - counts all outgoing edges of the same kind. Command line program (with history) and multiply arguments. PROJECT FEATURES
PathLP26/09/2011 This works, but it’s not enough. We’re going to develop the PathLP. (For example, module spaces or libraries support.) We’ll start with F-OML building. We’ll rest on our laurels. PathLP domain: pathlp.sf.net.pathlp.sf.net Project site: SUMMARY
MENU 12. Summary. 11. Features. 10. Tests. 9. KDE. 8. DCG. 7. Implementation. 6. Constraints. 5. Syntax Syntax Solution. 2. Motivation. 1. Title.