presentation

advertisement
Path oriented
Logic Programming Language
Student: Igal Khitron.
Advisors: Mira Balaban,
Michael Kifer, Stony Brook University, NY, USA.
Computer Science Department,
Ben-Gurion University of the Negev.
-1-
-
+
PathLP
26/09/2011
MOTIVATION
• 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.
-2-
-
+
PathLP
26/09/2011
SOLUTION
• 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).
• PathLP as a regular Logic programming language.
-3-
-
+
PathLP
26/09/2011
PATHLP SYNTAX
• Path Expression as the main structure.
John.spouse.brother[?x ].sun[?y].
, Susan.friend
?x
John
?y
Mary
spouse
?x
?y
Susan
• -3.a.8[collect(4, 5, ?y, ?_, ‘^^p’(3, a))]
-4-
-
+
PathLP
26/09/2011
PATHLP SYNTAX – CONT’D
• 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.
-5-
-
+
PathLP
26/09/2011
CONSTRAINTS
• Describe forbidden states.
!- ?x.prop1[?y], ?y > 10.
• System stability check process.
• All deviations are printed.
• Cardinality constraints. {3..*}
-6-
-
+
PathLP
26/09/2011
IMPLEMENTATION
• Prolog as Logic language platform.
• Problem: reasoning order.
• Tabling prolog.
• Memoization.
• Infinite loops avoidance.
• Left Recursion.
fib(46) regular
12 min
fib(92)
tabled 0.06 millisec
fib(92)
linear
0.01 millisec
• XSB (David Warren and others, including Kifer).
• 3-valued logic (true, undefined, false).
• Prolog as ultimate compiler language – DCG.
-7-
-
+
PathLP
26/09/2011
FULL LINUX
KDE WORKING
ENVIRONMENT
Action
-9-
-
+
Interpreter
PathLP
Shell
26/09/2011
TESTS
• 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.
?- file(?x).inode[?i], file(?y).inode[?i], ?x < ?y.
!- ?x:filetype, ?x.name[?name], \
\+ ?x.fullpath[[?name|?]].
?x:int :- integer(?x)@_prolog, ?x >= 0.
filetype!size[int]{1..1}.
'regular file'::plain.
'regular empty file'::plain.
plain::filetype.
'symbolic link'::filetype.
- 10 -
ACTION
RUNTIME
Compilation
≈ 8 minutes
Reload
≈ 0.1 seconds
Stability & queries – O(n) ≈ 0.8 seconds
Stability & queries – O(n3) < 10 seconds
-
+
PathLP
26/09/2011
PROJECT FEATURES
• 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.
- 11 -
-
+
PathLP
26/09/2011
SUMMARY
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 .
Project site: www.cs.bgu.ac.il/~khitron/bgu_pathlp .
- 12 -
-
+
PathLP
26/09/2011
Download