Department of Computer Science
Composition and Interoperation
- f Rules
Composition and Interoperation of Rules Enrico Pontelli and Tran - - PowerPoint PPT Presentation
Composition and Interoperation of Rules Enrico Pontelli and Tran Cao Son Chitta Baral Department of Computer Science Computer Science and Engineering New Mexico State University Arizona State University Department of Computer Science
Department of Computer Science
Department of Computer Science
Department of Computer Science
relevant for the RuleML flavor of B
http://www.ruleml.org/modularization/#Model
Department of Computer Science
Department of Computer Science
Department of Computer Science
RuleML Documents
PiLLoW W4 Compiler
Compilation Phase
ASP (nafdatalog) Prolog (hornlog) CLIPS (ECA)
Modules
CORE FRAMEWORK
ASP-Prolog Program
CLP
Department of Computer Science
– Π = Πu ∪ Πd (user-defined and built-ins)
– Literals
(atom)
(naf-atom)
(qualified atom)
– Rules: – Ξ-rules (Ξ = datalog, ground datalog, pure Prolog, …)
n 1
Department of Computer Science
Department of Computer Science
Department of Computer Science
Department of Computer Science
– T does not contain qualified atoms – e.g.,
P(Mti) ⊆ 2BP semantics of module Mti
– MR(M,A1,…,Ak) model reduct of module M w.r.t. A1,…,Ak
MτP (Mti) = NAT(MR(Mti,MτP (Μt1),…,MτP (Μti-1)))
Department of Computer Science
– for simplicity, performed in module tn, impure Prolog module
– State: (G, θ, P) – Transition: (G, θ, P) ⇒ (G’, θ’, P’)
– G’ = (G \ {A} ∪ Body)mgu(A,H) – θ’ = θ º mgu(A,H) – P’ = P
– G’ = G \ {A}
– θ’ = θ º mgu(A,H) – P’ = P
– G’ = G \ {A}
– θ’ = θ º mgu(A,H) – P’ = P
– G’ = G \ {ti:model(t)} – θ’ = θ – P’=P
– G’ = G \ { ti:assert(r)/ti:retract(r)} – θ’ = θ – P’ = P \ {Mti}∪ {Mti ∪ {r}} [P’ = P \ {Mti} ∪ {Mti \ {r}} ]
Department of Computer Science
Department of Computer Science
Prolog Modules ASP Modules ECA Modules updated Prolog Modules ASP-Prolog Preprocessor
interface modules model classes interface modules
CLIPS Modules CIAO Prolog Module Load
Goals Answers
Department of Computer Science
– updated to access the newly created CIAO Interfaces of other modules
– compiled to
retract)
facts)
instances of the model class
– compiled to CLIPS modules – Prolog interface:
Department of Computer Science
Module 1 Module k export p import p import q export q assert p(a) getfacts
p(a) :- ... ... :- ..., q, ...
CLIP S P rogram
(defrule “...” ?f < - (p ?x) = > (retract ?f) (assert (q ?x)))
P rolog P rogram
Department of Computer Science
Department of Computer Science
Department of Computer Science
– URL: http://www.cs.nmsu.edu/~okhatib/asp_prolog.html