Unary operators are applied to inference relationships to modify the effect of the antecedent attribute before using it in the inference. At present they only apply to inference relationships.

Normally a relationship starts off with no unary operator, except as required by the inference method. For instance, the Bayesian inference method requires that its links hold bayesian weights, so in this case the indicated unary operator is overridden.

The highest priority is given to the CONTROL unary operator. If one of these is found, and the antecedent is such that it can be converted into a truth value (i.e. of types Boolean, Probability, Proportion, Bayesian, Odds) then it might set the value of the consequent regardless of the other antecedents; see below. If it is not one of these types then the CONTROL is ignored.

The next highest priority is when the inference method of the consequent is Bayesian Accumulation of evidence. Then the operation is different. See below.

Otherwise, the operations are as follows:

- Integer, OZMO, Float: Takes negative of antecedent.
- Boolean: Takes boolean opposite.
- Probability: Takes probabilistic opposite (1 - p).
- Direction: Changes direction by 180 degrees.
- Otherwise: No change.

- Odds, Ratio: Exchanges numerator with denominator.
- Boolean: Takes boolean opposite.
- Probability: Takes probabilistic opposite (1 - p).
- Otherwise: No change.

- Integer, OZMO, Float: Takes absolute value of antecedent.
- Otherwise: No change.

- Integer, Float: Multiplies value by weight.
- Otherwise: No change. But in future e.g. Ratio might be affected.

- Integer, Float: Divides value by weight.
- Otherwise: No change.

- Integer, Float: Adds numeric value of weight.
- Otherwise: No change. But in future e.g. Ratio might be affected.

- Integer, Float: Subtracts numeric value of weight.
- Otherwise: No change. But in future e.g. Ratio might be affected.

- Probability, Proportion, Bayesian: Multiply the probability of the antecedent by the weight taken as a probability.
- Boolean: Convert to Probability type and treat as above, giving the value 0 if False and giving the weight value (taken as a Probability) if True.
- Otherwise: No change.

- Probability, Proportion, Bayesian: Combine antecedent probability value with that of weight as a probabilistic OR (p + q - pq).
- Boolean: Convert to Probability type and treat as above, giving the value Unity if True and giving the weight value (taken as a Probability) if False.
- Otherwise: No change.

- Integer only: Bitwise AND with weight bits.
- Otherwise: No change.

- Integer only: Bitwise OR with weight bits.
- Otherwise: No change.

- Integer only: Bitwise XOR with weight bits.
- Otherwise: No change.

- Integer: Randomly give a value that is between the antecedent value and zero.
- Enumerated type, Ordinal: If the antecedent has an Ordinal Limit (as most will, but a few from old KBs will not) then select a value from 1 to the limit at random.
- Otherwise: No change.

- If True, then the consequent attribute is deemed relevant, and its inference proceeds as dictated by the inference method and the other antecedents.
- If False, then the consequent attribute is deemed irrelevant, and it is given an answered value found in the weight of this Control relationship.

- If the antecedent is of type Bayesian, Probability, Boolean, then it is
converted to Odds, using the weights found in the link, and the result is
used as an Odds multiplier for the consequent. If the unary operator is
(ie. has become) INVWEIGHT, then the weights are reversed before being
applied to generate the Odds.
- If the antecedent is Odds, then it is used directly as an Odds multiplier for the consequent (and so INVWEIGHT and WEIGHT have the same effect).

Copyright (c) Andrew Basden 1998.