Semantics of templates in a compositional framework for building logics
Ingmar Dasseville , Matthias van der Hallen, Gerda Janssens, Marc Denecker
ICLP 2015
FO(·)-KBS project
-
a purely declarative KR language
-
an integration of classical logic with (extended) logic programs
-
based on the thesis :
rule set under
well-founded semantics
=
inductive definition as found in mathematical text
FO(·)-KBS project in practice
-
Closely connected with ASP and abductive LP
-
IDP: a knowledge base system
+ applications in software engineering
Observations
- KR-languages are repetitive (e.g. reachability)
- No abstractions with semantics
With a meaning which is embedded in the language
Existing approaches
ASP+Templates
- Very usable in practice (resulted in DLT)
- Template = Macro
- Recursion?
HILOG
- Better abstractions
- Procedural execution
- Template = second order definition
- First order semantics
GOAL
A logical view of templates: second order definitions
Treat templates as
(rule based) definitions
GOAL
Extend the semantics
of an arbitrary KR-language with templates
{transitiveClosure(P,Q) ←
{Q(x,y) ← P(x,y).
Q(x,y) ← (∃ z: Q(x,z)∧Q(z,y)).
}.
}
The Challenge
Well Founded Semantics +
- Second order predicates
- Nested definitions
⇒Recursive templates
- Previously unsolved problem
new language constructs are hard
Adding aggregates is done in a 1000 ways
New framework for adding language constructs and building logics
A COMPOSITIONAL FRAMEWORK
FOR BUILDING LOGICS
Define rule formalism
for an existing logic L
Lift two-valued semantics
to three-valued ones
Nested logics with a recursive syntax
TEMPLATES
A COMPOSITIONAL FRAMEWORK
FOR BUILDING LOGICS
Define rule formalism
for an existing logic L
Lift two-valued semantics
to three-valued ones
Nested logics with a recursive syntax
TEMPLATES
Rule formalsim for a logic L?
When can we define well-founded and stable semantics
for sets of rules of the form:
∀x: P(x) <- φ[x]
where φ is an expression of L?
When L has a
3-valued truth assignment:
(Partial Structure, φ) -> Three
3-valued truth assignment of logics
Rule formalsim for a logic L?
= The logic of well-founded rulesets over L
if I is a well-founded model of rule set R
= The logic of stable rulesets over L
Results obtained through Approximation Fixpoint Theory
L can already contain definitions!
Rule formalsim for a logic L
A COMPOSITIONAL FRAMEWORK
FOR BUILDING LOGICS
Define rule formalism
for an existing logic L
Lift two-valued semantics
to three-valued ones
Nested logics with a recursive syntax
TEMPLATES
3-valued evaluation of logics
∧: (Two² → Two)
t ∧ u = u
f ∧ u = f
u ∧ t = u
u ∧ f = f
A COMPOSITIONAL FRAMEWORK
FOR BUILDING LOGICS
Define rule formalism
for an existing logic L
Lift two-valued semantics
to three-valued ones
Nested logics with a recursive syntax
TEMPLATES
Logic =
Syntax + Semantics
Logic =
Set of Language Constructs
Language Construct =
Syntax + Semantics
Compositional framework
Syntax:
Semantics:
&: (Three² → Three)
&(t , u) = u
&(f , u) = f
&(u , t) = u
&(u , f) = f
Also works for rulesets!
COMPOSITIONAL FRAMEWORK
*
A COMPOSITIONAL FRAMEWORK
FOR BUILDING LOGICS
Define rule formalism
for an existing logic L
Lift two-valued semantics
to three-valued ones
Nested logics with a recursive syntax
TEMPLATES
What is a Template?
A second order, (well-founded) definition.
(Which we now can define over any logic L!)
Library of templates
∧
∧
Further results
- Theorem: Using templates as macros is a sound and complete transformational semantics for templates as higher order definitions
DLT is consistent with our work
Conclusion
- Define rulesets of an arbitrary logic
- Use these in a compositional framework
- Write libraries for arbitrary logics
ToDo:
- Better support for functions
- Typed Logics
- Use this compositional framework to develop a real system (IDP4)
Semantics of templates in a compositional framework for building logics
By Ingmar Dasseville
Semantics of templates in a compositional framework for building logics
- 1,209