120 likes | 234 Views
XCC e X tensible C omputation C ontext. Antonio Capani Explo-IT Research www.Explo-IT.com. What is XCC?. The eXtensible Computation Context consists of a methodology for developing open and collaborative systems for doing computations
E N D
XCCeXtensible Computation Context Antonio Capani Explo-IT Research www.Explo-IT.com
What is XCC? • The eXtensible Computation Context consists of • a methodology for developing open and collaborative systems for doing computations • an extensible language (XCL) for development and maintenance of computation languages • a set of tools which act as integration technology (or middleware) between mathematical systems and non-mathematical systems
Extensibility of Languages • Some High level languages like C, C++, Java, Smaltalk, Pascal, are designed to be concise and possibly near to human language and standard notations • In almost all cases the syntax of the language cannot be extended, for example, by adding new primitive types • On the contrary, during the development of a mathematical system, may arise the need for extending syntax and semantics • Moreover different (mathematical) systems could benefit from a standardization of their languages
Syntactic Sugar • When trying to extend a language quite often happens that, even if the semantical extension is clear, the designer of the language have difficulties in finding a suitable syntax • For example: what could be the syntax for adding “set” to the C language as primitive types? • The candidate delimitators of the set should be “{“ and “}” but they are already taken as delimitators of blocks of commands
The XCL Intermediate Language • XCL stays for eXtensible Computation Language • The syntax of XCL is based on the XML (meta)language. • High Level languages may mapped to XCL (are seen as user friendly representations of XCL programs) • The semantics of XCL is given in a declarative way and is "plugged" to each XCL program during its execution. • XCC offers a basic XCL language which contains lots of standard functionalities like: • primitive types (e.g.: int,string,list,record,matrix) • standard operators to build expressions • standard commands (e.g.: assignment,for,while) • definition of new commands and packages
Usage of XCL • XCL is at a low level but it is human readable (because it is based on XML). • So it is possible to extend the XCL syntax and apply semantics to it even before designing a high level language. • For example it is useful for mathematical teams because they focus on the mathematical library and on mathematical research rather than the computer science aspects.
Example of XCL program <?xml version="1.0"?> <!DOCTYPE xcl PUBLIC "-//EXPLOIT//DTD XCL-Basic//EN" "http://www.Explo-IT.com/dtd/XCL-Basic.dtd"> <xcl> <assign> <var name="x"/> <make-list> <true/> <and><true/><false/></and> </make-list> </assign> </xcl> <!-- this corresponds to X := [True,True AND False]; -->
Example of plugged semantics # commands (from XML tagname to Java classname) assign = com.ExploIT.coco.xcl.XCLCommandAssign write = com.ExploIT.coco.xcl.XCLCommandWrite if = com.ExploIT.coco.xcl.XCLCommandIf for = com.ExploIT.coco.xcl.XCLCommandFor while = com.ExploIT.coco.xcl.XCLCommandWhile # expressions (note the difference between expressions and values) var = com.ExploIT.coco.xcl.XCLExprVar and = com.ExploIT.coco.xcl.XCLExprBool or = com.ExploIT.coco.xcl.XCLExprBool not = com.ExploIT.coco.xcl.XCLExprBool make-list = com.ExploIT.coco.xcl.XCLExprList # values list = com.ExploIT.coco.xcl.XCLValueList true = com.ExploIT.coco.xcl.XCLValueBool false = com.ExploIT.coco.xcl.XCLValueBool
XCC Platform • An XCC platform offers means for: • execution of XCL programs (XCL Engine) • XCL-devices (devices which write or read XCL data) • Session Management Framework (multiuser, multisession generic tool for XCL queries) • connection to other XCC enabled tools, for the remote execution of XCL programs • connection to non XCC-enabled tools • export of computation results in OpenMath or MathML format • visualization of results in browsers
XCC Platforms XCC Platform non-XCC XCL Semantics Main XCL Engine XCL Devices XCC Platform Session Management Framework Low Level Library
Standard Mathematical Protocols • The XCL language may be used as a standard way for representing data and programs, but multiple protocols may be used. • Currently we are collaborating with the OpenMath Society in order to: • define a formal specification of XCC • integrate the XCC methodology with the OpenMath and MathML
Conclusions and Future Directions • An application of XCC (called CoCo, Computation Context) is in progress for the new major release of the CoCoA System in collaboration with the CoCoA Team (http://cocoa.dima.unige.it) leaded by Prof. Lorenzo Robbiano of the University of Genova. • It is under study the implementation "active documents", that is documents containing formulas which may be executed within the document itself.