170 likes | 325 Views
From F-logic to CHORD. F-Logic Syntax. Atoms Focus on only two kinds of atoms s :: c (subclass relationship) s[m ->>v] (inheritable multi-valued method) s,c,m,v are logic terms Literal (A or ¬A) Rules (H L1 … Ln) Program A set of rules. F-Logic Semantics.
E N D
F-Logic Syntax • Atoms • Focus on only two kinds of atoms • s :: c (subclass relationship) • s[m->>v] (inheritable multi-valued method) • s,c,m,v are logic terms • Literal (A or ¬A) • Rules (HL1 … Ln) • Program • A set of rules
Herbrand Universe (HU) • The set of all ground (variable-free) terms constructed from the function symbols and constants in program Ex: P = { a[m(X)->>v] p(X) :: z, p(2) :: z, p(3) :: z, p(4) :: w } HU (P) = { a, v, z, w, 2, 3, 4, m(a), m(v), …, p(a), p(v)… }
Herbrand Instantiation (ground) • The set of rules obtained by consistently substituting all terms in HU(P) for all variables in every rule of P Ex: P = { a[m(X)->>v] p(X) :: z, p(2) :: z, p(3) :: z, p(4) :: w } ground(P) = { a[m(a)->>v] p(a) :: z, a[m(v)->>v] p(v) :: z, … }
Herbrand Base (HB) • The set of atoms of the form s::c and s[m->>v]/c where s,m,c,v are terms in HU(P) Ex: Ex: P = { a[m(X)->>v] p(X) :: z, p(2) :: z, p(3) :: z, p(4) :: w } HB(P) = { p(a)::z, p(v)::z, … a[m(a)->>v]/a, … }
Three Valued Interpretation (I) • Is a pair <T;U> where T and U are disjoint subsets of the Herbrand base HB(P). • T contains all atoms that are true in I • U contains all atoms that are undefined in I • Truth values: f < u < t, ¬f = t, ¬t = f, ¬u = u • I(A) = t, if A T • I(A) = u, if A U • I(A) = f, otherwise • If Ai HB(P), I(A1 … An) = min{ I(Ai) }
Truth Valuation Funcitons (Vh, Vb) • Vh(A,I) – truth value of A if it appears in the head of some rule • Vh(s::c, I) = I(s::c) • Vh(c[m->>v], I) = I(c[m->>v]/c) • Vb(A,I) – truth value of A if it appears in the body of some rule • Vb(s::c, I) = I(s::c) • Vb(s[m->>v], I) = max{ I(s[m->>v]/c)| cHU(P) } • Vb(¬L, I) = ¬V(L, I) • Vb(L1 … Ln, I) = min{ Vb(Li, I) }
Three valued interpretation for Rules • For rules • I(H B) = t if Vh(H,I) ≥ Vb(B,I), • I(H B) = f, otherwise. • For facts • I(H) = t if Vh(H,I) = t), • I(H) = f, otherwise.
Program Satisfaction • I satisfies P if for every R in ground(P), I(R) = t
Local Inheritance Contexts • s[m->>v] is a strong local context for s in I if I(s[m->>v]/s) = t • s[m->>v] is a weak local context for s in I if I(s[m->>v]/s) = u
Inheritance Context • c[m->>v] is a strong inheritance context for s in I, if: • s is a proper subclass of c • m ->> v is locally defined in c • There’s no other weak of strong local inheritance context of m in s • c[m->>v] is a weak inheritance context for s in I, if: • s is a proper subclass of c • m ->> v is locally defined in c • All local inheritance contexts of m in s are weak
Overriding • o strongly overrides c[m->>v] for s in I, if • o is a proper subclass of c • x o[m->>x] is a strong inheritance context for s • o weakly overrides c[m->>v] for s in I, if • x o[m->>x] is a weak inheritance context for s or o::c is undefined
Inheritance Candidates • c[m->>v] is a strongly inheritance candidate for s in I, if: • c[m->>v] is a strong inheritance context for s • Theres no o such that o weakly or strongly overrides c[m->>v] for s • c[m->>v] is a weak inheritance candidate for s in I, if: • c[m->>v] is a weak inheritance context for s or • c[m->>v] is a strong inheritance context for s and there is o such that o weakly overrides c[m->>v] for s
Prolog / F-Logic Closed World Assumption True / False / Undefined Logical Rules Semantics deals with True/False/Undefined parts of HB(P) CHR / CHORD Open World Aassumption True / False / Unknown Non-Logical Rules Constraint Store contains only part of the True facts (Remaining True/False/Unknown are inacessible) Differences Between CHR and Prolog
My Proposal • Add F-Atoms as CHR constraints • They would be able to be used both as BIC and as UDC • BIC: allows part of the class structure to be defined by the built-in solver • UDC: allows the user to defined the “user defined” part of the class structure • At each step, the Optimistic Object Model of the constraint store would be computer