[ Home | What's New | Contents | Overview | Contributors | Distribution | Examples | Documentation | Manual | Publications | Mailing List Archive | Problems ] | This page was last updated by Axel Belinfante on 2006-01-19 | |
TorX Test Tool Information | ||
Prev | Next |
labelled transition system
When active, the PRIMER receives commands from the standard input and writes answers in return to the standard output. See section COMMANDS and ANSWERS for the available commands and answers. When the PRIMER is used in the TORX tool it is connected to the DRIVER which has the control and initiative of all communications. When the PRIMER is used as standalone the user plays the role of the DRIVER.
A command consist of a single line of text. The keyword of all commands start with a prefix C_.
A answer consist of a single line of text or a multi-line of text. All single line answers start with a prefix A_. A multi-line answer has specific markers around the body of the answer. These markers consist of a single keyword at a single line, made up from the usual answer keyword, with _START and _END appended, respectively. Each line of the body of a multi line answer often starts with a keyword (but not always). Usually, the PRIMER answers to a command with the identical command-keyword, but with the C_ replaced by A_. Instead of the usual answer, an A_ERROR answer may occur in case of an error.
The following describes the syntax of the commands and answers:
A_ERROR text-upto-end-of-line nl
- interaction:
- message* command message* answer-or-error
- command:
- C_name arguments-upto-end-of-line nl
- answer-or-error:
- single-line-answer | multi-line-answer | error
- single-line-answer:
- A_name arguments-upto-end-of-line nl
- multi-line-answer:
- A_name_START nl multi-line-element* A_name_END nl
- multi-line-element:
- message | result-element
- result-element:
- A_element-name arguments-upto-end-of-line nl
- message:
- debug | log | warning
- debug:
- A_DEBUG text-upto-end-of-line nl
- log:
- A_LOG text-upto-end-of-line nl
- warning:
- A_WARNING text-upto-end-of-line nl
- error:
For some commands and some answers, the text following the keyword has a fixed format; for other commands and answers it is left unspecificed.
For command and answers that deal with channels, events, predicates, etc. the format of each such line is as follows: the keyword is followed by a (possibly empty) TAB-spearated list of name=value items, where the name cannot contain TABs or = characters, and the value cannot contain TAB characters. Note that the order of the name=value items is left unspecified, i.e. they may appear in any order, even though the presentation below, in the detailed specification of the commands and their answers, might suggest otherwise. For the moment we assume that, when necessary, we will encode TAB characters for example using C conventions. We have chosen for this kind of item-lists because this makes it easy to pass information. Using name=value pairs instead of (for example) a list of values in a fixed order makes the interface more robust: the order of items is not important, and, provided the users ignore items which name they don't recognize. This allows one party to send items which the receiving party doesn't know about. This makes it easier to extend the interface by adding new items and keeping old programs backwards compatible.
At the moment the following names of the name=value items, are defined:
event
with as value the LOTOS-like string representation of an event, used wherever ``event'' is used below;channel
with as value a channel name;iokind
where iokind is a value input or output;suspension
with as value either ``0'' or ``1'' to indicate a non-suspension resp. suspension event, used wherever an output ``event'' is used below (in the future we expect to use it also for input events)super
with as value a number that is used to represent a state-vector;init
with as value a comma-separated list of those state numbers that were directly reached by an observable transition;trans
with as value a comma-separated list of those state numbers that were reached from init via (an) internal (non-observable) transition(s).
Note1:
``predicates'' is currently only implemented in the generic primer(1).
Note2:
we may want to split the ``predicates'' into two (or more?) groups, depending on the complexity of the operation that we want (need) to perform on them. We could for example have one group that consists of equations, for which we need a single solution (witness), and another group consists of equations, for which we need proof that no solution exists.
Note3:
The lists of comma-separated state numbers of init and trans may contain abbreviations of the form first-last as abbreviation of strictly increasing sequences of the form first, (first+1), (first+2), ..., (last-2), (last-1), last, where last is equal to or greater than (first+1).
Answers are outputted after the receival of a command, but always before the command-specific answer or A_ERROR answer. I.e. once the command-specific answer or A_ERROR answer has been read, the user of the PRIMER may assume that no other output will be generated by the PRIMER until the next command is send to it.
Besides the "normal" (expected) answers the PRIMER can also respond with error and warning messages as answers.
Currently known errors:
A_ERROR UnknownCommand
A_ERROR ArgumentMissing/*if arguments are missing or incomplete*/
A_ERROR ParseErrorEvent/*if the event cannot be parsed*/
A_ERROR UnknownIOKind/*if iokind of event cannot be found*/
A_ERROR Inconsistency/*if fields conflict*/
A_ERROR WrongValue/*if a given field has value outside domain*/
A_ERROR InternalError/*if internal error occurred*/
In principle, each answer of the PRIMER can contain one or more diagnostic lines, indicating errors, warnings, end-of-test, or guidance information. Below some examples of ansers:
A_WARNING
A_EOT
A_GUIDANCE_VERDICT INCONSISTENT
A_GUIDANCE_VERDICT INCONCLUSIVE
A_GUIDANCE_VERDICT PASS
For logging of debugging information the following answers may appear anywhere.
A_DEBUG
A_LOG
C_IOKIND [iokind] [channel]
C_GETINPUT [channel] [event] [predicates]
C_INPUT [channel] [event] [predicates]
C_OUTPUT [channel] [event] [predicates]
C_QUIT
C_CHANNELS [iokind] [channel]
C_IOKIND [iokind] [channel]
C_GETINPUT [channel] [event] [predicates]
C_INPUT [channel] [event] [predicates]
C_GETOUTPUT [channel] [event] [predicates]
C_OUTPUT [channel] [event] [predicates]
C_INPUTS [channel]
C_OUTPUTS [channel]
C_STATE
C_STATEID
C_GOTO [super]
C_STATS
C_QUIT
C_GUIDANCE_INFO
C_GUIDANCE_QUIT
C_GETCONFIG
C_EOT
In the subsections below each command is followed by a short explanation of its use. Additional comments are enclosed between /* and */ after the command.
Commands:
C_CHANNELS [iokind] [channel]
Answers:
A_CHANNELS_STARTA_CHANNEL iokind channel ...A_CHANNELS_END...
A_ERROR Inconsistency/*if the iokind and channel fields conflict*/
A_ERROR WrongValue/*if a given field has value outside domain*/
where iokind is either INPUT or OUTPUT.
Commands:
C_IOKIND [iokind] [channel]
Answers:
A_IOKIND iokind channel
A_ERROR Inconsistency/*if the iokind and channel fields conflict*/
A_ERROR WrongValue/*if a given field has value outside domain*/
where iokind is either INPUT or OUTPUT.
Commands:
C_GETINPUT [channel] [event] [predicates]
Answers:
A_GETINPUT_OK channel event predicates
A_GETINPUT_ERROR/*if event is not in menu*/
A_ERROR ParseErrorEvent/*if the event cannot be parsed*/
A_ERROR ArgumentMissing/*if no event was given to simulator*/
A_ERROR UnknownIOKind/*if iokind of event cannot be found*/
A_ERROR Inconsistency/*if the iokind and channel fields conflict*/
A_ERROR WrongValue/*if a given field has value outside domain*/
A_ERROR InternalError/*if internal error occurred*/
Commands:
C_INPUT [channel] event [predicates]
Answers:
A_INPUT_OK channel event predicates
A_INPUT_ERROR/*if event is not in menu*/
A_ERROR ParseErrorEvent/*if the event cannot be parsed*/
A_ERROR ArgumentMissing/*if no event was given*/
A_ERROR UnknownIOKind/*if iokind of event cannot be found*/
A_ERROR Inconsistency/*if the iokind and channel fields conflict*/
A_ERROR WrongValue/*if a given field has value outside domain*/
A_ERROR InternalError/*if internal error occurred*/
Commands:
C_GETOUTPUT [channel] [event] [predicates]
Answers:
A_GETOUTPUT_OK channel event predicates
A_GETOUTPUT_ERROR/*if the event is not in menu of IOCO */
A_ERROR ParseErrorEvent/*if the event cannot be parsed*/
A_ERROR ArgumentMissing/*if no event was given to IOCO or traces*/
A_ERROR UnknownIOKind/*if iokind of event cannot be found*/
A_ERROR Inconsistency/*if the channel and event fields conflict*/
A_ERROR WrongValue/*if a given field has value outside domain*/
A_ERROR InternalError/*if internal error occurred*/
Commands:
C_OUTPUT [channel] [event] [predicates]
Answers:
A_OUTPUT_OK channel event predicates
A_OUTPUT_ERROR/*if the event is not in menu of IOCO */
A_ERROR ParseErrorEvent/*if the event cannot be parsed*/
A_ERROR ArgumentMissing/*if no event was given to IOCO or traces*/
A_ERROR UnknownIOKind/*if iokind of event cannot be found*/
A_ERROR Inconsistency/*if the channel and event fields conflict*/
A_ERROR WrongValue/*if a given field has value outside domain*/
A_ERROR InternalError/*if internal error occurred*/
Command:
C_INPUTS [channel]
Answer (multi-line):
A_INPUTS_STARTA_EVENT channel event predicates ...A_INPUTS_END
A_ERROR WrongValue/*if a given field has value outside domain*/
A_ERROR Inconsistency/*if the channel has wrong iokind*/
Command:
C_OUTPUTS [channel]
Answer (multi-line):
A_OUTPUTS_STARTA_EVENT channel event predicates ...A_OUTPUTS_END
A_ERROR WrongValue/*if a given field has value outside domain*/
A_ERROR Inconsistency/*if the channel has wrong iokind*/
Command:
C_STATE
Answer (multi-line):
A_STATE_STARTtext ... ...A_STATE_END
Command:
C_STATEID
Answer (single-line):
A_STATEID super init trans
Answer (multi-line):
A_STATEID_STARTA_STATEID identity super init trans...A_STATEID_END
Command:
C_GOTO super
Answer (single-line):
A_GOTO_OK
A_GOTO_ERROR A_GOTO_ERROR UnknownStateID super/*if an unknown super state was given*/
A_ERROR ArgumentMissing/*if no super field was given*/
Note that the GOTO command is a rather recent addition. As an unfortunate result of that, the A_GOTO_ERROR response currently has different parameters in the various implementations that we have. The CADP primer only returns A_GOTO_ERROR, whereas the 'generic' primer also returns the string UnknownStateID and the failing argument super state. We hope to make this more uniform once we have more experience with this interface command.
Command:
C_STATS
Answer (single-line):
A_STATS statistics
Answer (multi-line):
A_STATS_STARTA_STATS statistics...A_STATS_END
Note: when this command is send to the COMBINATOR it will send a C_QUIT command to each of the PRIMERs that it controls, and then clean up and exit, without waiting for the responses of the PRIMERs. In this respect this command differs from the C_GUIDANCE_QUIT command (see below).
Command:
C_QUIT
Answer:
A_QUIT
Command:
C_GUIDANCE_INFO
Answer:
A_GUIDANCE_INFO_STARTA_GUIDANCE_INFO id role...A_GUIDANCE_INFO_END
Command:
C_GUIDANCE_QUIT
Answer:
A_GUIDANCE_QUIT
Command:
C_EOT
Answer:
A_EOT_YES
A_EOT_NO
Prev | Table of Contents | Next |
Appendix D: TorX Manual Pages: torx-instantiator(5) - a program that implements an instantiator | Appendix D: TorX Manual Pages: xtorx-extension(n) - api to specify the Mutants, Primers and Guides menus |