200 likes | 321 Vues
This document presents the CHROME-REF project, which focuses on model-driven engineering of a generic Constraint Handling Rules (CHR) engine with advanced extraction and debugging capabilities. The project introduces a flexible trace schema that facilitates the separation of concerns in debugging, allowing tools to interact independently with various CHR implementations. It outlines the architecture of the system, including the trace driver and analyzer components, and discusses future works aimed at improving analytic capabilities and integration with different Prolog systems.
E N D
CHROME-REF CHRv Online Model-driven Engine with Reasoning Explanation Facilities INRIA / UFPE Rafael Oliveira – Rafael.Oliveira@inria.fr Jacques Robin - robin.jacques@gmail.com Pierre Deransart - Pierre.Deransart@inria.fr Rocquencourt, France October 28, 2009
Agenda • Separation of concerns (CHROME-REF Project) • Engine, Extraction, Driver and Analyzer • Generic CHRv Trace Schema for Debugging • Trace Driver • Trace Analyzer • Conclusion • Future Works
Separation of Concerns • At present, there exists a number of useful debugging tools for CHR • Tools were designed and implemented in a specific way for each solver • Each implementation results in a set of one-to-one specialized connections between a solver and its tools CHR ECLiPSe Prolog Debugging Tool CHR SWI Prolog Debugging Tool … … CHR SICStus Prolog Debugging Tool
Separation of Concerns • Trace Meta-Theory • ... • ... • Flexible • Portable CHR Trace Schema query CHR ECLiPSe Prolog Extraction CHR Trace Driver Analyzer CHR SWI Prolog Extraction … CHR SICStus Prolog Extraction
CHROME-REF Project • Engine • CHROME engine • a compiler that take a CHR base into imperative Java objects • MDE approach during its process of compilation by means of ATL transformations. • Extraction • Theoretical Operational Semantics ωt • Integration (ωt + CHROME) • Generic CHRv Trace Schema for Debugging • Driver • A processor, on the fly, of traces events according to the query requested by the analyzer. • Analyzer • Debugging Tool
CHROME-REF Project • Engine • CHROME engine • a compiler that take a CHR base into imperative Java objects • MDE approach during its process of compilation by means of ATL transformations. • Extraction • Theoretical Operational Semantics ωt • Integration (ωt + CHROME) • Generic CHRv Trace Schema for Debugging • Driver • A processor, on the fly, of traces events according to the query requested by the analyzer. • Analyzer • Debugging Tool
Generic CHRv Trace Schema for Debugging • A generic trace enables any tool to be defined almost independently • The trace syntax is represented using an XML Schema • A trace instance is encoded in an XML format according to this XML Schema and followsthe described semantics.
Generic CHRv Trace Schema for DebuggingClass Diagram Etrace label:String EInitialState EIntroduce ESolve EApply EFail Goal UDC BIC Built-ins Rule * *
Generic CHRv Trace Schema for DebuggingXML Schema <?xml version="1.0" encoding="UTF-8"?> <xs:schemaxmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://orcas.org.br/chrv" xmlns="http://orcas.org.br/chrv" elementFormDefault="qualified"> <xs:element name="chrv"> <xs:complexType> <xs:sequence> <xs:element name="event" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:choice> <xs:element name="initialState" minOccurs="1” maxOccurs="1"> <xs:complexType> <xs:sequence> <xs:element name="goal" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="introduce" minOccurs="1" maxOccurs="1"> ...
Trace Driver • A processor, on the fly, of traces events according to the query requested by the analyzer. • 3 Services • Register Analyzer • Notify Analyzer • Update Filter
Trace Driver • A processor, on the fly, of traces events according to the query requested by the analyzer. • 3 Services • Register Analyzer • Notify Analyzer • Update Filter CHROME sends trace events register, filter and notify analyzers
Trace Driver contextTraceDriver::registerAnalyzer(a:Analyzer) post: analyzer->includes(d) contextTraceDriver::notifyDriver(eTrace:ETrace) post: analyzers->forAll(a | a^notification(filterTrace(a.request, eTrace))) contextTraceDriver::updateFilter(a:Analyzer, request:Request) post: a.request = request
Trace Analyzer • Requirements • A graphical environment component for writing and analyzingCHRv programs • User may ask for more information about the current event • The execution can be blocked until the analyzer notify it that it can proceed
References • VITORINO, J. Model-Driven Engineering a Versatile, Extensible, Scalable Rule Engine through Component Assembly and Model Transformations. Universidade Federal de Pernambuco. CIn. CiênciadaComputação, 2009. • DUCK, G., STUCKEY, P., DE LA BANDA, M., and HOLZABAUR, C. The refined operational semantics of Constraint Handling Rules. Lecture notes in computer science (2004), 90–104.