SOLVENT.KSL

This example recommends a solvent to be used on some equipment. The solvent recommended depends on the equipment class, the ventilation of the site, the main material of the equipment and whether the equipment contains rubber compounds.

The following additional flex technical points are demonstrated in this example:

  • The use of a single backward chaining relation to find the solvent.

  • The automatic asking of a question when its value is tested.

  • The use of square brackets to limit "or" disjunctions.

CODE...


BLOCKS.KSL

This example implements the blocks world problem, as defined in 'Logic for Problem Solving' by Professor Robert Kowalski.

The following additional flex technical points are demonstrated in this example:

  • The use of a single forward chaining rule to generate valid moves.

  • The use of square brackets in conjunction with "or".

CODE...


SPECIES.KSL

The objective of this example is to show two contrasting methods, forward and backward chaining, for identifying a species of animal given a set of attributes.

The following additional flex technical points are demonstrated in this example:

  • Disjunctions ("or") used in the conditions of a forward-chaining rule.

  • The constraining of a backward-chaining relation to a single solution.

CODE...


QUESTION.KSL

This simple example shows the range of different built-in questions that can be asked.

The following additional flex technical points are demonstrated in this example:

  • The "do" directive for automatically running goals on compilation.

  • User-defined questions implemented in Prolog.

  • The catchall question that handles any undefined question asked.

  • The use of relations to constrain the answers to questions.

  • The use of a flex support predicate to find all the currently defined questions.

  • The control of attribute de-referencing.

CODE...


ROBBIE.KSL

This example demonstrates the use of forward-chaining in a configuration and resource allocation problem.

The following additional flex technical points are demonstrated in this example:

  • Data-driven launch procedures.

  • The use of synonyms and templates.

  • The use of nested groups.

CODE...


TIMTABLE.KSL

This example contrasts forward and backward-chaining methods for creating a timetable.

The following additional flex technical points are demonstrated in this example:

  • The use of remember and forget to store values. It is important to note that remembered facts are automatically forgotten on backtracking.

  • The use of backward chaining relations in the forward chaining process.

CODE...


WATER.KSL

This example implements the water containers problem, as defined in 'Logic for Problem Solving' by Professor Robert Kowalski.

The following additional flex technical points are demonstrated in this example:

  • The use of dynamically updated scores in forward chaining rules.

  • The linking of forward chaining rules into a network using groups.

  • The use of rule explanations.

CODE...


YIELD.KSL

This example implements a simple expert system that recommends a species of tree seed, where to get the seed from, the normal yield of the seed and how that yield should be varied according to a description of the location, soil and conditions that hold where the seed is to be planted.

The following additional flex technical points are demonstrated in this example:

  • The automatic asking of questions when an attribute is tested.

  • The use of group ordering in testing the answer to questions

  • The difference between setting values for logical and global variables.

CODE...


ANIMAL.KSL

This example demonstrates the frame hierarchy system and a mechanism for identifying frames according to positive and negative attribute clues.

The following additional flex technical points are demonstrated in this example:

  • The use of a flex support predicate to find a currently defined frame.

  • Specific inheritance links.

  • Suppressing inheritance.

  • Specifying more than one parent frame.

  • Data declarations that are automatically run on compilation.

CODE...


FUNCTION.KSL

This example demonstrates the function construct by implementing a fibonacci and a factorial function.

The following additional flex technical points are demonstrated in this example:

  • The automatic invocation of functions when requested.

CODE...


TREE.KSL

This example demonstrates how to implement decision tree logic in flex.

The following additional flex technical points are demonstrated in this example:

  • Relations

  • Questions

  • Groups

CODE...