Instance Method

retractFact:grade:

Reduces the membership grade of the specified fact by the specified amount, removing it from the fact set if necessary, and reevaluates the rules in the system’s agenda.

Declaration

- (void)retractFact:(id<NSObject>)fact grade:(float)grade;

Parameters

fact

An object representing a truth to be claimed or rejected by the rule system. For details, see the facts property.

grade

The amount by which to reduce the fact’s membership grade.

Discussion

Each fact has a membership grade ranging from zero to 1.0, representing variable levels of truth, strength, or confidence for use in fuzzy logic. Calling this method reduces the fact’s grade by the amount specified in the grade parameter; reducing a fact’s grade to zero or below removes it from the facts array.

Upon asserting or retracting any facts, the system reevaluates the rules in its agenda list so any rules that depend on changes to the set of facts can perform their actions.

See Also

Asserting and Retracting Facts

facts

The list of facts claimed by the rule system.

- assertFact:

Adds the specified fact to the fact set with a membership grade of 1.0, and reevaluates the rules in the system’s agenda.

- assertFact:grade:

Increases the membership grade of the specified fact by the specified amount, adding it to the fact set if necessary, and reevaluates the rules in the system’s agenda.

- retractFact:

Removes the specified fact from the fact set, and reevaluates the rules in the system’s agenda.