Presentation is loading. Please wait.

Presentation is loading. Please wait.

July 2005 Reasoning Web Summer School, Msida, Malta1 Rules and Ontologies in F-logic Michael Kifer State University of New York at Stony Brook.

Similar presentations


Presentation on theme: "July 2005 Reasoning Web Summer School, Msida, Malta1 Rules and Ontologies in F-logic Michael Kifer State University of New York at Stony Brook."— Presentation transcript:

1 July 2005 Reasoning Web Summer School, Msida, Malta1 Rules and Ontologies in F-logic Michael Kifer State University of New York at Stony Brook

2 July 2005 Reasoning Web Summer School, Msida, Malta2 Outline Introduction Overview of F-logic (with examples using the FLORA-2 system) F-logic / FLORA-2 and ontologies

3 July 2005 Reasoning Web Summer School, Msida, Malta3 What is F-Logic? An object-oriented first-order logic Extends predicate logic with –Objects with complex internal structure –Class hierarchies and inheritance –Typing –Encapsulation A basis for object-oriented logic programming and knowledge representation Background: –Basic theory: [Kifer & Lausen SIGMOD-89], [Kifer,Lausen,Wu JACM-95] –Path expression syntax: [Frohn, Lausen, Uphoff VLDB-84] –Semantics for non-monotonic inheritance: [Yang & Kifer, ODBASE 2002] –Meta-programming + other extensions: [Yang & Kifer, Journal on Data Semantics 2003] O-O programming Relational programming = F-logic Predicate calculus

4 July 2005 Reasoning Web Summer School, Msida, Malta4 F-logic and Logic Programming F-logic F-logic programming Predicate logic Logic programming The flavors of F-logic: First-order flavor Logic programming flavor

5 July 2005 Reasoning Web Summer School, Msida, Malta5 Relationship to Description Logic Predicate logic Description F-Logic F-logic Description Logic OWL - A description logic subset exists within F-logic [Balaban 1995, The F-logic Approach for Description Languages] - But most known uses of F-logic are in the rule-based, logic programming domain

6 July 2005 Reasoning Web Summer School, Msida, Malta6 Relationship to Description Logic (cont’d) F-logic (rule-based flavor) –Computationally complete –Object-oriented –Classes as object, reification of statements –Can query data and schema in the same language –Has useful tractable subsets (eg, function-free rules) –Non-monotonic reasoning Description logic –Has its own decidable subsets (but practically questionable, since exponential) –Can reason by cases –Can represent existential information –Monotonic reasoning

7 July 2005 Reasoning Web Summer School, Msida, Malta7 Applications of F-logic Semantic Web: –Ontology management –Semantic Web Services Information integration Software engineering Intelligent agents Anything that requires manipulation of complex structured (especially semi-structured) data

8 July 2005 Reasoning Web Summer School, Msida, Malta8 What is FLORA-2 ? FLRAF - LO gic t RA nslator (to XSB) – a popular implementation of F-logic (and more) Realizes the vision of logic-based KR with frames, meta-programming, and side-effects. Based on –F-logic –HiLog –Transaction Logic Practical & usable KR and programming environment –Declarative –Object-oriented –Rule-based –Open source:

9 July 2005 Reasoning Web Summer School, Msida, Malta9 Other Major F-logic Based Languages Ontobroker – commercial system from Ontoprise.de WSML-RuleWSMO (Web Service Modeling Ontology) – a large EU project that developed an F-logic based language for Semantic Web Services, WSML-Rule SWSL-Rules (also for Semantic Web Services)SWSI (Semantic Web Services Initiative) – an international group that proposed an F-logic based language SWSL-Rules (also for Semantic Web Services) FORUM – a user group whose aim is to standardize/web-ize the various flavors of F-logic ( FLORA-2, Ontobroker, WSML-Rule, SWSL-Rules)

10 July 2005 Reasoning Web Summer School, Msida, Malta10 F-logic: Simple Examples Object description: john[name  ‘John Doe’, phones ->> { , }, children ->> {bob, mary}] mary[name  ’Mary Doe’, phones ->> { , }, children ->> {anne, alice}] Structure can be nested: sally[spouse -> john[address -> ‘123 Main St.’] ] Single-valued attribute Set-valued attribute Object Id

11 July 2005 Reasoning Web Summer School, Msida, Malta11 Examples (contd.) ISA hierarchy: john : person // class membership mary : person alice : student student :: person // subclass relationship student : entityType person : entityType Class & instance in different contexts

12 July 2005 Reasoning Web Summer School, Msida, Malta12 Examples (Contd.) Methods: like attributes, but take arguments P[ageAsOf(Year)  Age] :- P:person, P[born  B] and Age is Year–B. Attributes can be viewed as methods with no arguments Queries : ?– john[ageAsOf(Y)  30, children  C] and C[born  B] and B>Y. John’s children who were born when he was 30+ years old.

13 July 2005 Reasoning Web Summer School, Msida, Malta13 Examples (contd.) Browsing IsA hierarchy: ?- john : X. // all superclasses of the object john ?- student ::Y. // all superclasses of class student Virtual class: and X : redcar :- X:car and X[color -> red]. Meta-query about schema: O[attributesOf(Class) ->> A] :- or O[A -> V or A ->> V] and V:Class. Rule that defines a method that returns attributes whose range is class Class Rule that defines a virtual class of red cars

14 July 2005 Reasoning Web Summer School, Msida, Malta14 Type Signatures Type info is specified using statements like this (called signatures): person[name *=> string, spouse *=> person, children *=>> person]. – *=> means inheritable instance attribute (like instance variable in Java) –Signatures are formulas in F-logic (just like john[name -> ’ John Doe ’ ] is a formula) –The notion of well-typedness connects signatures with data

15 July 2005 Reasoning Web Summer School, Msida, Malta15 Semantics F-logic semantics & proof theory is general, as in classical logic; sound & complete, and is not limited to rules But FLORA-2 is a programming language based on F-logic. Hence it uses non-classical semantics. So … :-  …, not P, … means “ true if cannot prove P ” – so called “ negation as failure. ” The exact semantics for negation used in FLORA-2 is derived from the Well-Founded Semantics [Van Gelder et al., JACM 1991,

16 July 2005 Reasoning Web Summer School, Msida, Malta16 Semantics (cont’d) The Well-Founded semantics is 3-valued: p :- not q. r :- not r. p is true, q false, but r is undefined And non-monotonic: P |= Q does not imply P  P ’ |= Q For instance: p :- not q implies p true. But q and p :- not q implies p false. In contrast, classical logic is both 2-valued and monotonic

17 July 2005 Reasoning Web Summer School, Msida, Malta17 Inheritance in F-logic Inheritance of structure vs. inheritance of behavior –Structural inheritance = inheritance of type signatures of a method (will not discuss here) –Behavioral inheritance = inheritance of the definition of a method Subtle problems arise when inference by inheritance interacts with inference by rules (illustrated next)

18 July 2005 Reasoning Web Summer School, Msida, Malta18 Behavioral Inheritance: Non-monotonicity Elephant[color * ->  grey] fred royalElephant[color * -> white] clyde Inherited: fred[color -> grey] clyde[color -> grey] Overriding white ? Means default value

19 July 2005 Reasoning Web Summer School, Msida, Malta19 Behavioral Inheritance: Problem with Rules Inheritance is hard to even define properly in the presence of rules. a b [ m *-> v ] c[m *-> w] :- b[m  v] c [ m  v ] inherited defeated?? [ m *-> w ] derived

20 July 2005 Reasoning Web Summer School, Msida, Malta20 Behavioural Inheritance: Solutions Hard to define semantics for multiple inheritance + overriding + rules Several semantics might appear to look “reasonable” The original semantics in [Kifer,Lausen,Wu: JACM-95] was one of the problematic “reasonable” semantics –A number of other problematic semantics of various degrees of “reasonableness” were proposed over time Problem solved in [Yang&Kifer: ODBASE 2002, 2003] Based on semantic postulates An extension of Van Gelder’s Well-Founded Semantics for negation

21 July 2005 Reasoning Web Summer School, Msida, Malta21 HiLog Allows certain forms of logically clean, yet tractable, meta-programming Syntactically appears to be higher-order, but semantically is first-order and tractable [Chen,Kifer,Warren, HiLog: A Foundation for Higher-Order Logic Programming, J. of Logic Programming, 1993]

22 July 2005 Reasoning Web Summer School, Msida, Malta22 Examples of HiLog Variables over predicates and function symbols: p(X,Y) :- X(a,Z), Y(Z(b)). Variables over atomic formulas (reification): p(q(a)). r(X) :- p(X) and X. A use of HiLog in FLORA-2 (e.g., querying of schema): O[unaryMethods(Class) ->> M] :- O[M(Arg) -> V or M(Arg) ->> V] and V:Class. Meta-variable: ranges over method names

23 July 2005 Reasoning Web Summer School, Msida, Malta23 Reification (Another Application of HiLog to F-logic) Reification: making an object out of a formula: john[believes ->> ${mary[likes ->> bob ]} ] Introduced in [Yang & Kifer, ODBASE 2002] Rules can be reified, too! Object made out of the formula mary[likes ->> bob]

24 July 2005 Reasoning Web Summer School, Msida, Malta24 HiLog in FLORA-2 Allows high degree of meta-programming purely in logic Variables can be bound to predicate and function symbols and thus queried Formulas can be represented as terms and manipulated in flexible ways Can mix frame syntax (F-logic) and predicate syntax (HiLog) in the same query/program: a[b -> c, g(X,e) ->> d] and p(f(X),a).

25 July 2005 Reasoning Web Summer School, Msida, Malta25 Ontologies A typical ontology has three components: –A taxonomy (class hierarchy) No-brainer in F-logic: Use : and :: –Concept definitions Use type signatures. For instance person[name *=> string, children *=> person]. –Definitions of instances This is just specification of data that populates ontologies. Specified using rules and facts. For instance: john:student. john[name -> ’ John Doe ’, address -> ’ 1 Main St. ’ ]. X:grandfather :- X:person[children -> C[children -> GC]].

26 July 2005 Reasoning Web Summer School, Msida, Malta26 Example of Ontology Domain: Semantic Web Services Scenario: Finding travel services according to various criteria (the Web service discovery problem)

27 July 2005 Reasoning Web Summer School, Msida, Malta27 Taxonomy germany, europe, etc. – classes of cities newyork, vienna, etc. – cities germany :: europe. austria :: europe. usa : region. europe : region. newyork : usa. vienna : austria. bonn : germany. frankfurt : germany. R:region :- R1:region and R::R1. L:location :- L:R and R:region.

28 July 2005 Reasoning Web Summer School, Msida, Malta28 User Goals and Related Concepts Concepts : goal[requestId *=> request, request *=> travelSearchQuery, result *=>> service]. search(From,To,Date) : travelSearchQuery :- From : (region or location) and To : (region or location). Instance : g123[ requestId -> 12345, request -> search (bonn,vienna, ’ 7/7/2005 ’ ), result ->> serv123 ].

29 July 2005 Reasoning Web Summer School, Msida, Malta29 Service Concept & Instance Concept : service[name *=> string, effect(travelSearchQuery) *=> formula, mediators *=>> mediator ]. Instance : serv123[ name -> ’ Fly High Travel ’, effects(Input) -> ${ (itinerary(Req)[from -> From, to -> To, date -> Date] :- Input = search(From:germany, To:austria, Date)) }, usedMediators -> med1 ].

30 July 2005 Reasoning Web Summer School, Msida, Malta30 Having Fun with F-logic Working with F-logic is fun! FLORA-2 is a full- fledged knowledge representation/logic programming system. Has a range of other interesting features: –Module system with encapsulation –Control flow constructs –Aggregates –Non-logical constructs for procedural diehards –Debugging support –Integration with databases, Web, Java, etc.

31 July 2005 Reasoning Web Summer School, Msida, Malta31 Conclusion F-logic is an object-oriented extension of predicate logic, which is particularly suitable for representing ontologies on the Semantic Web Based on the proven paradigm of rule-based logic languages Has a number of popular implementations, including commercial A basis for several W3C proposals in the semantic Web services domain Also proposed to W3C as the basis rule-based languages for the Semantic Web –In fact, the N3 language is nothing but a slightly altered syntax of F- logic, but with no semantics


Download ppt "July 2005 Reasoning Web Summer School, Msida, Malta1 Rules and Ontologies in F-logic Michael Kifer State University of New York at Stony Brook."

Similar presentations


Ads by Google