| Title Page | Short Contents | Glossary | Index | Comments |

Contents


Preface

About This Manual
Reference Manual Volumes
Audience
Prerequisites
Organization
Conventions
Typographic
Instructions
Procedure Signatures
Instructions and G2 Constructs
Related Documentation

Part I Introduction to G2

Chapter 1 Overview of G2

Introduction
Basic Components
Workspaces
Scaling and Printing Workspaces
G2 Menus
Walking Menus
Classes and Class Hierarchy
Multiple Inheritance
Controlling Item Behavior
Extensible and Graphical Components
Icons, Images, and Fonts
Programmatic Access
Actions and Expressions
Editors and Facilities
Natural Language Facilities
Development and Deployment
Modules
Compiler Optimization
Stable for Dependent Compilations
Profiling a KB
System Procedures
Networking and Interfacing
Telewindows
G2 to G2 Interface
G2 Gateway (GSI)
Item Passing
Foreign Functions Support
Network Security
G2 Utilities
G2 Foundation Resources (GFR)
G2 User Interface Development Environment/User Interface Library (GUIDE/UIL)
G2 Menu System (GMS)
G2 Dynamic Displays (GDD)
G2 Developer's Interface (GDI)
G2 XL Spreadsheet (GXL)
G2 OnLine Documentation (GOLD)

Chapter 2 The Developer's Environment

Introduction
Capturing Knowledge in a Knowledge Base
Identifying G2's Computational Features
Starting G2
Exiting from G2
Interacting With G2
Operating the Current KB
Using Menus to Operate on an Object in the KB
Using Menus to Affect the Developer's Environment
Choices on the Main Menu
Choices on the Miscellany Menu
Clearing the KB
Connecting to and Disconnecting From a Foreign Image
Creating a New Module
Displaying Network Information
Displaying the Title Block
Entering or Simulating Package Preparation Mode
Neatly Stacking Windows
Selecting Long or Short Menus
Shutting Down G2
Navigating Among the KB's Knowledge
Notifying the User of Errors
Working With the Operator Logbook
Hiding and Showing Logbook Pages
Limiting the Number and Size of Logbook Pages
Navigating to an Item Referenced in an Operator Logbook Message
Shadowing the Operator Logbook Message Handler
Working With the Message Board Workspace
Shadowing the Message Board Message Handler
Organizing the KB's Knowledge
Distinguishing Functional Behavior by Class
Arranging Knowledge Among Workspaces
Partitioning Knowledge into Modules
Planning Your Work
Customizing the User Interface By Configuring the Default Developer's Environment
Prototyping or Engineering
Identifying Roles for Workspaces
Identifying the User Interface Paradigm
User Interface Utilities
Identifying Data Servers for Variables
Using Internal Data Servers
Using External Data Servers
Using Timekeeping Features
Querying the Real Time
Scheduling G2's Work
Determining the Minimum Scheduling Interval
Establishing Simulated Time
Establishing Naming Conventions
Considering Natural Language Support

Part II Global G2 Components

Chapter 3 Knowledge Bases

Introduction
Contents of a KB
Items
System Tables
Operating the Current KB
Creating an Empty KB
Clearing the Current KB
Starting the Current KB
Pausing and Resuming the Current KB
Resetting the Current KB
Restarting the Current KB
Determining the Run-State of the Current KB
The Initial/Reset Run-State
The Running Run-State
The Paused Run-State
Summary of Run-States
Saving a KB File
Saving the Current KB to a KB File
Filenames of KB Files
Syntax for KB Filenames
Using Comments and Change Logging
Saving a Running Current KB
Saving the State of Workspaces
Supporting Source-Code Control Systems
Loading a KB File
Using the Load KB Dialog
Loading the KB File
Using Wildcards in Filenames When Loading a KB
Selecting Options When Loading a KB File
Searching for KB Files
Saving a KB Snapshot File
Contents of a KB Snapshot File
Naming Conventions for KB Snapshot Files
Warmbooting a KB Snapshot File
Creating Warmboot Procedures
Non-Modular Warmboot Procedures
Modular Warmboot Procedures
Warmbooting With Catch-Up
Merging a KB File
Duplicate Items in Merged KBs
Duplicate Class Definitions in Merged KBs
Identical Duplicate Definitions
Nonidentical Duplicate Definitions
Detecting Conflicting Class Definitions
Automatically Resolving Conflicting Definitions
Manually Resolving Conflicting Definitions
Responding to Conflict Workspaces
Examples of Manual Conflict Resolution
Completely New Version of the Same Definition
Name Conflicts Between Independent Definitions
Separate Development of Groups of Attributes
Separate Development of Specific Attribute Values
Conflict Due to Upgrading to a New G2 Version
Conflict Between Original and Backup Definitions
Differences Between Class-Specific Attributes
Unresolvable Conflicts Between Definitions

Chapter 4 Workspaces

Overview
Kinds of Workspaces
Common Features of Workspaces
KB Workspaces
Other Workspaces
Working With Workspaces
Operating on an Area of a Workspace Interactively
Operating on an Area of a Workspace Programmatically
Cloning a Workspace
Deleting a Workspace
Disabling and Enabling a Workspace
Hiding and Showing a Workspace
Hiding a Workspace
Showing a Workspace
Scaling a Workspace
Positioning a Workspace Within its Window
Positioning Items Upon a Workspace
Using the Workspace Origin
Displaying the Visible Portion of a Workspace
Specifying Margins Within the Border of a Workspace
Shrink Wrapping the Size of a Workspace
Creating and Using a Workspace Hierarchy
Creating a Subworkspace for an Item
Displaying the Workspace Hierarchy
Determining Whether a Subworkspace Exists
Referring to Subworkspaces Programmatically
Configuring Items Based on the Workspace Hierarchy
Organizing Knowledge in Subworkspaces by Using Connection Posts
Associating Top-Level Workspaces with Modules
Activating and Deactivating Workspaces
Activating Top-Level Workspaces
Activating and Deactivating a Subworkspace
How Activating and Deactivating Affects Items
Printing a Workspace
Printing Multiple Pages
Generating Encapsulated PostScript Files
Printing a Workspace on a Color PostScript Printer
Setting the Color of Workspaces
Creating Custom Workspace Borders
Using a Graphic as a Background Image
Specifying the Center of the Background Image
Displaying More Than One Background Image
Saving the Background Image in the KB
Other Considerations for Using Background Images
The KB-WORKSPACE Class
Actions that Apply to KB Workspaces
Expressions that Refer to KB Workspaces

Chapter 5 Modules and Modularized KBs

Overview
Related Documentation
Understanding Modules
The Module Hierarchy
Modules and System Tables
Modules and Items
Creating, Populating, and Saving a Module
Naming the Top-Level Module
Naming Conventions for Modules
Associating Items With a Module
Saving a Module in a Separate KB File
Creating a Module Hierarchy
Creating a Top-Level Module
Creating a New Module
Creating a New Module
Creating a New Module Programmatically
System Tables Associated with a New Module
Declaring Directly Required Modules
Checking for Consistent Modularization
Validating Consistent Modularization
Saving the Module Hierarchy
Specifying the Filename of a Saved Module
Saving an Inconsistently Modularized KB
Deleting a Module
Determining Programmatically Whether a Module is Loaded
Obtaining Information About Modules
Displaying the Module Hierarchy
Displaying Module Information System Tables
Displaying the Module Assignment of Items
Obtaining the Containing Module for Items Programmatically
Working with Modularized KBs
Loading a Modularized KB
Loading Modularized KBs and Detecting Conflicts
Loading a Particular Version of a KB File
Automatic Loading of Directly Required Modules
Merging a Modularized KB into the Current KB
Merging Directly Required Modules
Installing System Tables of a Merged Modularized KB
Ignoring Modules With Duplicate Names
Merging a Particular Version of a KB
Using a Module Search Path to Load KB Files
Using a Module Map File to Load and Save a KB
Locating the Module Map File
Adding Entries to the Module Map File

Chapter 6 System Tables

Introduction
Using System Tables
Changing System Tables Interactively
Changing System Table Values Programmatically
Color Parameters
Controlling the Menu Order of Colors
Specifying the Colors on the First Color Menu
Defining the Colors on the Second Color Menu
Specifying the Number of Columns for the First Color Menu
Specifying the Number of Columns for the Second Color Menu
Indicating Whether to Dismiss the Color Menu
Class-Specific Attributes of Color Parameters
Data Server Parameters
Specifying a Data Server Alias
Specifying Data Service Scheduling Priority
Turning on G2 Meters
Class-Specific Attributes of Data Server Parameters
Debugging Parameters
Controlling Error Signalling
Controlling Debugging Trace Messages
Specifying Breakpoints for Debugging
Enabling Tracing and Breakpoints for Debugging
Class-Specific Attributes of Debugging Parameters
Drawing Parameters
Specifying Scheduled Drawing
Specifying the Paint Drawing Mode
Controlling the Set of Rendering Colors
Displaying Colors on Your System
Selecting a Color Palette
Class-Specific Attributes of Drawing Parameters
Editor Parameters
Specifying the Maximum Number of Names to Show
Defining the Minimum Text Editor Width
Specifying Whether to Enable Author Recording
Class-Specific Attributes of Editor Parameters
Fonts
Class-Specific Attributes of Fonts
Inference Engine Parameters
Limiting the Depth of Recursion
Defining the Timeout for Getting a Variable Value
Specifying the Timeout for Rule Completion
Specifying the Number of Retries for a Variable Value
Specifying the Fuzzy Truth Threshold
Class-Specific Attributes of the Inference Engine Parameters
KB Configuration
Specifying Item Configurations for the KB
Restricting Main Menu Options
Providing or Restricting Global Keyboard Commands
Setting the Initial User Mode for a KB
Noting Your Optional Modules
Simulating Optional Modules
Class-Specific Attributes of KB Configuration
Language Parameters
Specifying the Current Language
Using a Text-conversion-style
Class-Specific Attributes of Language Parameters
Logbook Parameters
Defining the Logbook Page Size
Specifying the Margin for Logbook Messages
Defining Where to Position Logbook Pages
Specifying Where to Position the Logbook
Controlling How Many Logbook Pages to Show
Controlling the Number of Logbook Pages
Class-Specific Attributes for Logbook Parameters
Log File Parameters
Saving a Log File
Specifying the Log File Directory Location
Specifying a Log File Root Name
Specifying the Current Log File
Defining When to Close a Log File
Defining When to Back Up Log Files
Class-Specific Attributes of Log File Parameters
Menu Parameters
Specifying how to Align Menu Choices
Allowing Multiple Menus to Display
Allowing Walking Menus
Class-Specific Attributes of Menu Parameters
Message Board Parameters
Defining the Minimum Display Interval
Class-Specific Attributes of Message Board Parameters
Miscellaneous Parameters
Defining Whether to Repeat the Random Function
Specifying the Workspace Margin
Starting a KB Automatically After KB Load
Determining the KB Run State
Changing the Backward Compatibility
Ignoring Duplicate List Element Error
Returning Additional Connection Vertices
Class-Specific Attributes of Miscellaneous Parameters
Module Information
Specifying a Module Name
Specifying the Top Level Module
Specifying the Required Modules
Class-Specific Attributes of Module Information
Printer Setup
Specifying the Printing Details
Workspace Scaling
Color Conversion
Specifying the Printer Page Layout
Paper-size Setting
Specifying How to Spool the Print File
Spooled-filename-template Setting
Spool-file-to-printer Setting
Printer-identification Setting
Controlling the Printing Priority
Determining the Print File Format
Class-Specific Attributes of Printer Setup
Saving Parameters
Defining the Priority for KB Saving
Identifying the Current KB
Identifying the KB File Name
Adding Comments to a KB
Viewing KB Version Information
Using KB Change Logging
Logging Changes in All Modules
Tracking KB Versions
Viewing an Item Change Log
Reverting Item Changes
Class-Specific Attributes of Saving Parameters
Simulation Parameters
Timing Parameters
Defining the Scheduler Mode
Real Time
Simulated Time
As Fast As Possible
Specifying the Minimum Scheduling Interval
Controlling the G2 Sleep Interval Under VMS
Specifying the G2-Meter Lag Time
Specifying the Interface Mode to Use
Adjusting the G2 Clock
Controlling the Foreign Function Timeout Interval
Controlling Foreign Image Reconnection
Setting the Uninterrupted Procedure Limit
Class-Specific Attributes of Timing Parameters

Chapter 7 Configurations

Overview
Declaring Configurations for Items
Kinds of Configuration Statements
Scope of Configurations
Precedence of Configurations
Example of the Scope of Configurations
How G2 Searches for Applicable Configurations
Instance Configurations and Definition Items
Configuring the User Interface of Items
Specifying the Applicable User Modes
Specifying Appropriate Operations for the Target Class
Configuring Menu Choices and Attributes in Tables
Configuring Attributes that Appear in Tables
Configuring Menu Choices
Configuring Non-Menu Choices
Configuring Table Menu Choices
Configuring Attribute Displays
Configuring Keystrokes
Constraints on Configuring Keystrokes
Considering the Target of a Configured Action
Example of Configuring Keystrokes
Configuring Mouse Clicks
Associating Selection with a Menu Choice or User Menu Choice
Associating a Mouse Click with an Operation
Associating a Mouse Click with Drag and Drop Capabilities
Associating a Mouse Click with a Mouse-Tracking Procedure
Coding the Mouse-Tracking Procedure
Example of Mouse-Tracking Procedure
Conflicts Between Mouse-Tracking and Other User Interface Operations
Constraining the Movement of Items
Aligning Items To an Invisible Rectangle
Aligning Items on an Invisible Grid
Configuring the User Interface of Proprietary Items
Configuring Access To and From Other G2, G2 Gateway, and Telewindows Processes
Allowing or Prohibiting Network Access
Allowing Read and Write Access
Allowing Execute Access
Allowing Inform Access
Allowing Connect Access
Configuring Properties of Items
Specifying the Scope of the Declared Properties
Specifying Exceptions to the Declared Properties
Optimizing the Compilation of an Item
Declaring a Procedure to be Inlined
Declaring a Method to be Inlined
Declaring Items as Stable Hierarchy
Declaring an Item Independent for All Compilations
Declaring an Item Stable for Dependent Compilations
Declaring an Activatable Subworkspace for an Item
Declaring Subworkspace Connection Posts for Items
Disallowing Manual Connections for an Item
Including Comments in Configurations
Describing Configurations
Declaring User Modes in Configurations
Associating User Modes with G2-Window Items
Associating User Modes and Users
Example of Configuring the User Interface of an Item
Obtaining the Attributes Visible for a User Mode Programmatically
Declaring Generic and Exception Configurations
Combining Configurations
Combining Cooperatively
Combining Additionally
Including Additionally
Excluding Additionally
Implementing Localized Exceptions
Combining Absolutely
Configuring the G2 Main Menu and Global Keystrokes
Configuring the G2 Main Menu
Restricting Help
Keyboard Command Restrictions
Using Configurations in Modularized KBs

Chapter 8 G2-Windows

Introduction
Windows and g2-windows
Using Local Windows and Remote Windows
Representing Local and Remote Windows
Special Properties of Local and Remote Windows
Displaying Independent Views of the Current KB
The g2-window Class
Attributes of the g2-window Class
Working with g2-windows
Determining When G2 Associates a g2-window With a Window
Determining Whether the Connection is Local or Remote
Determining the G2 User Name for a g2-window
Determining the Login Name at the Operating System
Determining the User Mode
Determining the Remote Host Name
Determining the Time of Connection
Determining the Operating System Type
Expressions That Refer to g2-window Items
Specifying the Appearance of G2's Window
Specifying the Resolution and Magnification
Identifying the Dimensions of G2's Window
Identifying the Resolution of G2's Window
Rerouting a Telewindow
Setting up Access to Telewindows
Reporting Errors
Supporting a Window-Specific Language
Using The Login Dialog
Displaying the Login Dialog
Determining Default Values in the Login Dialog
Associating an Existing g2-window with a Telewindow

Part III Knowledge Representation

Chapter 9 Values and Types

Overview
Using Values Stored in Items
Using Attribute Values
Using Text Attribute Values of Items
Using Values Given by Variables and Parameters
Checking for the Existence of an Attribute Value
Using Local Names for Values
Expiration of Variable Values
Distinguishing Value Types
Complex Types
Declaring Types
Working With General Types
Using the Item-or-Value Type
Using the Value Type
Using the Quantity Type
Working With Specific Types
Using the Integer Type
Using the Float Type
Working With Exceptional Float Values
Coercing Numeric Values
Using Units of Measure for Numeric Values
Using the Symbol Type
Working With Characters in a Symbol Value
Using the Text Type
Working With Characters in a Text Value
Formatting Text Values
Using the Truth-Value Type
Working With Composite Types
Using the Structure Type
Structure Functions
Structure Expressions
Using the Sequence Type
Sequence Functions
Sequence Expressions
Using Structures and Sequences in User-Defined Classes
Comparing Structures and Items
Comparing Sequences and Lists

Chapter 10 G2 Items

Overview
Logical Components of Items
Understanding Item Inheritance
Understanding the Knowledge Contained in Items
Identifying the Knowledge in Attributes
Identifying the Knowledge Not Stored in Attributes
Identifying the Status Knowledge of Items
Permanent/Transient Status
Active/Inactive Status
Referencing Inactive Definitions
Enabled/Disabled Status
Participation Status
Identifying the Superior and Subordinate Relationships Among Items
Item Representation
Identifying the G2 Color Palette
Identifying the Color Attributes of Items
Actions That Affect Item Appearance
Locating Items Upon a Workspace
Layering Items Upon the Same Workspace
Distinguishing Permanent and Current Knowledge
Working With Items Interactively
Using Item Menus
Common Item Menu Choices
Changing the Size of an Item
Cloning an Item
Cloning Specific Knowledge
Changing the Color of an Item
Deleting an Item
Describing an Item
Describing the Configuration of an Item
Lifting to the Top and Dropping to the Bottom
Naming an Item
Showing and Hiding an Item Name Box Programmatically
Rotating and Reflecting an Item
Displaying the Table for an Item
Transferring Items to Another Workspace
Item Expressions
Referring by Item Name
Referring Through a Symbolic Expression
Referring By Variable or Parameter Name
Referring By Workspace Location
Referring By Identity
Referring By Association with an Event or Location
Referring By Item Evaluation
Referring to Other Item Knowledge
Referring to the Name and Class
Referring to the Superior Item
Referring to The Workspaces Associated With an Item
Referring to The Relationships of an Item
Referring to The Size of an Item
Referring to Degrees of Rotation
Referring to the Position of an Item
The Item Class
System Procedures for Moving and Transferring Item Groups

Chapter 11 Attributes and Tables

Overview
Attribute Contents
Distinguishing System- and User-Defined Attributes
Using Attribute Tables
Updating Attribute Tables Automatically
Attribute Table Display Precision
Positioning an Attribute Table
Using Attribute Table Menus
Transferring an Attribute Table
Displaying the Subtable for an Attribute that Contains an Object
Creating a Subtable for an Attribute
Adding Attribute Displays
Adding Attribute Displays to Class Definitions
Manipulating an Attribute Display From its Menu
Adding or Removing Attribute Displays Programmatically
Example: Adding Attribute Displays to New Objects
Loading Attribute Values From an Attribute File
Using the Authors Attribute
Using Indexed Attributes
Performance Considerations
Expressions for Indexed Attributes
Universal Unique Identifiers
UUID Components
UUID Storage
Adding UUIDs to Subclasses
Accessing UUIDs
Avoiding Duplicate UUIDs
Interaction of G2 UUIDs with GFR
Conclusion
Using Other Special-Purpose Attributes
Formatting Attributes
Evaluation Attributes
Actions That Affect Attributes
Changing An Item Name
Concluding Attribute Values
Expressions That Refer to Attributes
Referring To Attributes By Name
Referring to Attributes Through a Symbolic Expression
Iterating Over User-Defined Attributes
Referring To the Text Attribute of an Item
Referring To an Attribute that is an Instance of an Object
Referring To an Attribute Given By a Variable or Parameter
Referring To an Untyped Attribute That Contains an Object
Referring Indirectly Using a Symbol

Chapter 12 Attribute Access Facility

Overview of Attribute Access
Accessing System-Defined Attributes
Attribute Access Terminology
Structures and Sequences
Attribute Descriptions
Obtaining Class Descriptions
Differences Between the Value and Text of an Attribute
Viewing an Attribute Value or Text
Referencing Limited-Access Attributes
Example of Obtaining an Attribute Description
Hidden Attributes
Evaluation Attributes
Composite Attributes
Referencing System-Defined Attributes
Creating Subattribute References
Example of Referring to a Connection Cross-section-pattern
Displaying Subattributes Values
Referencing a Structure Within a Sequence
Referencing a Sequence Within a Sequence
Tips for Using Subattribute References
Concluding Values Directly or Incrementally
Attribute Access System Procedures

Chapter 13 Classes and Class Hierarchy

Introduction
Overview of the G2 Class Hierarchy
Items and Classes
Methods
Inheritance
Single Inheritance
Multiple Inheritance
Linearization
Purpose of Inheritance
System-Defined Classes
Varieties of System-Defined Classes
Instantiating System-Defined Classes
Viewing the Class Hierarchy with the Inspect Facility
User-Defined Classes
Extending G2's Machinery with User-Defined Classes
Representing Knowledge with User-Defined Classes
Creating User-Defined Classes
Instantiating User-Defined Classes
Inheritance in Class Hierarchies
Direct-superior-classes Attribute
Class-inheritance-path Attribute
Using the Class Inheritance Path
Single Inheritance
Inheritance of Default Values
Inheriting Default Values for Stubs
Inheritance of Methods
Duplicate Attributes
Naming Duplicate Attributes
Referencing Duplicate Attributes
Duplicate Attributes and Default Values
Multiple Inheritance
Multiple Inheritance and Class Inheritance Paths
Linearizing Multiple Inheritance
How G2 Linearizes Multiple Inheritance
The G2 Linearization Algorithm
Linearizing Two Superior Classes
Linearizing Several Superior Classes
Linearizing Networks of Classes
Why G2 Linearizes As It Does
Ideal Linearization
Feasible Linearization
Compromising Hierarchical Precedence
Compromising Direct Superior Precedence
G2 linearization
Illegal Patterns of Multiple Inheritance
Disordered Multiple Inheritance
Meaningless Multiple Inheritance
Viewing Multiple Inheritance with the Inspect Facility
Default Values in Multiple Inheritance
Inheriting a Default Value from a Direct Superior
Overriding the Default Value of a Direct Superior
Overriding an Inherited Value with an Explicit Value
Inheriting Default Values for Stubs
Duplicate Attributes in Multiple Inheritance
Defining Classes in Bottom-Up Order
Deleting a Class Definition
Planning A Class Hierarchy

Chapter 14 Definitions

Introduction
Terminology
Overview of the Class Definition Process
Creating Class Definitions
Storing Definitions on Workspaces
Class Definition Attributes
Formatting the Text of Attributes
Order of Attributes in Tables
Completing Class Definitions
Specifying the Item Configuration
Providing a Class Name
Specifying the Superior Class(es)
Entering Direct Superior Classes
Specifying Direct Superiors Before Creating Their Definitions
Using Mixin Classes
Specifying Instance Configurations
Determining the Class Inheritance Path
Determining the Initializable System Attributes
Determining the Inherited User-Defined Attributes
Defining and Initializing Class-Specific Attributes
Defining an Untyped Attribute with No Default Value
Defining an Untyped Attribute with a Default Value
Defining a Typed Attribute with a Specified Default Value
Defining a Typed Attribute with a Default Value Provided by G2
Defining an Attribute as an Object Instance
Defining an Attribute for Implied Symbolic Reference
Defining an Indexed Attribute
Specifying Default Values for Inherited Attributes
Overriding Default Values of Inherited User-Defined Attributes
Specifying Default Values of Initializable System-Defined Attributes
Specifying Instantiability
Effects of Setting Instantiability Attributes
Instantiable Classes That Appear in Menus
Noninstantiable Classes That Appear in Menus
Classes That Do Not Appear in Menus
Order of Classes in the G2 Menu Hierarchy
Uninstantiable Subclasses
Specifying an Icon
System-Defined and User-Defined Icons
Icon Inheritance
Using the Icon Editor
Icon Library
Creating Object Classes
System-Defined Object Attributes
Specifying Attribute Displays
Specifying Connection Stubs
Inheriting Default Values for Stubs
Specifying Other Object Class Attributes
Attribute Initializations for Variables and Parameters
Attribute Initializations for Lists and Arrays
Creating Connection Classes
System-Defined Connection Attributes
Defining Connection Regions
Specifying a Stub Length
Defining the Junction Block to Use
Creating a Junction-Block Subclass
Creating Connection Post Classes
System-Defined Connection Post Attribute
Specifying the Superior Connection
Creating Message Classes
System-Defined Message Attribute
Specifying Default Message Properties
Using Specialized Definitions
Mixing Generic and Specialized Definitions
Creating an Object Definition
Creating a Connection Definition
Creating a Message Definition
Customizing Definition Classes
Creating New Classes Programmatically
Changing Definitions
Using the Change Attribute
Adding a Connection Stub to an Object Class Definition
Changing an Attribute to its Default Value in Instances
Changing Stubs in Object Class Definitions
Copying an Inherited Icon-description in Object Class Definitions
Deleting Connections in Object Class Definitions
Merging all Instances and Subclasses into a Definition
Moving Attributes from One Class to Another
Moving Connections
Renaming an Attribute
Updating the Attribute Displays of All instances of a Class
Updating the Default Message Properties of All Class Instances
Changing Definitions with the Conclude Action
Effect on Subclasses and Instances
Effect on Procedure Statements and Other Items
Changing Instantiated Classes
Merging Classes
Merging Definitions of the Same Type
Merging Definitions of Different Types
Completing a Merge
Deleting a Definition

Chapter 15 Variables and Parameters

Introduction
Comparing Variables and Parameters
Parameter Features
Variable Features
Memory Considerations
Summary of Variable and Parameter Differences
Variables, Parameters, and Rules
Obtaining Values for Variables
Obtaining Unrequested Values
Obtaining Requested Values
Inference Engine Data Server
G2-Simulator Data Server
G2, G2 Gateway, or GFI Data Server
Handling a Variable Failure
Invoking Whenever Rules for Failed Variables
Retrying the Variable
Obtaining Values for Parameters
Creating Variables and Parameters
Specifying Forward and Backward Chaining
Defining Debugging and Tracing
Specifying the Type
Specifying an Initial Value
Obtaining the Last Recorded Value
Specifying Whether to Keep a History of Values
Specifying a Validity Interval
Effect of Validity Interval on Expiration Time Stamp
Using a Specific Interval
Using an Indefinite Interval
Using a Supplied Interval
Creating a Specific Formula
Specifying Simulation Details
Determining the Initial Simulation Value
Specifying a Data Server
Specifying a Default Update Interval
History Keeping in G2
Storing and Accessing History Values
Collection Time
Saving a Maximum Number of Data Points
Saving Data Points over a Maximum Time Period
Saving a Maximum Number of Data Points Over a Specific Time Period
Specifying a Minimum Interval Between History Data Points
Event-based History
Keeping a Single Data Point per Interval
Working With History Keeping Using Attribute Access
Displaying History Values Dynamically
Specifying History-keeping Programmatically
Changing the History-keeping Specification
Removing History Keeping
History Expressions
Obtaining a History Value
Computing the Number of History Datapoints
Computing the Average History Value
Computing the Integral
Computing the Interpolated Value
Computing Maximum and Minimum Values
Computing the Rate of Change
Computing the Standard Deviation
Actions To Use With Variables and Parameters
Concluding An Attribute Variable to Have No Value
Concluding Values for Variables and Parameters
Concluding a Logical Value
Concluding a Quantitative Value
Concluding a Symbolic Value
Concluding a Text Value
Concluding that a Variable Does Not Have a Value
Variable and Parameter Rules
Whenever a Variable or Parameter Receives a Value
Whenever a Variable Fails to Receive a Value
Whenever a Variable Loses Its Value
Variable and Parameter Expressions
Directly Referring to a Variable or Parameter
Using the Value of Expression
Using the Has a Value Expression
Using Current Value Expressions
Obtaining the Simulated Value of a Variable or Parameter
Obtaining the Collection Time for a Variable or Parameter
Obtaining the Expiration Time for a Variable
Referring to A Variable or Parameter that Gives the Value of an Attribute
The Variable and Parameter Classes
Common Attributes
Variable-Specific Attributes
Describing Variables and Parameters

Chapter 16 Lists and Arrays

Introduction to Lists and Arrays
Lists and Sequences
Comparing Lists and Arrays
Choosing Lists
Choosing Arrays
Using Nested Arrays
List or Array Contents
Effect of Run States on Lists and Arrays
Summarizing List and Array Differences
Creating Lists and Arrays
Setting the Array Length
Defining the Element Type
Allowing Duplicate List Elements
Providing Initial Values for Array Elements
G2-ARRAY Initial Values Conflict
Specifying Symbolic Initial Values in Arrays
Using Permanent-Membership Lists and Arrays
Levels of Permanency in Lists and Arrays
Initial Values of Arrays
Complying to Permanent Membership
Maintaining Permanent-Membership Lists and Arrays
Restoring Permanent-Membership Lists and Arrays
Populating A List
Inserting Based on Element Location
Inserting at the Beginning or End of a List
Inserting Before or After an Existing Element
Inserting Into Lists With Duplicate Elements
Removing List Elements
Removing a Particular List Element
Removing Using an Element Index
Removing a Type of List Element
Populating an Array
Changing the Initial Values of an Array
Iterating Over an Array
Using the Change Action for Arrays
Using an Attribute File
Replacing List and Array Elements
Using Change
Using Conclude
Altering the Length of an Array
Changing Elements to Have No Values
Data Seeking and Event Updating
Iterating over Lists and Arrays
Iterating According to Element Type
Iterating Over Lists For a Particular Item
Specifying a Relative List Position
Performance Considerations During List Iteration
Allowing Other Processing During List and Array Iteration
Using Other List and Array Expressions
Accessing List or Array Elements by Index
Performing Computations Over Sets of Elements
Sum, Product, Minimum, Maximum of
Average of
Count of
Testing for List Membership
Obtaining the Number of List Elements
Finding the Length of an Array
Accessing Lists or Arrays that are Object Attributes
Changing Attribute List and Array Elements
Concluding an Unnamed Object Attribute that is a List or an Array
Concluding a List or Array Element that is an Object
Using System Procedures with Lists and Arrays
The List and Array Classes
Creating Subclasses of Lists and Arrays
Class-Specific Attributes
Describing Lists and Arrays

Chapter 17 Connections

Overview
Properties of Connections
Connecting to Objects
Creating a Connection
Connecting Objects
Using Connections
Drawing Orthogonal Connections
Drawing Diagonal Connections
Connecting to Objects Without Stubs
Defining Connectedness
Disallowing Connections
Determining the Item Count for Connections
Deleting Stubs and Connections Interactively
Deleting Stubs and Connections Programmatically
Connection Layering
Using Junction Blocks
Creating Junction Blocks
Creating a Junction Block Subclass
Using Connection Posts
Creating Connection Posts on Subworkspaces Automatically
Creating a Connection Post Subclass
Using Connection Expressions
Referring to Connected Items
Referring to Input or Output Stubs
Referring to Port Names
Referring to the End of a Connection
Referring to the Connection Class
Using Actions with Connections
Changing a Connection's Stripe-color
Creating Transient Connections
Creating a Connection on One Side of an Object
Creating a Directional Connection
Creating a Connection with Vertices
Specifying Connection Vertices
Recreating an Existing Connection Programmatically
Making a Transient Connection Permanent
Deleting a Connection
Detecting Connection and Disconnection Events
Generic Connection and Disconnection Events
Direct Connection and Disconnection Events
System Procedures for Connections
Functions for Connections
Checking Connection Information
Detecting Connectedness
Describing Connections

Chapter 18 Relations

Overview
Using Relation Definitions and Relations
Creating a Relation Definition
Choosing a Relation Name
Using Permanent Relations
Understanding How G2 Saves Relations
Complying to Permanency
Maintaining Permanent Relations
Restoring Permanent Relations
Specifying the Cardinality of Relations
Defining an Inverse Relation
Defining a Symmetric Relation
Creating a Relation
Using Conclude to Create Relations
Example of Creating a Relation Between Two Items
Example of Creating a Relation Between an Item and a Class
Using a Sequence to Conclude a Relation
Example of Creating a Relation with a Sequence
Removing a Relation
Removing Relations by Deleting Items
Replacing a Relation
Using the Now Syntax
Example of Replacing a One-to-one Relation
Example of Replacing Multiple One-to-one Relations
Example of Replacing a Many-to-one Relation
Example of Replacing a One-to-many Relation
Invoking Rules using Relations
Using Whenever Rules to Detect Relatedness
Using Whenever Rules To Detect Cessation of Relations
Invoking Rules When a Relation is Created
Invoking Rules when a Relation is Deleted
Invoking Rules that Test whether a Relation Exists
Invoking Rules that Refer to Items with Relations
Invoking Rules that Refer to Variables with Relations
Working with Transient Items
Working with Deactivated and Disabled Items
Updating Relations While a KB is Running
Updating the First Class and Second Class
Updating the Type of Relation
Updating Symmetric Relations
Updating Relations While Executing Procedures
Updating a Relation While a Rule is Executing
Updating a Relation When Saving a KB Snapshot File
Expressions Involving Relations
Event Expressions
Logical Expressions
Relation Participation Expressions
Obtaining the Relationships of an Item
Obtaining Items Participating in a Relation
Generic Item References
The Relation Class
Describing the Items that Participate in a Relation

Part IV Computational Capabilities

Chapter 19 Actions

Introduction
Executing Actions
Executing Actions in Procedures
Executing Actions in Other Contexts
Executing Iterative Actions
Further Information
Dictionary of Actions
abort
Aborting a Procedure or Method
Aborting a Procedure or Method Invocation
activate
change
Changing List and Array Elements
Changing the Color Attribute of an Item
Changing the Icon Color Region of Instances
Changing the Color of any Named Icon Region
Changing the Name of an Item
Minimizing the Size of a Workspace
Changing the Text of an Attribute
Changing the Text of Textual Items
conclude
Concluding Array and List Elements
Concluding Attribute Values
Concluding Values for Attributes
Using an Indirect Reference to Conclude an Attribute Value
Concluding Icon Variables
Concluding Variable and Parameter Values
Concluding Relations
create
Creating Transient Connections
Creating an Item of a Particular Class
Creating an Item by Cloning Another
Creating an Item of a Class Using an Indirect Reference
deactivate
delete
Deleting Items Without First Making Them Transient
Removing Stubs While Deleting an Item
Deleting Connections
focus
halt
hide
Hiding an Item
Hiding the Workspace Containing an Item
Hiding the Workspace of a Superior Item of a Subworkspace
Hiding the Subworkspace of an Item
Hiding the Workspace of an Action Button or User Menu Choice
Hiding Workspaces on any G2 Window
inform
Using Inform to Post to the Message Board
Informing a Destination Item
insert
invoke
make
Making Transient Items Permanent
Making Permanent Items Transient
Limitations to Transiency
Making a Workspace the Subworkspace of an Item
Creating a Subworkspace Programmatically
Activation Status of Subworkspaces
move
pause
print
remove
reset
rotate
Rotating an Icon
Rotating an Icon From its Vertical Position
set
Setting the Value of a GSI (G2 Gateway) Variable
Comparing Set with Conclude
show
Showing a Specific Workspace
Showing the Workspace or Subworkspace of an Item
Showing the Workspace of a Superior Item
Showing a Workspace at a Fixed Scale
Showing a Workspace at an Arbitrary Scale
Showing a Workspace with Different Horizontal and Vertical Axes Scaling Factors
Showing a Workspace at a Specific Screen Location
Showing a Workspace by Positioning its Edges
Showing a Workspace Using a Focal Point
shut down g2
start
Starting a Procedure
Starting a Procedure on a Remote G2 Process
Starting a Procedure with a Priority
Starting a Procedure after a Time Interval
transfer
Transferring Object Attributes
Referencing Transferred Objects
Transferring an Item to the Mouse
Transferring More Than One Item to the Mouse
Transferring an Item to a Workspace
Removing an Item from a Workspace
update
Updating a Display Item
Updating a Variable

Chapter 20 Expressions

Introduction
Forming an Expression
Evaluating Expressions
Never Obtaining a Value
Not Obtaining a Value at This Time
Finding a Type Mismatch
Determining When Expressions Expire
Understanding Transactions and Transaction Scopes
Using Generic Reference Expressions
Including a Generic Reference Qualifier Expression
Using Quantifiers
Embedded Generic Reference Expressions
Using Class-Qualified Names
Using Local Names in Expressions
Implicit Use
Explicit Use
Class or Attribute Name Use
Using Literals
Using Operators in Expressions
Using Arithmetic Operators
Identifying the Default Order of Evaluation
Using Parentheses to Affect the Order of Evaluation
Precedence of Arithmetic Operators
Coercion of Values Returned from Arithmetic Operators
Constraints on Exponentiation Operations
Using Logical Operators
Short-Circuited (Lazy) Evaluation of Logical Operators
Affecting the Expiration Time
Precedence and Order of Evaluation
Using Relational Operators
Producing Fuzzy Truth Values From Relational Operations
Specifying a Fuzzy Truth Band Subexpression
Using Logical Operators with Terms That Produce Fuzzy Truth Values
Fuzzy Truth Operators
Using the Concatenation Operator
Formatting Using the Newline Character
Formatting Numeric Values
Producing a Symbol Value
Referring to a Superior or Inferior Class
Referring to Items or Values
Existence of an Item or Value
There Exists
Class or Type of Item or Value
By Generic Reference
Conditional Evaluation
Value Expressions
Value of an Item or Value
Has a Value
First of the Following Expressions That Has a Value
Current Value of an Expression
Current Value of
Has a Current Value
First of the Following Expressions That Has a Current Value
By Iterating Over a Set
The Count of
The Average Over Each
Other Operations Over a Set
Referring to the Current Time
Current Subsecond Time
Current Time by Time Unit
Current Day of the Week
Referring to Specific Items

Chapter 21 Procedures

Introduction
Procedure Syntax
Local Names in Procedures
Procedure Header Syntax
Duplicate Procedure Names
Local Declarations Syntax
Terminology
Procedure Body Syntax
Statements
Error Handler Syntax
Comments
Defining a Procedure
Procedure Attributes
Sample Procedure
Using Procedures
Invoking a Procedure
Passing Arguments to a Procedure
Accessing Variables in a Procedure
Memory Management in Procedures
Allowing Other Processing
Wait States
Processing During Wait States
Using Wait States Cautiously
Limiting Procedure Execution Time
Setting Procedure Priority
Debugging a Procedure
Displaying a Procedure's Invocation Hierarchy
Inlining a Procedure
Declaring a Procedure as Inlineable
Recompiling an Inlineable Procedure
Testing for an Inlined Procedure
Creating Procedure Invocations
Aborting a Runaway Procedure
Expressions for Procedures
The Procedure Containing the Expression
The Procedure Invocation Associated With the Procedure Containing the Expression
Procedures and Rules
Dictionary of Procedure Statements
allow other processing
Assignment (=)
begin-end
call
Calling and Wait States
Asynchronous Invocation
case
collect data
Executing a Collect Data Statement
do in parallel
Do in Parallel and Wait States
Using do in parallel Effectively
Concurrency and Asynchrony
exit if
for
Iterating Over Each Instance of a Class of Items
Iterating Using a Counter
For Each and Wait States
go to
if-then
on error
On Error Statement Syntax
Superseded On Error Statement Syntax
repeat
return
signal
Signal Statement Syntax
Superseded Signal Statement Syntax
wait

Chapter 22 Methods

Overview
Introduction to Methods
Methods and Procedures
The Vessel Example
Filling Vessels Using Procedures
Filling Vessels Using Methods
Encapsulation
Duplicate Methods
Inheriting Methods
Defining Methods
Designing a Class Hierarchy
Implementing a Class Hierarchy
Creating Method Declarations
Flagging Call Next Method Requirements
Defining a Method
Method Attributes
Describing a Collection of Methods
Invoking a Method
Invoking a Method Generically
Matching Types in Generic Method Invocations
Invoking a Method Directly
Optional Direct Invocation
Matching Types in Direct Method Invocations
Invoking a Superior Method (call next method)
Duplicate Methods
Duplicate and Superior Methods
Inlining a Method
Declaring a Method as Inlineable
Recompiling an Inlineable Method
Testing for an Inlined Method
Considerations for Multiple Inheritance

Chapter 23 Rules, Inferencing, and Chaining

Overview
Creating a Rule
Displaying the Table for a Rule
Cloning a Rule
Coding the Text of a Rule
Coding the Antecedent
Coding the Consequent
Specifying More than One Action in the Consequent
Specifying Sequential Execution
Kinds of Rules
If Rules
Initially Rules
Forms of Initially Rules
Effects on Rule Scanning
Unconditionally Rules
When Rules
Whenever Rules
Using Whenever Rules
Event Expressions
A Variable, Parameter, or Attribute Receives a Value
A Variable Fails to Receive a Value
A Variable Loses Its Value
An Item Is Created
An Object is Moved on a Workspace
An Item is Enabled or Disabled
An Item is Activated or Deactivated
Two Items Become or Cease To Be Related by a Specific Relation
Two Items Become or Cease To Be Related by Any Relation
Two Items Become or Cease to Be Connected
Specifying the Scope of the Rule
Creating Specific Rules
Indirect Specific Rules
Local Names in Specific Rules
Creating Generic Rules
Two Forms for Generic Rules
Using Local Names in Generic Rules
Generic Rules and the Class Hierarchy
Determining the Number of Generic Rules That are Invoked
Scanning Generic Rules
Using Generic Rules with Focal Objects
Invoking Rules
Forward Chaining
Ordering of Rules Invoked by Forward Chaining
Implementing Loops Using Forward Chaining
Backward Chaining
Using Breadth-First Backward Chaining
Using Depth-First Backward Chaining
Activating the Parent Workspace of a Rule
Detecting Events
Scanning Rules
Determining the Scan Interval to Use
Scanning Versus Event Detection
Scanning Generic Rules
Focusing on Rules and Invoking Rules by Category
Focusing on Objects
Invoking Rules by Category
Debugging Rules
Debugging and Tracing Rules
Highlighting Rules
Understanding Rule Invocation and Execution
Prioritizing Rules
Rules and Scheduler Tasks
Rule Priorities and Rule Completion
Propagation of Rule Priorities
Setting the Timeout Interval for a Rule
Creating and Managing Rule Invocations
Evaluating the Antecedent
Executing Actions in the Consequent in Parallel
Time-Out Processing
Single Transaction Scope for All Consequent Actions
Executing Actions in the Consequent Sequentially
Time-Out Processing
One Transaction Scope Per Consequent Action
The Rule Class
Actions that Manipulate Rules
Expressions that Refer to Rules

Chapter 24 Formulas

Overview
Creating Generic Formulas
Creating Specific Formulas

Chapter 25 Functions

Overview
Invoking Functions
Executing Functions
Types of Functions
User-Defined Functions
Tabular Functions of One Argument
Naming the Tabular Function
Sorting the Items in the Table
Interpolating Function Values
Adding and Deleting Values and Arguments
Adding Rows of Values
Deleting Rows of Values
System-Defined Functions
Arithmetic Functions
Attribute Access Functions
Bitwise Functions
Using Bitwise Operator Functions
Call-Function Function
Character Manipulation Functions
Connection Functions
Quantity Function
Symbol Function
Text Functions
Time Functions
Computing Time on Different Operating Systems

Chapter 26 Text Parsing and Manipulation

Introduction
G2 Text Manipulation Functions
G2 Conventions for Manipulating Text
Ordinary Text Manipulation Functions
Obtaining Text Length
Testing for a Substring
Locating a Substring
Obtaining a Substring
Inserting a Substring
Replacing One Substring With Another
Deleting a Substring
Capitalizing Text
Converting Text to Uppercase
Converting Text to Lowercase
Testing for a Quantity
Regular Expression Syntax
Character Classes
System-Defined Character Classes
Precedence
Text Functions Using Regular Expressions
Locating a Substring Using a Regular Expression
Extracting a Substring Using a Regular Expression
Replacing a Substring Using a Regular Expression
Parsing Strings into Tokens
Specifying the Syntax for Extracting Tokens
Defining Patterns
Defining Tokens
Locating Tokens in a String
Searching for a Token
Responding to a Match
Example
Extracting Tokens from a String
G2 Character Representation
Working with Multiple Character Sets
Working With Text Conversion Styles
Naming the Conversion Style
Determining the External Character Set to Use
Using a Replacement Character
Specifying the Han-Unification Mode
Specifying the External Line Separator
Using a Custom Text Conversion Style
Using the Default Text Conversion Style
Working with G2-Stream Objects
Character Set Conversion Functions
Converting Character Codes to Unicode Text
Converting Text to Unicode Character Codes
Comparing Text
Exporting Unicode Text
Importing Unicode Text
Determining Unicode Digits
Determining Lowercase Characters
Determining Readable Digits
Determining Readable Digits in Radix
Determining Titlecase Characters
Determining Uppercase Characters
Obtaining a Readable Symbol from Text
Obtaining a Readable Text
Converting a Value into a Readable Representation
Converting Characters to Lowercase
Converting Characters to Titlecase
Converting Characters to Uppercase
Transforming Text for Unicode Comparison
Transforming Text for G2 4.0 Comparison

Part V User Interface Components

Chapter 27 Buttons

Overview
Types of Buttons
Subclassing Buttons
Creating Buttons
Common Attributes of Buttons
Providing a Label for the Button
Representing the Variable or Parameter
Action Buttons
Entering the Actions to Execute
Using Unconditionally Statements
Using For, When, and Then Statements
Using the In Order Statement
Controlling the Scheduling Priority
Class-Specific Attributes
Check Boxes
Specifying the Activation Value
Specifying the On and Off Values
Class-Specific Attributes
Radio Buttons
Specifying the Value Upon Activation
Defining the Selected Value
Class-Specific Attributes
Sliders
Specifying the Activation Value
Setting the Minimum and Maximum Values
Specifying When to Update a Value
Specifying When to Show a Value
Class-Specific Attributes
Type-in Boxes
Specifying the Activation Value
Specifying the Formatting Style
Defining the Selection Status
Specifying Editor Options
Class-Specific Attributes

Chapter 28 Text Items

Introduction
Using Free Text to Label Your KB
Creating Free Text
Changing the Color of Free Text
Changing the Font of Free Text
Using Text Inserters to Insert Text into the Text Editor
Creating and Editing a Text Inserter
Using Text Inserters from the Scrapbook
Using Text Inserters to Insert Text

Chapter 29 User Menu Choices

Introduction
Working with User Menu Choices
Labelling the Menu Choice
Capitalization in Menu Entries
Defining the Applicable Class
Controlling When the Menu Choice is Available
Specifying the Action to Execute
Specifying the Scheduling Priority
User Menu Choice Attributes

Chapter 30 External Images

Introduction
Supported Graphics Formats
Working with External Images
Creating an Image Definition
Specifying the Name of the Image
Specifying the Pathname of the Image File
Using an Image in a KB
Saving an Image with a KB
Advantages and Disadvantages
Omitting the Pathname of an Image Saved With a KB
Updating an Image in a KB

Chapter 31 Messages

Introduction
Using Messages
Creating a Message
Creating a New Message Class
Using Actions With Messages
Changing the Color Attributes of Message Properties
Changing the Text of a Message
Concluding Message Text into a Variable or Parameter
Creating and Transferring Transient Messages
Deleting Transient Messages

Chapter 32 Readout Tables, Dials, and Meters

Introduction
G2 Dynamic Displays
Working with Displays
Specifying Tracing and Breakpoints
Specifying the Display Expression
Specifying the Update Interval
Specifying the Display Update after G2 Start-up
Defining the Update Priority
Specifying Simulated Value Display
Common Attributes of Readout Tables, Dials, and Meters
Readout Tables
Digital Clocks
Specifying the Label to Display
Specifying the Display Format
Reading the Current Value
Class-Specific Attributes of Readout Tables
Dials and Meters
Setting the Meter's Lower Value
Determining the Meter's Dial Increment
Class-Specific Attributes of Dials and Meters

Chapter 33 Freeform Tables

Introduction
Creating a Freeform Table
Specifying the Table Size
Specifying Default Formats for Table Cells
Determining the Default Evaluation Settings
Formatting Freeform Tables
Expressions for Freeform Table Cells
Changing Formatting Attributes
Changing Evaluation Settings
Entering Evaluation Settings
Data Seeking Evaluation Settings
Using Data Seeking Evaluation Settings
Event-Updating Evaluation Settings
Scanning Evaluation Settings
Debugging and Tracing Evaluation Settings
Scheduling Evaluation Settings
Other Evaluation Settings
Changing Freeform Tables Programmatically
The Freeform Table Class

Chapter 34 Charts

Introduction
Using Charts
Chart Styles
Specifying the Chart Style
Sizing a Chart
Defining the Data Series for the Chart
Displaying and Updating a Chart
Using Chart Annotations
Default Chart Annotations
Axis Component Attributes
Specifying the Minimum and Maximum Axis Values
Specifying Where Axes Cross
Specifying the Number of Tickmarks on an Axis
Specifying the Tickmarks Interval
Chart Component Attributes
Setting a Chart's Background Color
Setting a Chart's Border Color
Setting a Chart's Grid Color
Specifying Whether Grid Lines are Visible
Data Point Component Attributes
Specifying the Height and Width of Data Points
Defining a Chart's Indicator Type
Specifying Whether the Indicator is Visible
Data Series Component Attributes
Specifying Whether Data Points are Connected
Controlling Connecting Lines
Defining the Line Colors
Updating Charts Programmatically
The Chart Class

Chapter 35 Trend Charts

Overview
Understanding Trend Charts
Compound Attributes
Component Subtables
Accessing Component Subtables
Adding and Deleting Component Subtables Programmatically
Working with Annotations
Displaying Annotations
Changing Annotations
Reprocessing Annotations
Using Component References
Setting Component Defaults
Linking to a Default Value
Configuring Trend Charts
Creating a Trend Chart
Sizing a Trend Chart
Summarizing Trend Chart Attributes
Configuring Plots
Defining Where to Obtain History Values
Specifying the Value Axis for the Plot
Specifying the Point Format
Specifying the Connector Format
Defining the Update Interval
Specifying the Activation Interval
Specifying the Update Priority Level
Specifying Data Seeking Capabilities
Using Simulated History Values
Specifying Event Updates
Defining the Debugging Level
Entering an Expression
Summarizing Plot Attributes
Configuring Value Axes
Displaying the Value Axis
Specifying the Value Range
Specifying Range Limits
Defining the Range Slack Percentage
Specifying the Label Frequency
Displaying Labels as Percentages
Specifying the Significant Digits for Labels
Showing Grid Lines
Adding Extra Grid Lines
Displaying a Baseline
Specifying the Baseline Color
Summarizing Value Axis Attributes
Configuring the Time Axis
Defining the Data Window Time Span
Specifying How Long to Maintain Local History
Specifying the Last Plot Value
Updating the Trend Chart Data
Specifying How Data Scrolls
Shifting the Data Window
Displaying Current Real-Time Clock Labels
Displaying Negative Offset Labels
Defining the Label Frequency
Specifying the Label Alignment
Summarizing Time Axis Attributes
Configuring Point Formats
Displaying Markers
Specifying the Marker Style
Defining the Marker Frequency
Summarizing Point Format Attributes
Configuring Connector Formats
Displaying Connectors
Specifying How Connectors are Drawn
Specifying the Connector Line Width
Displaying Block Shading
Summarizing Connector Format Attributes
Configuring the Trend Chart Format
Displaying an Outer Border
Displaying a Data Window Border
Adding a Trend Chart Legend
Providing a Trend Chart Title
Summarizing Trend Chart Format Attributes
Working with Trend Charts
Updating Trend Charts
How Plots are Drawn
Causes of Redrawing and Reformatting
System Procedures for Trend Charts
Trend Chart Attributes Reference

Part VI Editors and Facilities

Chapter 36 The Text Editor

Overview
Text Editor Features
Opening the Text Editor
Setting the Minimum Width of the Editing Area
Entering Text
Entering Text Within the Text Editor
Entering Text by Selecting Visible Text
Entering a Class Name
Controlling the Number of Classes that G2 Displays
Undoing and Redoing the Last Edit
Controlling the Number of Edits You Can Undo
Correcting Errors in the Editor
Ending the Editing Session
Using the Search Facility
Searching for Text
Using the Scrollable Text Editor
Using the Clipboard and Scrapbookt
Interacting with the Scrapbook Directly
Controlling the Amount of Text in the Scrapbook
Performing Other Edit Operations
Cutting/Pasting Between G2 and Other Applications
Using the Clipboard for Text Exchange
Text Source
Displaying Unicode Characters
Dragging Text Between G2 and Other Applications
Transferring Text From G2
Transferring OLE Text into G2
Dragging and Dropping G2 Items
Using Unicode and Special Characters
Entering Unicode Character Codes
Entering Special Characters
Keystroke Commands
Displaying Help
Moving the Cursor
Deleting Text
Inserting Tabs and Line Breaks
Controlling Tab Settings
Controlling the Editing Session
Inserting Prompts by using the Keyboard
Text Editor Buttons

Chapter 37 The Icon Editor and Icon Management

Overview
Icon Library
Composition of an Icon
Regions
Starting the Icon Editor
Parts of the Icon Editor
Layers Pad
Icon Viewer
Layer Indicators
Other Indicators
Drawing Buttons
Command Buttons
Defining Icons
Starting an Icon Definition
Controlling Icon Size and Shape
Controlling Icon Viewer Magnification
Working with Layers
Creating Layers
Moving Layers
Cloning Layers
Deleting Layers
Specifying Colors
Creating Graphics
Drawing Points
Drawing Lines
Drawing Segmented Lines
Drawing Arcs
Drawing Rectangles
Drawing Circles
Drawing Polygons
Toggling Filled and Outlined Graphics
Deleting Graphics
Moving Graphics
Reshaping Graphics
Defining Text Components
Including Externally Created Images
Image Size and Icon Size
Image Position
Defining Regions
Creating Groups
Saving and Canceling Changes
Tips for Working with Icons
Editing Icons Textually
Icon Description Language Example
Icon Description Language Grammar
Specifying Points
Specifying Lines
Specifying Segmented Lines
Specifying Arcs
Specifying Outlined Rectangles
Specifying Filled Rectangles
Specifying Outlined Circles
Specifying Filled Circles
Specifying Outlined Polygons
Specifying Filled Polygons
Specifying Text Components
Including External Images
Using the Icon and Text Editors Together
Specifying an Icon Background Layer
Specifying a Background Image
Notes on Background Images
Specifying a Background Color
Animated Icons
Defining and Using Icon Variables
Specifying Graphical Positions with Icon Variables
Specifying Text Components with Icon Variables
Specifying Image Components with Icon Variables
Specifying Locations with Expressions
Manual Layer Positioning and Icon Variables
Errors in Icon Variable Specifications
Animating Icons
Changing Width and Height
Referencing Icon Variables
Replacing Icon Variable Values
Merging Icon Variable Values
Conveniently Merging New and Default Values

Chapter 38 The Inspect Facility

Overview
Using the Inspect Facility
Interacting with Items on the Inspect Workspace
Showing Items on a Workspace
Syntax
Showing Items and Classes
Showing the Workspace Hierarchy
Showing the Class Hierarchy
Showing the Module Hierarchy
Showing Procedure Invocation Hierarchy
Showing Method Definition Hierarchy
Writing Items to a File
Syntax
Writing Items
Writing a Class Hierarchy
Locating Items in Your KB
Displaying an Item's Table
Syntax
Determining How to Display the Table
Specifying Which Attributes to Display in the Table
Interacting with the Table
Replacing Text in Items
Syntax
Replacing Text
Replacing Text that is Not Grammatically Correct
Highlighting Text
Checking for Consistent Modularization
Recompiling Items
Syntax
Filtering Classes of Items
Filtering Items Based on a Truth-Value Expression
Filtering Items that Contain Specific Text
Filtering Items that Contain Notes
Filtering Items Based on the Item's Status
Filtering Items Based on the Value of an Attribute
Filtering Items Based on their Category or Focal Class
Filtering Items Based on Their Workspace
Filtering Items Based on Their Module
Filtering Items that Do Not Meet Specified Criteria

Chapter 39 Natural Language Facilities

Introduction
Using G2 Fonts
Using the Natural Language Facilities
Setting the Current Language
Effect of Current Language Setting
Setting a Default-language for a G2 Session
Setting a Language for the Current Window
Supporting Multiple Languages in a KB
Localizing Menu Choices and G2 Facilities
Using Language Translations for Localization
Specifying a Context
Localizing the Text and Icon Editor Buttons
Localizing the G2 Login Dialog
Specifying the Dialog Buttons
Specifying or Localizing the Dialog Message
Localizing Dialog Attributes
Localizing Condition Messages
Using European Languages
Available Translations
Using the Japanese Language Facilities
Accessing Japanese Menus
Entering Japanese Text
Using Language Mode Selectors
Entering JIS Codes
Entering Text in the Kanji Language Mode
Using the Korean Language Facilities
Accessing Korean Menus
Entering Korean Text
Entering Korean Characters
Entering KS C 5601 Characters
Using Text Inserters
Using the Russian Language Facilities
Entering Cyrillic Text
Entering Cyrillic Characters
Entering Additional Cyrillic Characters

Chapter 40 G2 Character Support

Overview
Unicode Character Support
Non-Unicode Character Support
Defining the Gensym Character Set
Subset of ASCII Character Set and Special Characters
Other Standard Character Sets
Using Escape Characters
Using the ~ Escape Character
Using the @ Escape Character
Using the \ Escape Character
Encoding ASCII Characters and Special Characters
Encoding a Tab Character
Encoding Japanese Characters
Encoding Korean Characters
Encoding Russian Characters
Translating From the Gensym Character Set

Part VII Debugging and Optimization

Chapter 41 Error Handling

Overview of G2 Error Handling
Superseded Error Handling Techniques
G2 Error Handling Concepts
G2 Error Classes
Defining an Error Handler
Handling Errors in a Procedure
Synchronous and Asynchronous Error Handling
Default Handler Example
Block Error Handler Example
Error Object Memory Management
Re-Using Error Objects
Handling Non-Procedural Errors
Signaling Errors in a Procedure
Signaling the Default Error Handler
Signalling a Block Error Handler
Shadowing the Default Error Handler
Creating a User-Defined Default Error Handler
Mixing Error Handling Techniques

Chapter 42 Debugging and Tracing

Overview
Displaying the Debugging Parameters System Table
Displaying Warning Messages
Displaying Trace Messages
Setting Breakpoints
Debugging Individual Items
Removing Tracing and Breakpoints
Obtaining Information from Abort Workspace
Writing Messages to a Log File

Chapter 43 Profiling and KB Performance

Introduction
Profiling Your KB's Execution
Techniques for Profiling
Understanding the Profiling Process
Identifying Resource Requirements for Profiling
Using System Procedures for Profiling
Collecting Profile Data
Creating a Copy of G2's Collected Profile Data
Identifying the Contents of a System-Profile-Information
Understanding Relationships Among System-Profile-Information Attributes
Representing Empty Profile Data
Understanding the Processing-Time Attribute
Understanding the Profiled-Items Attribute
Understanding the Profiled-Activities Attribute
Profiling Executable Items and Activities
Resetting G2's Profile Data
Identifying Your Profiling Strategy
Reporting the Contents of a System-Profile-Information
Analyzing Profiling Data
Using Compilation Configurations
Stability Configurations
Declaring the Configurations
Understanding Compiled Attributes
Validating References at Run-Time
Understanding Compilation Dependencies
Declaring Procedures and Methods as Inlineable
Recompilation Considerations
Declaring Items as Stable-Hierarchy
Declaring Items Stable-for-Dependent-Compilations
Identifying Potential Performance Improvements
Identifying Knowledge that is Not Eligible for Performance Improvements
Understanding Guidelines for Configuring Groups of Items
Understanding Guidelines for Configuring Items in a Modular KB
Declaring Items Independent-for-All-Compilations
Isolating a Group of Items From Automatic Recompilation
Isolating a Group of Items from Items Provided by Other Developers
Changing Items that Have Compilation Configurations
After Deleting an Item Declared Stable-for-dependent-compilations
After Changing the Knowledge of Items Declared Stable-for-dependent-compilations
After Removing a Stable-for-dependent-compilations Configuration
After Changing an Unconfigured Dependent Item to an Independent Item

Chapter 44 G2-Meters

Overview
Working with G2-meters
Enabling and Disabling G2 Meter Service
Specifying the Meter Lag Time
Creating G2-Meters
Disabling and Re-enabling Individual G2-Meters
Interpreting G2-Meters that Measure Memory
G2-Meter and Operating System Measurements
Approximations in Memory Meter Readings
Types of G2-Meters
memory-size
memory-usage
memory-available
region-n-memory-size
region-n-memory-usage
region-n-memory-available
clock-tick-length
maximum-clock-tick-length
percent-run-time
simulator-time-lag
priority-n-scheduler-time-lag

Chapter 45 Memory Management

Introduction
Managing KB Data Memory
G2 and System Services
Determining System Adequacy
G2, RAM, and Virtual Memory
Determining RAM Requirements
Overview of G2 Memory Management
Memory Management Problems
Insufficient Memory Allocation
Unlimited Memory Consumption
Memory Management During Development
G2 Memory Regions
Measuring G2 Memory Usage
Generating the Maximum Memory Allocation
Measuring the Maximum Memory Allocation
Measuring Memory with G2 Memory Meters
Measuring Memory with Allocation Reports
Measuring Memory with Operating System Commands
Determining Region 1 and Region 2 Memory Requirements
Excess Memory Preallocation
Safety Factors
Allocating Less Than the Default
Restricting Region 3 Memory
Specifying G2 Memory Allocation
Specifying Memory in the G2 Command Line
Specifying Memory with UNIX Environment Variables
Specifying Memory with VMS Logicals
Specifying Memory with Windows Environment Variables
Causes of Unbounded Memory Requirements
Unnecessary Retention of Storage
Failure to Delete Transient Items
Correcting Unbounded Memory Requirements
Checking Region 1 Memory Increases
Accumulating Items
Non-Returning Procedures
Accumulating Transient Class Definitions
Accumulating History
Accumulating Process IDs
Accumulating Log Book Pages
Accumulating Message Board Entries
Generic Rules
Multiple Data Service Requests
Lagging Priorities
Checking Region 2 Memory Increases
Accumulating Symbols
Accumulating Text Strings
If All Else Fails

Chapter 46 Task Scheduling

Overview
KB Processing
Ticking the G2 Clock
Scheduling and Prioritizing Tasks
Task Queues
Prioritizing Tasks
Default Task Priorities
Main Processing Cycle
Optimizing Task Scheduling
Using the Default Scheduling Interval
Using a Subsecond Timing Interval
Using Subsecond Interval Expressions
Using a Continuous Scheduling Interval
Infrequent Scheduling Demands
Critically Fast Subsecond Scheduling

Part VIII Application Deployment

Chapter 47 Package Preparation

Overview
Preparing a KB For Customer Distribution
Saving a Copy of the Source KB
Entering Package Preparation Mode
Text Stripping Items
Removing KB Change Logging and Version Information
Making Workspaces Proprietary
Creating a Proprietary KB
Entering a Proprietary Statement
Creating and Configuring Proprietary Items
Testing a Proprietary KB Before Completion
Completing Proprietary Workspaces
Distributing a Proprietary Application Package

Chapter 48 Licensing and Authorization

Introduction
Understanding G2 Licensing
G2 License Types
License Options
Saving a KB
Authorizing G2
The g2.ok File
Finding License Types and Options in a KB
Telewindows Licensing Structure
Dedicated Telewindows
Floating Telewindows
Simulating License Types

Part IX Networking and Interfacing

Chapter 49 Network Security

Introduction
Determining the Level of Network Security
Defining Network Security for a KB
Using Configuration Statements for Network Access
Allowing or Prohibiting Connect Access

Chapter 50 Telewindows Support

Overview
Accepting a Connection From a Telewindows Process
Displaying the Telewindow
Connecting with a G2 That is Not Secure
Connecting with a Secure G2
Accepting a Password
Associating the Telewindow With a G2-Window Item
Logging Out From a Secure G2
Closing a Telewindows Connection
Rerouting Telewindows Connections
Overview
Rerouting a Telewindows Session to a Secure G2
Using System Procedures
Using G2 Window Attributes
Applications that Reroute Telewindows Connections
Knowledge External to the KB
Application Requirements

Chapter 51 G2 to G2 Interface

Introduction
Exchanging Data Using the G2 to G2 Interface
Using the G2 to G2 Interface
Creating Data Interface Objects
Naming the Interface Object
Identifying Attributes
Setting the Warning Message Level
Defining the Connection Details
Specifying the Protocol to Use
Setting the Interface Timeout Interval
Obtaining the Current Connection Status
Using Whenever Rules That Refer to the Connection Status
Starting the G2 Processes
Activating Data Interface Objects
The g2-to-g2-data-interface Class
Creating Data Interface Subclasses
Using Remote Data Service
Creating a G2-to-G2 Variable
Specifying the G2 Data Interface
Defining the Remote G2 Expression
Considering Network Access Configurations
Example of Remote Data Service
Using Remote Procedure Calls
Creating and Declaring a Remote Procedure
Using an Alternative Procedure Name
Invoking Remote Procedures
Starting a Remote Procedure
Calling a Remote Procedure
Value and Item Passing Arguments and Return Types for RPCs
Considerations for Item Passing
Creating Compatible Definitions
Aligning User-Defined Attributes
Accumulating Transient Items
Value Passing
Configuring the KB for Value Passing
Example of Passing an Integer Value
Example of Passing a Structure Value
Passing an Item as a Network Handle
Configuring the KB for Item Passing as a Network Handle
Obtaining Network Handles
Obtaining a Network Handle Using a System Procedure
Example of Obtaining a Network Handle
Example of Passing an Item as a Handle
Passing Variables and Parameters
Passing a Variable or Parameter as a Copy or Handle
Passing the Current Value of a Variable or Parameter
Passing User- and System-Defined Classes
Configuring the KB for Passing an Item with Attributes
Passing an Entire Item or a Specific Attribute Set
Item-passing Examples in this Chapter
Passing A Copy of Any Item
Including and Excluding Attributes
Passing An Item Including User-Defined Attributes
Example of Passing an Item Including User-Defined Attributes
Passing An Item Excluding User-Defined Attributes
Passing Attributes With Object Values
Example of Passing an Attribute With an Object Value
Passing An Item With System-Defined Attributes
Examples of Passing System-Defined Attributes
Passing Both User- and System-Defined Attributes
Passing An Item With Attributes and A Handle
Specifying One or More Remaining Arguments
Example of Passing Remaining Arguments
Dragging Items Between G2 Processes
Configuring Classes for Drag and Drop

Chapter 52 G2 Gateway

Overview
Exchanging Data Using G2 Gateway (GSI)
Using GSI Interface Objects
Creating a GSI Interface Object
Locating GSI Interface Objects on Activatable Subworkspaces
Creating GSI Variables
Specifying the GSI Interface Name
Determining the Status of the Variable
Using GSI Message Servers

Chapter 53 Foreign Functions

Overview
Foreign Functions Examples
Creating a Sample Foreign Image
Calling the Sample Foreign Functions
Using Foreign Functions
Creating a Foreign Function Template File
C and C++ Data Types and Character Conversion
Using the Overlay Utility through the Makefile
Completing the Makefile Global Variables
Running the Makefile
Using the Overlay Utility on OpenVMS
OpenVMS and VAX/VMS Options File
Starting and Connecting to the Foreign Image
Starting the Foreign Image as an External Process
Connecting to an External Process Foreign Image
Starting a Foreign Image From Within G2
Connecting to a Foreign Image with a G2-Init File
Declaring a Foreign Function in a KB
Providing the Name of the C Function
Setting the Timeout Interval
Handling Possible Name Collisions
Using a Foreign Function
Disconnecting from the External Foreign Function

Part X Appendixes

Appendix A Launching a G2 Process

Introduction
Starting G2
Understanding Standard Output Messages
Capturing Windows Error Messages in a Log File
Using an Initialization File
Coding an Initialization File
Using Command Line Options
Supported Command Line Characters
Using Environment Variables
Dictionary of Command Line Options
decnetexact
decnetport
default-language
display
fonts
fullscreen
geometry
graphics
height
help
icon
init
init-string
kb
kfepindex, kfepkojin, and kfepmain
language
log
magnification
module-map
module-search-path
name
network
nowindow
ok
password
resolution
rgn1lmt
rgn2lmt
rgn3lmt
screenlock
start
tcpipexact
tcpport
user-mode
user-name
v5ok
width
window
x-magnification and y-magnification
x-resolution and y-resolution

Appendix B Reserved Symbols

Introduction

Appendix C Keystroke Commands

Using Keystroke Commands

Appendix D Syntax Conventions

Introduction
Syntax Notation
User-Specified Terms
Value Expression Terms
Literal Value Terms
Item Expression Terms
Attribute Reference Terms
Item Name Terms
Class Name Terms
Attribute Name Terms
Other Expression Terms
Other Literal Terms

Appendix E G2 KBs and GIF Files

KBs Directory Structure
Demonstration KBs
Sample KBs
Utility KBs
GIF Files

Appendix F Superseded Practices

Overview of Superseded Practices
Attribute Files
Drawing Modes
Unscheduled Drawing
XOR Drawing Mode
G2 File Interface (GFI)
G2 Simulator
Graphs
Converting Graphs to Trend Charts

Part XI Glossary and Index

Glossary

Index


| Title Page | Short Contents | Glossary | Index | Comments |
Copyright © 1997 Gensym Corporation, Inc.