300 likes | 400 Views
Explore F-Logic's well-founded semantics and evaluation strategies, including examples and concepts such as unique IDs and parametrized attributes for efficient knowledge representation and reasoning.<br>
E N D
q(f(a), a), q(a,c), q(f(c),c), r(a, c), r(c, d), r(e,f)p(X, Y) q(f(X), X) r(X, Y) p(X, c) Naive Evaluation X f(X) X Y X Y a c f(a) a a c c d f(c) c c d a c e f
Given an interpretation IµBP. T is defined by: Immediate Consequence T(I) = {H σ | H <- B1 Λ.. Λ Bn. and Biσ I} , σis a variable substitution. T1(I) = T(T(T(….(I)….)))
If a n exists: Tn(I) = Tn+1(I) then G = Tn(I) = I1 Is the set of concluded facts (without negation) Semantics without Negation
p(a). p(b). q(a). r(X) q(X). t(X) p(X) and r(X). Example I = {p(a), p(b), q(a)} T(I) = {r(a)} {p(a), p(b), q(a)} T(T(I)) = {r(a), t(a), p(a), p(b), q(a)} = T(T(T(I))) = T(T(T(….(I)….)))
p(a). p(b). q(a). r(X) q(X). Level 1 t(X) p(X) and not r(X). Level 2 Stratification: Example I0 = {p(a), p(b), q(a)} T(I0) = {r(a)} {p(a), p(b), q(a)} = I1 T(I1) = {t(b), r(a), p(a), p(b), q(a)} = I2
What about the following? person(somebody). woman(X) <- person(X) and not man(X). man(X) <- person(X) and not woman(X).
Van Gelder et al., JACM 1991, http://citeseer.nj.nec.com/gelder91wellfounded.html If there exists some n: Tn+1(I) = Tn-1(I) and Tn+2(I) = Tn(I) Then the true facts are defined by the smaller sets of Tn-1(I) and Tn(I) Unknown facts are given by set difference. Alternating Fixed Point (Well-Founded Semantics)
person(sb). woman(X) <- person(X) and not man(X). man(X) <- person(X) and not woman(X). Alternating Fixed Point: Example T(I={person{sb}}) = {woman(sb), man(sb), person(sb)} T(T(I)) = {person(sb)} T(T(T(I))) = {woman(sb), man(sb), person(sb)} T(T(T(T(I)))) = {person(sb)} True Facts = {person(sb)} Unknown Facts = {woman(sb), man(sb)}
F-Logic (Syntax) Kifer, Lausen, Wu, Journal of the ACM, 42:741–843, 1995.
F - Logic • Object Oriented (Frame Based) Logic • Well-Defined Semantics (Well-Founded Semantics) • Efficient Evaluation Strategy • Turing-Complete
Concepts and Subconcept Relationship Objects are identified using unique Ids Person::OBJECT. Man:: Person. Woman::Person. Employee::Person. Professor::Employee. Student::Person. PhDStudent::Student. AcademicInstitution::Object. University::AcademicInstitution. http://www.projecthalo.com/ -> downloads -> Halo pilot downloads -> Ontoprise Halo Improved download(Format: EXE/78 MB)
Conceptual Modeling Define Range of Attributes: Person[hasName=>>STRING; hasBirthdate=>DATE; hasWeight=>NUMBER; ......]. AcademicInstitution[hasName=>>STRING; hasAddress=>>STRING; …]. Student[studiesAt=>AcademicInstitution; …].
Instances and Attributes Assign values to Attributes : Schmidt:Student. Schmidt[hasName->>“Stefan Schmidt"; studiesAt->>UKoLd; hasBirthdate->1985-0707; hasWeight->75.0]. UKoLd:University. UKoLd[hasName->>“Universität Koblenz-Landau"; hasAddress->>“Isaac-Fulda-Allee 3, Mainz"; …].
Rules & Queries // All students at UKoLd FORALL S <- S:Student[studiesAt->>UKoLd]. // Student at Academic Institutions of some state are students educated at the costs of this state Rule PaysFor: FORALL C,S,A,L C[paysEducationCostsOf->>S] <- S:Student[studiesAt->>A:AcademicInstitution] AND A[hasAddress->L] AND partOf(L,C) AND C:State.
Quantifier Quantifiers can range over concepts and attributes • FORALL X,Y <- X::Y. • FORALL X,R <- X[hasName=>>R]. • FORALL A,R <- University[A=>R].
F-Molecule • An F-Molecule Schmidt:Student[hasName->>“Stefan Schmidt"; studiesAt->>UKoLd; hasBirthdate->1985-07-07; hasWeight->75.0]. • …can be split into multiple F-Atoms: Schmidt:Student. Schmidt[hasName->>“Stefan Schmidt"]. Schmidt[studiesAt->>UKoLd]. Schmidt[hasBirthdate->1985-07-07]. Schmidt[hasWeight->75.0].
Parametrised Attributes Schmidt:Student[ studiesAt(UKoLd)->>”Computer Science”; studiesAt(FernUHagen)->>”Philosophy” ].
Predicates Instead of Schmidt:Student[ studies(UKoLd)->>”Computer Science”; studies(FernUHagen)->>”Philosophy” ]. We can also write studies(Schmidt,UKoLd,”Computer Science”). studies(Schmidt,FernUHagen,”Philosophy”).
Builtins isString(<arg>) concat(<string 1 > , <string 2 > , <string 3 >) cut(<string>,<n>,<variable>) tokenize(<string>,<delimiters>,<variable>) tokenizen(<string>,<n>,<delimiters>,<variable>) tolower(<string>,<variable>) toupper(<string>,<variable>) regexp(<regular expression>,<string1>,<string2>) constant2string(<function>,<string>) string2number(<string>,<number>) sin,cos,tan,asin,acos,ceil,floor,exp, rint,sqrt,round,max,min,pow
Builtin Examples • tolower: FORALL X <- tolower(“I Love Ontologies!”,X). • is, equals: FORALL B,C,A <- (B is A+1) AND (C is A+2) AND equals(A,1). • dbaccessuser2, concat: FORALL X, PROJECTID, PROJECTNAME X:Project[name->> PROJECTNAME] <- dbaccessuser2(“table_projects", F(“projectID",PROJECTID, “project_name",PROJECTNAME), "mssqlserver2000",“database_projects", “computer_xyz:1433", "zope","zope") AND concat(“project", PROJECTID,X).
Lists [a, b, c, d, e] [Head | Tail] [a, b, c, d | Tail]
Negation FORALL S S:NonTechnicalStudent <- S:Student[studiesAt->>UKoLd] AND NOT S[studies(UKoLd)->>”Computer Science”].
Namespaces To distinguish objects in different ontologies: <ns ontons:cars="www.cars-r-us.tv" ontons:finance="www.financeWorld.tv" ontons="www.myDomain.tv/private"> cars#Car[cars#driver => cars#Person; cars#passenger =>> cars#Person; cars#seats => NUMBER]. cars#Person[cars#name => STRING]. </ns>
Namespaces <ns ontons:cars="www.cars-r-us.tv" ontons:finance="www.financeWorld.tv" ontons="www.myDomain.tv/private"> cars#Car[cars#driver => cars#Person; cars#passenger =>> cars#Person; cars#seats => NUMBER]. cars#Person[cars#name => STRING]. </ns> Translated into obj(„www.cars-r-us.tv“,car)[obj(„www.cars-r-us.tv“,driver)=> obj(„www.cars-r-us.tv“,Person), ….] To distinguish objects in different ontologies:
Metamodelling InstitutionType[hasInstantiations->Number]. University:InstitutionType. Fachhochschule:InstitutionType. University[hasInstations->2]. Fachhochschule[hasInstantiations->1] Institution[hasName=>>String]. University::Institution. UKoLd:University[hasName->>”Universitaet Koblenz- Landau”]. UMainz:University[hasName->>”Universitaet Mainz”]. FHKoblenz:Fachhochschule[ hasName->>”Fachhochschule Koblenz”] .
Complex Rules Arbitrary First Order Formula p(1). p(2). p(3). FORALL X maximum(X) <- p(X) AND FORALL Y (p(Y) -> lessorequal(Y,X)).
Lloyd-Topor Transformation FORALL X,Y maximum(X) <- p(X) AND (NOT p(Y) OR lessorequal(Y,X)). FORALL X maximum(X) <- p(X) AND NOT q(X). FORALL X,Y q(X) <- p(Y) AND NOT lessorequal(Y,X). FORALL X maximum(X) <- p(X) AND FORALL Y (p(Y) -> lessorequal(Y,X)).
Transformation from F-Logic to Horn-Logic isa_(a,C) sub_(A,B) atttype_(A,B,C) setatttype_(A,B,C) att_(a,B,c) setatt_(a,B,c) a:C A::B A[B=>C] A[B=>>C] a[B->c] a[B->>c]
Transformation from F-Logic to Horn-Logic FORALL X,Y,Z setatt_(X,ancestor,Y) <- setatt_(X,father,Z) AND setatt_(Z,ancestor,Y). FORALL X,Y,Z X[ancestor->>Y] <- X[father->Z] AND Z[ancestor->>Y].