EMA-XPS Online



Syntax: (ask <predication> [:once]

This function makes inquiries at the knowledge
base. The if- and then-part of a rule correspond
in the meaning to an ASK inquiry and its
<bql-continuation>. A call of ASK similar to the
execution of a rule. The <predication> is equi-
valent to the IF-part, the <bql-continuation>
is the THEN-part. The <bql-continuation> will be
evaluated only, if the <predication> is valid
at least once.

The <predication> kann look like
  [<framename> <instance>]
  [<relation-name> <instance> <value>]
It can be bound with logical
operators like  [and ...  or  [or ...  .

<instance> and <value> can contain a
logical variable, that can be recognised
because of its underline (example: _a-computer).
The corresponding contents will be searched in
the knowledge base and will be bound to the

<bql-continuation> consists of babylon-expres-
sions, that may contain logical variables, so 
far these are used in <predication>. the
<bql-continuation> will be repeated until there
are no more different contents for the logical
variable. The contents are the same, when
the values of the logical variable are EQUAL.

[:once] means that the continuation will only
be executed once. The function ASK will be 
stopped, after it has found the first occupied
part of the predication.

ASK always returns NIL.

Example: >(ask
            [options SIEMENS-NIXDORF _options]
            [options WANG _options]]
           (kb-format "~% ~A"
           (name-of _options)))
See the HAS-PART Predication and the operators
ELEMENT-OF and MATCH, too, whose return-values
are useable only from within ASK.

EMA-XPS Online