Currently, we use the text _NEW in violation statements to refer to the atom that was created by the InsAtom function. This way of working prevents one from creating multiple atoms in a single VIOLATION statement and create a link between such atoms.
More general, we see the need for (user-defined) functions where the result is to become an atom in a pair that is to be InsPaired in some relation. An example might be the computation of a hash over an OBJECT.
This ticket suggests syntax and semantics for this, as follows, that extends the {EX} syntax, which currently is {EX} <function>;<arg1>;<arg2>; ... ;<argn>, to the following:
where <varname> is an arbitrary text (consisting of alphanumeric characters) representing the variable in which function will leave its result. The scope of <varname> is the VIOLATION statement in which it is used. Here is an example of what a VIOLATION might look like in which two atoms of type SomeConcept are created and linked in the relation scPair [ SomeConcept * SomeConcept ] [SYM]
The reason for keeping _ in this proposal is that it reduces the likelihood of ambiguous interpretation of texts in which $ appears (similar to why we sometimes use _; as separator). Specification of the _; separator remains as it is now, i.e. it should be specified immediately behind the {EX} (as in {EX}_;.
Currently, we use the text
_NEW
in violation statements to refer to the atom that was created by theInsAtom
function. This way of working prevents one from creating multiple atoms in a single VIOLATION statement and create a link between such atoms.More general, we see the need for (user-defined) functions where the result is to become an atom in a pair that is to be
InsPair
ed in some relation. An example might be the computation of a hash over an OBJECT.This ticket suggests syntax and semantics for this, as follows, that extends the
{EX}
syntax, which currently is{EX} <function>;<arg1>;<arg2>; ... ;<argn>
, to the following:where
<varname>
is an arbitrary text (consisting of alphanumeric characters) representing the variable in whichfunction
will leave its result. The scope of<varname>
is theVIOLATION
statement in which it is used. Here is an example of what aVIOLATION
might look like in which two atoms of typeSomeConcept
are created and linked in the relationscPair [ SomeConcept * SomeConcept ] [SYM]
The reason for keeping
_
in this proposal is that it reduces the likelihood of ambiguous interpretation of texts in which$
appears (similar to why we sometimes use_;
as separator). Specification of the_;
separator remains as it is now, i.e. it should be specified immediately behind the{EX}
(as in{EX}_;
.