| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (2 out of 10)

Overview

Rules establish how your KB responds to various conditions. Rules describe knowledge in a manner that allows your KB to draw conclusions from existing knowledge, to react to certain kinds of events, and to monitor the passage of time.

A rule expresses a programmatic response to a set of conditions. A rule contains a text and a set of attributes. When a rule fires, it executes one or more actions. For information about actions, see Chapter 19, Actions.

When you create a new rule, you enter a two-part statement in its text. The first part, called the antecedent, tests for a condition. The second part, called the consequent, specifies the actions to take when the condition returns a value of true. This is an example of the text of a rule:

G2 offers five kinds of rules:

You can create:

G2 invokes rules by using:

You can specify whether a rule executes its actions sequentially or in parallel. For information on sequential and parallel execution, see This determines how G2 schedules the activities of an invoked rule, and determines the transaction scope of those activities.

You can use G2's facilities for debugging and tracing to monitor the execution of rules. These facilities notify you when a particular rule has been invoked, suspended, and completed. You can also direct G2 to highlight the text box representation of each rule as it is invoked.

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (2 out of 10)

Copyright © 1997 Gensym Corporation, Inc.