RReuseeuseOOrientedrientedAAutomateutomateddRReasoningeasoningSSoftwareoftware
Jacques Robin
OutlineOutline
1. Motivation and goal2. Design principles of the ROARS framework3. Reuse-oriented software engineering techniques4. CHRV as a platform for automated reasoning service
integration5. Current status and next steps
Motivation: the CurrentMotivation: the CurrentAutomated Reasoning ParadoxAutomated Reasoning Paradox
• Most information system issues related to:• Scalable and secure concurrent access• Component-based web deployment• Software process
• Solved by current standards:• J2EE, .Net, Web Services, SQL,XML,UML,RUP
• Competitive edge thus based on:• Embedded automated reasoning
• Automated reasoning techniques over last two decades:
• Diversification (abduction, inheritance, belief revision, belief update, planning,
constraint solving, induction, analogy)• Practical scalability• Rigorous formal foundations
• Cutting-edge AR techniques remain ignored by commercial software
• Prohibitive cost of incorporating AR techniques in mainstream software
• Too costly to develop from scratch
• Available AR software not built for integration, extension and reuse
Goal of ROARS ProjectGoal of ROARS Project
Develop a framework for low-cost engineering of inference engines, knowledge bases and applications with embedded automated reasoning
By exploiting conceptual reuse among automated reasoning techniques at the software architecture level
ROARSFramework
ReasoningComponent
Library
SoftwareProcess
BenchmarkApplication
Library
CASETools
Design Principles: Paradigm Design Principles: Paradigm IntegrationIntegration
ROARSProcess
AspectOriented
FormalMethods CHORD:
executableyet formalOO rules
Fast Prototyping
ComponentBased
ModelDriven
Built-InContractTesting
KobrAProcess
Atkinson, Gross et al.
GUIModeling
Koch et al.Blankenhorn et al.
CHRV
Fruehwirth,Abdennadher
et al.
FrameFrameLogicLogic
Kifer, Yang et al.
StandardMDA Languages
UML2
MOF2
QVT/ATL
SPEM2
OCL2
Component,Application OO Models
Modeling Language OO Meta-Models
Model Transformation OO Models
Software Process OO Models
Logical Constraints on OO Models
Main Concern FunctionalitiesModel or Code w/ Woven
Cross-Cutting Functionalities
Aspect-Oriented Development (AOD)Aspect-Oriented Development (AOD)
Aspects recurrent in many domains: persistence, distribution, concurrency, authentication, logging
Too tightly coupled w/ main concern to be encapsulated as component
RawMain Concern
FunctionalitiesModel or Code
AspectWeavingEngine
Aspect 1: Model or CodeTransformation to Insert (Weave)
Cross-Cutting Functionality 1Through Pattern-Matching
Pointcuts
Aspect 1
AdvicesAspect A
AdvicesAspect N
Pointcuts
Aspect N
Aspect N: Model or CodeTransformation to Insert (Weave)
Cross-Cutting Functionality NThrough Pattern-Matching
ROARS MDAOCB Software ProcessROARS MDAOCB Software Process
Knowledge-levelPlatformIndependentModel
Formal-levelPlatformIndependentModel
PlatformSpecificModel
SeparatedSourceCode & Meta-Code
WovenSourceCode
DeployedCode
Main ConcernComponents
VerticalTransform.
Cross-Cutting Concerns Aspects:Horizontal Transformations
UML2
ATL / QVTRules
ATL / QVTRules
UML2 Profilefor J2EE / .Net
J2EE / .Net
VerticalMeta-
Transform.
PoincutsAdvices
ATL / QVTRules
ATL / QVTRules
ATL / QVTRules
AdvicesPoincuts
ATL / QVTRules
ATL / QVTRules
AdvicesPoincuts
ATL / QVTRules
AspectJAspect C#
Advices
Poincuts
ATL / QVTRules
CHORD
J2EE / .NetAspectWeaver
.Jar / .dll Java / C#Compiler
Dimensions of AR ServicesDimensions of AR Services
Propositional
First-OrderRelational
First-Order OO
High-OrderRelational
High-Order OO
Knowledge Representation LanguageOntological Commitment
Knowledge Representation LanguageEpistemological Commitment
Boolean Logic OWA
Ternary Logic CWA
Ternary Logic OWA
Probabilistic
Boolean Logic CWA
Reasoning Task
DeductionAbduction BeliefRevision
BeliefUpdate
ConstraintSolving
OptimizationInductionAnalogyInheritance Planning
Dimensions of AR ServicesDimensions of AR Services
Reasoning Task
DeductionAbduction BeliefRevision
BeliefUpdate
ConstraintSolving
OptimizationInductionAnalogyInheritance
From: X,Y p(X,a) q(b,Y) r(X,Y) p(1,a) q(b,2)Deduce: r(1,2)
From: X,Y p(X,a) q(b,Y) r(X,Y) p(X,c) n(Y) r(X,Y) p(1,a) r(1,2) p(1,c)w/ bias: q(A,B)Abduce: q(b,2)
From: G G instanceOf g p(G) s subclassOf g s1 instanceOf sInherit: p(s1)
From: X p(X) ~ r(X) q(X) n(X) (r(X) n(X)) p(a)Believe by default: r(a)But from new fact: q(a)Revise belief r(a) into n(a)
From: A si(A) do(A,k) sj(A) p(A) si(A) p(a)Initially believe: si(a)But after executing do(a,k)Update belief si(a) into sj(a)
Solve: X,Y,Z N X+Y=Z 1X XZ XY YZ Z 7Into: X=2 3Y Y 4 5 Z Z6or (X=2 Y=3 Z=5) (X=2 Y=4 Z=6)
From: X,Y,Z N X+Y=Z 1X XZ XY YZ Z 7w/ utility(X,Y,Z) = X + ZDerive optimum: X=2 Y=4 Z=6
From: p(1,a) q(b,2) r(1,2) p(1,c) n(2) ... p(3,a) q(b,4) r(3,4) p(3,c) n(4)w/ bias: F(A,B) G(C,D) H(A,D)Induce: X,Y p(X,a) q(b,Y) r(X,Y)
From: a ~1 b a ~2 c a ~11 d p(b,x) p(c,x) p(d,y)Derive by analogy: p(a,x)
Planning
From: A sa(A) do(A,i) sb(A) ... sh(A) do(A,k) sg(A) sa(a) goal(a) = sg(a)Plan to execute: [do(a,i), ... , do(a,k)]
Epistemological CommitmentEpistemological Commitment
Boolean Logic CWA
Boolean Logic OWA Ternary Logic CWA
Ternary Logic OWA
Probabilistic
f KBFrom: KB | f Assume: f
f KB xor f KBFrom: KB |= f KB | f Derive: f unknown
Ontological CommitmentOntological Commitment
High-OrderOO
High-OrderRelational
First-OrderOO
First-OrderRelational
PropositionalOnly propositions (no variables, relations, classes nor objects)rain wetGrass
Predicates (relations) with universally quantified variable arguments,and recursive functions, but no structural aggregation of properties nor distinguished generalization relationD,G day(D) rain(D) ground(G) state(G,wet) ground(grass)
In essence, UML:classes, objects, attributes, associations (relations), operations
Universally quantified variables in predicates, functions, and formula positionsR,X,Y trans(R)(X, Y) (R(X, Y) (R(X, Z) trans(R)(Z,Y))
Universally quantified variables in class, attribute, association and method positionsIn essence, meta-circular UML (M3 = M2 = M1)S,G,A,T trans(subclassOf)(S,G) type(G.A) = T type(S.A) = T
Dimensions of AR ServicesDimensions of AR Services
Propositional
First-OrderRelational
First-Order OO
High-OrderRelational
High-Order OO
Knowledge Representation LanguageOntological Commitment
Knowledge Representation LanguageEpistemological Commitment
Boolean Logic OWA
Ternary Logic CWA
Ternary Logic OWA
Probabilistic
Boolean Logic CWA
Reasoning Task
DeductionAbduction BeliefRevision
BeliefUpdate
ConstraintSolving
OptimizationInductionAnalogyInheritance Planning
What minimal set of basic components
can cover thisentire service space through assembly ?
CHRV
AR Service MappingsAR Service Mappings
AbductionFirst-Order Relational
Probabilistic
DeductionFirst-Order Relational
Probabilistic
DeductionFirst-Order OOProbabilistic
AbductionFirst-Order OOProbabilistic
Object-Oriented Bayes Nets (OOBN)
DeductionFirst-Order Relational
Boolean Logic CWA
Constraint SolvingFirst-Order Relational
Ternary Logic OWA
CLP(BN)
OptimizationFirst-Order Relational
Probabilistic
Dechter
InheritanceDeduction
High-Order OOTernary Logic CWA
DeductionFirst-Order Relational
Ternary Logic CWA
Frame Logic
DeductionFirst-Order Relational
Ternary Logic OWA
CHRV
Belief RevisionFirst-Order Relational
Boolean Logic CWA
AbductionFirst-Order Relational
Ternary Logic OWA
Kakas et al.
CHRV
AR Service MappingsAR Service Mappings
InductionHigh-Order OOTernary Logic
CWA
InductionFirst-OrderRelational
Ternary Logic CWA
Cigolf
InductionFirst-OrderRelational
Probabilistic
InductionFirst-Order OOProbabilistic
OOBN
PlanningFirst-OrderRelational
Probabilistic
ConstraintSolving
First-OrderRelational
Ternary LogicOWA
Belief UpdateFirst-OrderRelational
Probabilistic
AbductionFirst-OrderRelational
Ternary LogicCWA
ACLP
CHRCHRVV
CHRV engine versatile basic component with very high reuse potential for ROARS framework
Integrates and generalizes three main logical rule based reasoning and programming paradigms: Conditional rewrite rule forward chaining for constraint simplification
and non-monotonic reasoning h1 ... hn g1 ... gn | (b1
1 ... b1n) ... (bk
1 ... bkm)
Event-triggered production rules forward chaining for constraint propagation and monotonic reasoning h1 ... hn g1 ... gn | (b1
1 ... b1n) ... (bk
1 ... bkm)
Backtracking search of alternatives in disjunctive bodies for simulating Prolog's backward chaining and labeling in finite domain constraint solving
CHRV syntax covers full first-order logic in implicative normal form: atom1 ... atomn atomn+1 ... atomm
Not limited to Horn logic Open-world assumption, but selective closed-world assumption with
additional propagation rules
Frame LogicFrame Logic
Integrates object-oriented and logical rule based programming and reasoning
Multiple, single source, non-monotonic inheritance (overriding) of: Attribute and method type constraints and values Method code
Ternary logic well-founded semantics with CWA for negation as failure, non-monotonic inheritance and interferences between inheritance and deduction
High-order syntax allowing logical variables in position of function predicate, atom, object, classe, attribute and method names Permits logical meta-rules and object-oriented reflection while remaining
within first-order logic semantics and complexity Operator to reify formulas as terms in rule bodies Database aggregation operators in rule bodies Backtrackable explicit knowlegde base updates operators in rule bodies
with transaction roll-back semantics guaranteeing consistency (but no built-in turth-maintenance)
Procedural operators in rule bodies
CHORD: CHRCHORD: CHRVV + Frame Logic + Frame Logic
CHORD: Constraint Handling Object-oriented Rules with Disjunctive bodies
FPIM layer in ROARS framework intermediate representation between two object-oriented layers: KPIM in UML and OCL PSM in UML profile for J2EE or .Net Using purely relational CHRV as FPIM layer language would make automated
transformations from KPIM to FPIM to PSM uselessly complex CHORD key idea:
Extends CHRV with Frame Logic's object-oriented features Syntactically, add:
High-order OO frame molecules and OO path expressions as constraintsstart ==> t:square, quadrilateral[side1 *=> line[length *=> int], ..., side4 *=> line], square::quadrilateral.
T:square ==> T.side1.length = T.side2.length, ..., T.side1.length = T.side4.length | true. Reification operator
Semantically: Soundly integrate Frame Logic's multiple, single-source, non-monotonic
inheritance under CWA with CHRV deduction and abduction under OWA
CHR for FPIM Component AssemblyCHR for FPIM Component Assembly
Distinction between user-defined and built-in constraints in CHR can be generalized into constraints locally defined in rule base component and externally defined in server rule base component
derive
<<Component>>Min CHRD Base
min(X,Y,Z) X Y | Z = Xmin(X,Y,Z) Z Y | Z = Xmin(X,Y,Z) Y Z | Z = Ymin(X,Y,Z) Z X | Z = Ymin(X,Y,Z) Z X Z Y
XY
min(X,Y,Z)
XY
<<Component>>CHRD Engine
derive
<<Component>>
CHRD Base
X Y X = Y | trueX Y Y X X = YX Y Y Z X = ZX Y X Y X Y
X=YXY
derive
<<Component>>Host Platform
XY X=Y
<<Component>> CHRD Base
X X falseX Y Y Z X Y Y Z | X Z X Y Y Z X Y Y Z | X Z X Y Y Z X Y Y Z | X Z
XY derive
XY
Current StatusCurrent Status
ROARS project recently funded by CAPES-DAAD Current team:
Universidade Federal de Pernambuco, Brazil: Profs. Jacques Robin, Silvio Meira, PhD. student Jairson Vitorino, Undergraduate research assistant Marcos Silva, MSc. student João Prazeres
Universidade de Pernambuco, Brazil: Prof. Luis Menezes Ulm Universität, Germany: Prof. Thom Fruehwirth, PhD. student Marc
Meister Mannheim Universität, Germany: Prof. Colin Atkinson,
PhD. students Matthias Gutheil and Dietmar Stoll Fraunhofer-Gesellschaft Berlin, Germany: Dr. Armin Wolf, Matthias Hoche
Available results: CHREK 1.0: prototype Java/AspectJ CHRV inference engine with
Eclipse plug-in GUI (Silva, Vitorino, Robin) CHORD MOF metamodel (Robin, Silva, Vitorino) CHORD 1.0: prototype Java/AspectJ CHORD inference engine with
Eclipse plug-in GUI with rule-based inheritance (Silva, Robin)
Next StepsNext Steps
SPEM specification of ROARS process Vitorino, Robin, Atkinson, Blanc
Model-Driven, Component-Based, Aspect-Oriented Development of CHREK 2.0 Scalable adaptive CHRV engine w/low-level truth-maintenance and
detailed explanation GUI Vitorino, Prazeres, Robin, Wolf, Atkinson, Fruehwirth, Menezes
Adapt Built-In Contract Testing techniques for FPIM layer CHRV/CHORD rule based components Prazeres, Robin, Atkinson, Fruehwirth
CHORD formal semantics in transaction logic Meister, Robin, Fruehwirth, Menezes
Investigate inheritance built in pattern matching for CHORD, by adapting techniques from ordered sort feature term unification (Aït-Kaci, Cortiuz, etc) Silva, Robin
ConclusionConclusion
Cutting-edge automated reasoning techniques: Conceptually highly compositional Compositionality never exploited by architecture of available
automated reasoning software Result in prohibitive cost of incorporating these techniques in
mainstream applications ROARS:
Exploit, adapt and extend cutting-edge, reuse-oriented software engineering techniques to lower cost of automated reasoning software development
Define software process integrating MDD, CBD and AOD Define CHORD language by extending CHRV with Frame Logic style
object-orientation and inheritance Use software process to develop scalable, adaptive CHORD
inference engine as a first large grained ROARS component integrating deduction, abduction, belief revision, inheritance and constraint solving services
ReferencesReferences
http://www.cin.ufpe.br/~jr/mysite/RoarsProject.html