# Presentation: 037059

## The KEEL Dynamic Graphical Language for Defining, Testing, and Executing Judgmental Reasoning

**Compsim**
- Tom Keeley
- _[tmkeeley@compsim.com](mailto:tmkeeley@compsim.com)_

**http://www.compsim.com**

## Scope of Problem Being Addressed with KEEL Technology

**Systems Requiring Human-like Reasoning / Judgment**
**Non-Linear Systems**
**Multi-Dimensional / Inter-Related Systems**
**Explainable / Auditable Decisions and Actions**
**Real-Time Response**
**Small Form Factor**
**Rapid Development and Test Environment**
**Architecture Independent Solutions**
**Multi-Platform Deployment**

## Definition:

**Judgment**
- an opinion formed by judging something; "he was reluctant to make his judgment known"; "she changed her mind"
- the act of judging or assessing a person or situation or event; "they criticized my judgment of the contestants"
- (law) the determination by a court of competent jurisdiction on matters submitted to it
- the cognitive process of reaching a decision or drawing conclusions
- opinion: the legal document stating the reasons for a judicial decision; "opinions are usually written by a single judge"
- the capacity to assess situations or circumstances shrewdly and to draw sound conclusions
- sagacity: ability to make good judgments _[www.cogsci.princeton.edu/cgi-bin/webwn2.1](http://www.google.com/url?sa=X&start=0&oi=define&q=http://www.cogsci.princeton.edu/cgi-bin/webwn2.1%3Fs%3Djudgment)__ _

## Definition:

**Reasoning**
- intelligent: endowed with the capacity to reason
- thinking that is coherent and logical www.cogsci.princeton.edu/cgi-bin/webwn2.1
- The determination of the conclusions that can be drawn from certain premises.www.wwnorton.com/college/psych/gman5/glossary/R.htm
- Using logic to analyze data to make generalizations, evaluations, or decisions based on judgmental criteria.blink.ucsd.edu/Blink/External/Glossary/View_Glossary/1,1332,105,00.html
- The process of drawing a conclusion on the basis of evidence.www.nku.edu/~weiss/Classes/Public_Speaking/ChapterTerms.htm
- Identifying the highest-ranking alternative and reasoning this ranking, with reference to the advantages and disadvantages of each alternative that have previously been identified.www.maximumedge.com/encyclopedia/Society/Economics/Consumer_Choice/

## Hypothesis

**Left Brain**
-   Language
-   Numbers

**Conventional Text-based Languages**
**Sequential Processing**
**IF | THEN | ELSE**

## Definition

**Cognitive Cycle (Compsim)**
- The period of time it takes to “fuse” a set of information items of varying levels of importance and balance their impacts against each other to determine an instantaneous state of resolution for all problems in the cognitive domain.
- Characteristics:
- The cognitive cycle is repeated, because the environment changes
- Importance of information changes as the situation changes
- The system must “re-balance” constantly
- Decisions and Actions one instant may be different the next

## The KEEL Graphical Language

- Why a graphical language?
- Human “expertise” is an exercise in judgment or reasoning
- Subjective reasoning is more image processing than numeric / formula processing
- More Right Brain than Left Brain
- Judgmental reasoning is a “balancing” activity
- Evaluating options
- Comparing alternatives
- Defining non-linear relationships is a “curve” processing function
- A graphical language allows one to “**see**” the curves and “**see**” the relationships

**Notes:**
This slide begins the discussion of the KEEL graphical language.
It starts with a discussion of “judgmental reasoning” and suggests it is more like “image processing” than numeric processing.

We introduce the concept of “balancing” information, which is similar to watching a scale balance.

This slide also recognizes the non-linear relationship of data items, and that the balancing act must take into account these non-linear relationships.

Behind the scenes we are recognizing that it is impossible to write these multi-variable complex non-linear equations.  A graphical language like KEEL is the only way the problem can be solved.

This is a new paradigm in programming where the designer thinks in terms of information importance and dynamic relationships.

## The KEEL Graphical Language

- IS NOT a flow charting language!

**Notes:**
This slide highlights that the KEEL graphical language is NOT a flow charting language.

## The KEEL Graphical Language

- Focuses on
- The importance of information
- Shown graphically by “size”
- Relationships between information
- Shown graphically by “wires”
- Visualizing the reasoning model
- Shown graphically by “watching the system react to changing inputs”
- Graphing the relationships and looking at the resulting complex curves
- Interactively testing the model
- Incorporating cognitive models in simulations capable of exporting real-world data into the language development environment allowing the system to “trap” on certain actions for detailed review.

**Notes:**
This slide highlights what we will demonstrate on the following slides.

The following slides are intended to introduce some of the graphical elements and demonstrate the ease of development.

It is not intended to be a complete tutorial on the language.

## The KEEL Graphical Language

- Vertical Bars identify Positions
- Decisions Or Actions
- Or just Information Items
- Positions are OUTPUTS of the system
- Positions can be Information used to influence other Positions
- All data items are expressed as normalized values (0-100)

- Action 1

- Action 2

**Notes:**
This slide begins to build an understanding of the KEEL graphical elements.

Key attributes are “importance of information”.

Outputs are shown at the top of the screen.

There is a reference to the normalized data.  Behind the scenes there is a strong mathematical elements.  Exact numeric values can be viewed at any point in time.

However, we will shortly see that it is relationships and dynamic values where KEEL technology benefits are exposed.

## The KEEL Graphical Language

**The KEEL Graphical Language**

- Arguments
- Drivers that support or block a Position (Decision or Action)
- Control the evaluation of a Position
- Arguments are INPUTS to the system
- Can be driven by other Positions in the same system

**Notes:**
This slide continues to build the elements of the language.

One might remember the CMT (IBIS) discussions.  KEEL uses the same terms of Positions and Supporting and Objecting Arguments.

## Dynamic Source Code

- Dynamic Source Code allows the designer to interact with the design while it is under development

- Click the image to demonstrate

**Notes:**
This slide has an embedded .AVI file that when clicked shows that the code is dynamic.  

There is no “compile” process associated with the KEEL language.  

There is not even an “interpretation” process that one might be familiar with in Basic languages were the design is saved as a pseudo-code.

## Editing is “Easy”

- Drag and Drop Editing allows Relationships to be defined
- Interactive development simplifies development
- Wires show “explicit” relationships

- Click the image to demonstrate

**Notes:**
This slide has another embedded .AVI file that shows the drag and drop editing that is used to define relationships between data items.

It should be recognized that as soon as a wire is added to the design the system is processing that relationship.  The designer can get immediate feedback on the reasoning model.

## Decision Making Concepts

- One Position controls the Importance of Another

- Click the image to demonstrate

**Notes:**
Here we begin to show some of the concepts that can be modeled.

The concept being demonstrated here shows one decision impacting the importance of a second.

This is demonstrated by showing the user dragging an output connection point (source) to an input connection point (sink).

As soon as the link is made, the system shows the relationship in action. 

## Decision Making Concepts

- One Position “impacts” another
- In this case Action 1 provides a driving influence on Action 2

- Click the image to demonstrate

**Notes:**
This slide introduces the concept of having one decision “contribute to” another decison.  This is just a simple direct relationship.

In this case we wire the output (source) to an argument (sink, that in this case is a supporting argument).

As soon as the wire is created the system responds accordingly.

## Decision Making Concepts

- Thresholds allow “events” to be triggered

- Click the image to demonstrate

- Threshold

**Notes:**
This slide introduces the concept of a threshold.

Thresholds can be used to trigger events or turn on / off other parts of the design.

The threshold here has been set at a fixed point.  It will be the source and will be used to turn on / off the third position.

The embedded .AVI file shows the wire being created.  Then it shows the user stimulating the input position.  The output is turned on / off accordingly.

## Decision Making Concepts

- One Position controlling the Threshold for Another Position

- Click the image to demonstrate

**Notes:**
This slide extends the previous model by showing that the threshold itself can be controlled.

Here, the first position is used to control the threshold setting of the second position , which is being used to turn on/off the third position.

Again, as soon as the link is made, the system can be evaluated.  By tracing the wire, one can see the explicit relationships.

At this point, one might consider how long it would take to write the “code” to handle this type of logic.

Also, consider that when one is developing this logic, that person is considering the problem, not the code!

## Review
Decisions / Actions / Information
Can be Binary (Yes / No)
Can be Relative (Analog)
Data is manipulated as Normalized Data 
(0-100)
Data is analyzed at a “point in time”
The KEEL Engine has no “memory”
Memory is external to the Engine

- Decisions / Actions / Information
- Can be Binary (Yes / No)
- Can be Relative (Analog)
- Data is manipulated as Normalized Data
- (0-100)
- Data is analyzed at a “point in time”
- The KEEL Engine has no “memory”
- Memory is external to the Engine

**Decision Making Concepts**

**Notes:**
The new point identified in this slide is that KEEL is a decision-making engine that evaluates the data at an instant in time.

In general, there is no memory (other than the model itself).

This means that if one is doing trend analysis, it must be preprocessed before the KEEL Engine is called.

We will introduce the concept of a KEEL Engine shortly.

## More Problems

- Time and Space impact the Problem Definition
- What is closer may have more impact than what is farther away
- Planning activities consider future data
- There are optimal times to make decisions and take actions
- The environment changes with time and may cause the situation to be constantly re-evaluated
- Different options may be available at different times

**Notes:**
This page extends the definition of complex problems that must be addressed.

## Collision Avoidance

## Collision Avoidance Graph

## Intelligent Traffic Intersection

## KEEL – What is it? 

**The KEEL Toolkit provides a mechanism for packaging human-like decision-making in embedded devices and software applications.**
**Dynamic Graphical Language**
**When the design is complete, it is deployed as a KEEL Engine.  The KEEL Engine is provided as a text file with conventional source code:**
**C, Java, Visual Basic (6 or .NET), Microsoft C#, Macromedia Flash, or PLC Structured Text**
**Approximately 3K code plus tables.**

## KEEL – What is it? 

**When embedded in a product:**
**KEEL is 2 or 3 subroutines that manipulate a set of tables created with the KEEL toolkit or a Class with several methods for loading and unloading the tables and interpreting the data.**
**The KEEL engine loads inputs into the tables and iteratively calculates solutions until stable answers are obtained, at which time the answers are posted to the desired locations.**
**The KEEL Engine has a very simple API**
**Load tables with input data**
**Think (call the KEEL Engine)**
**Remove output data from output tables**

## KEEL Technology

| Technology Comparison |  |  |  |  |
| --- | --- | --- | --- | --- |
|  | Neural Nets | Fuzzy Logic | AI - Forward /Reverse Chaining | KEEL |
| General Concept | Pattern Matching | Geometric Fuzzification / Defuzzification | Trial and Error | Dynamic Adjustment to Importance of Data (Genetic) |
| Source of Understanding | Trained Patterns | Human Designer |  Human Designer  | Human Designer |
| Pattern Training Required | Major Problem | No | No | No |
| Explainable Decisions | No | Difficult | Somewhat | Fully Explainable |
| Small Memory Footprint | No | No | No | Best |
| Performance | Determined by Application | Determined by Application | Worst | Determined by Application |
| Suitable for Control | Yes | Yes | Probably Not | Yes |
| Interactive Development | No | Maybe | Maybe | Yes |
| Strength | Feature Extraction, No need to explain reasoning | Interpreting human terms (warm, hot, hottest...) (Linguistic Uncertainty) | Static rules, Text based rules | Dynamic Environments, Explainable / Auditable Execution models, Judgmental Reasoning |
| Weaknesses | Pattern Training Required; Decisions not “Explainable”; Does not handle “Surprise” conditions | Difficult to Explain Reasoning; | Fragile / Brittle - Hard to maintain; Does not handle “Surprise” | New |

## http://www.compsim.com/demos.html

## Prototype UAV Model

- Action Selection Based on
-  Target Identification
-  Target Value
-  Target Risk
-  Attack Request Authorization
-  Weapon Supply
-  Damage Assessment
-  Fuel Supply

- Firing Optimization
-  Target Risk
-  Distance To Target
-  Collision Avoidance

## KEEL Control Systems for UAVs

## Compsim

**Address:**
**	****	****Compsim**
**	****	****PO Box 532**
**	****	****Brookfield, Wisconsin 53008-0532**
**Phone:**
**	**** ****	****(262) 797-0418**
**WEB**
**	****	**_**http://www.compsim.com**_
**Email**
**	****Tom Keeley**
**	****	**_**tmkeeley@compsim.com**_