C H A I M S: Compiling High-level Access Interfaces for Multi-site SoftwareTowards the Science of Component Engineering |
Literals can only be assigned for the simple types. Examples are given in parenthesis.
programname
Programname refers to the megaprogram's name. It is a string literal.
megamodulename
Megamodulename refers to the name of the megamodule the megaprogram is willing to interact with. It is string literal.
methodname
Methodname refers to the name of the method the megaprogram is willing to invoke within the megamodule. It is a string literal.
parametername
Parametername refers to the name of a parameter given as an input when calling a method in a megamodule megamodulename. It can be any of the CHAIMS data types (simple as well as complex).
The parameternames that appear in the INVOKE, EXTRACT, GETPARAM, EXAMINE, and SETPARAM primitives are the parameternames as listed in the repository. Valid parameternames for GETPARAM and SETPARAM are all parameternames listed in all methods of the specific megamodule or any global variable of the megamodule; valid parameternames for INVOKE and EXTRACT are all parameternames listed in the specific method of the megamodule. The parameternames for ESTIMATE are predefined and are: time of type datetime, and fee of type integer (in US$).
dataname
Dataname refers to data obtained from a megamodule, and can represent data of any CHAIMS data types. A dataname that stands for a boolean expression must of course be of type boolean, otherwise a semantic error occurs. The CHAIMS language is not explicitly typed, i.e. there is no type declaration for datanames in the megaprogram. Yet we specify the type of the parameters in the repository, so the user (and the compiler in case of semantic checks) can make sure that they do not use the wrong types for general helper modules.
Mathematical operators are not included in CHAIMS language but are invoked whenever necessary using "helper" megamodules. Types operations are then dependent on functionality provided by these megamodules.
The SETUP call establishes communication with a designated megamodule.
megamodule_handle = SETUP (megamodulename)
The SETPARAM call is used to establish parameters referred to in any
method of the megamodule identified by megamodule_handle or any
global variables of this megamodule. These new values take then precedence
over any default value previously set (see hierarchical
setting of parameters below).
megamodule_handle.SETPARAM (in_name_value_list)
The GETPARAM call can return the value of any parameter of any method
of the specified megamodule or any value of its global variables. Parameters
for which values are expected are explicitly mentioned in the out_name_value_list.
out_name_value_list = megamodule_handle. GETPARAM ()
The ESTIMATE call returns an estimation of the would-be cost of a specific
method invocation. It returns the time, fee, and/or data-volume of the invocation.
(mytime = time, myfee = fee, myvolume = volume) = megamodule_handle.ESTIMATE
(methodname)
or (mytime = time, myvolume = volume) = megamodule_handle.ESTIMATE
(methodname)
or (myvolume = volume) = megamodule_handle.ESTIMATE
(methodname)
or etc...
The INVOKE call starts the execution of a specified method. Any parameter
specified in the in_name_value_list will take precedence over
any value previously set (see hierarchical
setting of parameters below).
invocation_handle = megamodule_handle.INVOKE (methodname, [in_name_value_list])
The EXAMINE call is used to determine the state of the invocation referred
to by the invocation_handle. It can be any of {DONE, NOT_DONE, PARTIAL, ERROR}. Examine also has a second parameter that of type progess_status (an integer type) that can further describe the actual state of an invocation. EXAMINE can also be used to inspect a particular output parameter's readiness.
(mystatus = STATUS) = invocation_handle.EXAMINE()
(mystatus = STATUS, myprogress = PROGRESS) = invocation_handle.EXAMINE()
(mystatus = STATUS) = invocation_handle.EXAMINE(parametername)
(mystatus = STATUS, myprogress = PROGRESS) = invocation_handle.EXAMINE(parametername)
The EXTRACT call collects the results of an invocation in a list. A
subset of all parameters returned by the invocation can be extracted. In
fact, parameters which are extracted are the ones explicitly specified
in the out_name_value_list.
out_name_value_list = invocation_handle.EXTRACT ()
The TERMINATE call kills either a running invocation or a connection
to a specific megamodule. Killing a connection to a megamodule kills
all running invocations within this megamodule (i.e. all invocations made
by the same client within this megamodule, see client
specific primitives below).
megamodule_handle.TERMINATE () or
invocation_handle.TERMINATE ()
- Purpose
The INVEX call starts the execution of a specified method the way INVOKE primitive does. It does not return though till it collects the results of the invocation. The input parameters - if any - are set in the in_name_value_list whereas he output parameters are returned in the out_name_value_list. There is currently no possibilities to EXAMINE or TERMINATE an INVEX call; it is still under investigation.
- Syntax
out_name_value_list = megamodule_handle.INVEX (methodname, [in_name_value_list])
EXWDONE
- Purpose
The EXWDONE call waits till all results of the invocation identified by invocation_handle (or results specified in the out_name_value_list only) are available and then collects them in the output list. As for INVEX, there is currently no possibilities to EXAMINE or TERMINATE an EXWDONE call; it is still under investigation.
- Syntax
out_name_value_list = invocation_handle.EXWDONE ()
When a method is started with INVOKE, the order of precedence for the value of its parameters is as follows: for any parameter,
a) if INVOKE contains the parametername in its in_name_value_list, then the value specified in the list is taken; if it does not2- Case of Invocation-specific, Client-specific, and Client-and-Method-specific primitives:
b) the client-specific value set by SETPARAM is taken; if there is none
c) the default value hard-coded in the megamodule is taken (we currently assume there is such a default value for all parameters).
The primitives INVOKE. ESTIMATE and EXTRACT are invocation specific. The parameters they set or the results they return are for/from one specific invocation, specified by the invocation handle (i.e. the values set by INVOKE or returned by EXTRACT do not overwrite default values previously set by SETPARAM or hard-coded in the megamodule, even though these new values have precedence over previous ones). Also TERMINATE for invocation handles is invocation specific; it just kills the specified invocation.
The primitives SETPARAM and GETPARAM are client specific (we could also call it megaprogram specific). The parameters they set or return are those set for this specific client/megaprogram (one megamodule may have several clients using it at the same time). These parameters will be used for all subsequent method invocations for which no invocation specific values are given with the INVOKE primitive. The parameternames may be used by just one method, or by several different methods with different methodnames. Also TERMINATE for megamodule handles is client specific; it kills all invocations of this client.
The primitive ESTIMATE is client and method specific, but not invocation specific. The estimates it returns are for the specified methodname, and for the parameter settings for the client asking for the estimates.
To have an idea of how a megaprogram' structure looks like, please click
here. This link points to the version 2.0 of the transportation megaprogram
which is not implemented yet (a
demo of version 1.1 is available).
db 6/16/98