| predicatedef |
|
<predicate id = stringconst> |
| </predicate> | ||
| predicate-body |
|
<body> |
| </body> | ||
| <template> | ||
| </template> | ||
| <bind [idref=stringconst] [url=stringconst]> | ||
| </bind> | ||
| <if> | ||
| </if> | ||
| predicate-expression |
|
predicate-ref |
| <and> | ||
| </and> | ||
| <or> | ||
| </or> | ||
| <not> | ||
| </not> | ||
| predicate-ref |
|
<predicate idref=stringconst/> |
Any auto-completion specification consists of a number of predicate definitions. A predicate can be defined from scratch by defining each of its individual components like argument-list, check-code and auto-completion rules as shown by body element or it be a template for other predicates denoted by template element. The argument-list for a template serves as a placeholder for the template variables. It is possible to deduce an argument-list at compile-time but it is prone to errors. By making the argument-list explicit we can ensure that there are no template variables that remain uninstantiated. The bind element denotes a predicate which is defined by instantiating the referred template (given by idref attribute) and binding the arguments specified in the template's argument-list to concrete HTML form field values . A template can also be stored at a different place and can be accessed over the Internet by specifying url attribute of the bind tag. The predicate can also be formed by supplying appropriate predicate references to the IF-THEN-ELSE construct. We will describe the intended semantics of this construct later in Section 4.4. It suffices to say for the moment that the non-terminal predicate-expression is used to specify boolean expression trees which acts as guards to the auto-completion rules of predicate references given by then and else tags. The predicate-ref element denotes a reference to a predicate by means of idref attribute.
Any predicate is a 3-tuple:
A is a set of fields that form the predicate,
C is the check-code, and
is a finite set of rules.
| binding-list |
|
<to> |
| </to> | ||
| assignment |
|
<field name=stringconst/> |
| |
<const value= intconst/> | |
| |
<interface id=stringconst name=stringconst /> | |
| argument |
|
<argument name=stringconst/> |
The template is instantiated by binding the concrete form field
values with the arguments in the template's
argument-list in a copy of the referred template.
Each template binding is a list B=
,
,...
of pairs:
is a name of the argument of the template to which
will bind to, and
is a link to another predicate (given byinterface element ),
or a constant (given by const element)or a named form field
(given by field).
| checkcode |
|
<checkcode> |
| </checkcode> | ||
| operator |
|
<operator name =stringconst /> |
| result |
|
<result name =stringconst/> |
| argumentlist |
|
<argumentlist> |
| </argumentlist> | ||
is a set of known fields required for check-code evaluation,
is a list of arguments to the function,
is a name of the function, and
is a name of the result field.
The semantics of check-code C is that the function
is
evaluated with
as the list of arguments. The evaluated value
is
checked with the value of the result field
. If they are the
same then check-code returns true
and false otherwise. The evaluation
of check-code C
can be
formalised as:
For primitive predicates, it might seem like redundant information
to be carried
around but in case of composite predicate such information is
necessary as the argument-list
might consist of functions
that the
compiler generated itself.
| autocompletionrules |
|
<autocompletionrules> |
| </autocompletionrules> | ||
| autocompletionrules-body |
|
<empty/> |
| rule |
|
<rule> |
| </rule> | ||
The autcompletionrules element denotes a set of rules. The rule element denotes an auto-completion rule. In some cases,
there may be no rules and is denoted by empty tag. A rule is
given by the argumentlist, guard, result and
operator nonterminals.
Formally, auto-completion rules
is a set of rules:
=
,
, .....
.
Each rule R is a five-tuple:
G is a guard for the rule;The semantics of rule is that if the guard G is satisfied and mode-rule
is a set of known fields needed for rule trigger,
is a name of the function,
is a list of arguments to the function, and
is a name of the field that receives the value from rule trigger.
eval(
)(
) iff {
v
: v
}
| guard |
|
<guard> |
| </guard> | ||
| guard-body |
|
</empty> |
A guard element denotes a guard. The nonterminal operator and argumentlist have already been explained above. A guard G is a three-tuple:
is a set of known fields needed for guard evaluation,
is the name of the function, and
is a list of arguments to the function.
Before a guard G is evaluated, the mode
is checked. If
the
fields are known then the guard is evaluated by evaluating the
associated expression tree
and is defined as:
Additionally, fields that are read-only are specified by the following syntax:
| autoupdate-def |
|
<autoupdate name=stringconst status=stringconst/> |
Here, the autoupdate element denotes information about a field whose name is given by name attribute and its status is given by a status attribute. There are instances, as described in Section 4.6 when some additional information also needs to be included for auto-update of fields. That information can be specified as:
| metainfo |
|
<metainfo update=stringconst ignore=stringconst/ > |
The metainfo element denotes a relationship between two fields given by update and ignore attributes. If a form has very complicated relationships additional JavaScript functions can be included by specifying a file name in which the functions have been coded. The predefined functions are included in the specifications by the following syntax:
| include-file |
|
<include name =stringconst/> |
where, the include element denotes a file whose name is given by name attribute.