110 likes | 200 Views
Compiling ASP into Event-Driven Action Rules. Neng-Fa Zhou (CUNY) Yi-Dong Shen (CAS) Jia-Huai You (U. Alberta). Background and Motivation. ASP is a powerful modeling language Elegant for knowledge-intensive problems Most ASP systems require grounding Grounding may take time
E N D
Compiling ASP intoEvent-Driven Action Rules Neng-Fa Zhou (CUNY) Yi-Dong Shen (CAS) Jia-Huai You (U. Alberta) LPNMR'11 (Zhou&Shen&You)
Background and Motivation • ASP is a powerful modeling language • Elegant for knowledge-intensive problems • Most ASP systems require grounding • Grounding may take time • The resulting grounded program may be too large to be stored and processed efficiently • Bottom-up iterative approach • GASP and ASPeRiX LPNMR'11 (Zhou&Shen&You)
Preparation • The stratified part is completely evaluated using tabling • For the unstratified part, three sets are used • IN: contains tuples that are known to be true • OUT: contains tuples that are known to be false • PIN: contains tuples that are assumptively true LPNMR'11 (Zhou&Shen&You)
The Procedure LPNMR'11 (Zhou&Shen&You)
Propagation LPNMR'11 (Zhou&Shen&You)
Encoding Relations • Encoding domains • p(L1..U1,L2..U2,…,Ln..Un) • [INp ,OUTp ] :: 0..S1*…*Sn+1 • where Si = Ui-Li+1 • Encoding tuples • p(a1,a2,…,an) is encoded as Cn where • C1 = (a1-L1) • Ci = Ci-1*Si+(ai-Li) LPNMR'11 (Zhou&Shen&You)
Primitives and Events • add_tuple(S,p(a1,a2,…,an)) • Exclude the code for p(a1,a2,…,an) from S • Iterators • foreach(p(A1,…,An) in S, …) • Event • tuple_added(S, p(a1,a2,…,an)) LPNMR'11 (Zhou&Shen&You)
Action Rules Agent, Condition, {EventSet} => Action • Agentp(X1,…,Xn) • Condition • Inline tests (e.g., var(X),nonvar(X),X==Y,X>Y) • EventSet • event(X,O) -- a general form event • ins(X) -- X is instantiated • Action • Same as a clause body LPNMR'11 (Zhou&Shen&You)
Encoding Propagation p(X,Z) :-q(X,Y),r(Y,Z) • Right-to-feft • Left-to-right LPNMR'11 (Zhou&Shen&You)
Performance Evaluation ASP2AR – B-Prolog, Hand-compiled GASP – SICStus-Prolog LPNMR'11 (Zhou&Shen&You)
Conclusion • ASP2AR is one giant step forward from GASP • In general, ASP2AR is still not competitive with Clasp or CLP(FD) • Another giant step is needed to make non-grounding approach competitive LPNMR'11 (Zhou&Shen&You)