24.11.2014 Views

flex Expert System Toolkit - LPIS

flex Expert System Toolkit - LPIS

flex Expert System Toolkit - LPIS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7. Knowledge Specification Language 61<br />

7. The KSL<br />

KSL Terms<br />

Comments<br />

Punctuation<br />

Numbers<br />

Atoms<br />

<strong>flex</strong> toolkit<br />

This chapter describes all the elements of the KSL. See also the chapter on<br />

<strong>flex</strong> Predicates for the equivalent Prolog predicates, and the chapter on the<br />

Run-Time Interpretation of KSL for a description of how the KSL is<br />

compiled into Prolog.<br />

This section describes the valid tokens and terms of the KSL. Essentially<br />

they follow the tokenisation of Prolog's Edinburgh syntax, with a few<br />

enhancements.<br />

There are five types of Edinburgh token: punctuation, number, atom,<br />

string and variable. Built on top of Edinburgh tokens are the concepts of a<br />

KSL name and a KSL value.<br />

Any text between the symbols /* and */ is treated as a comment and is<br />

ignored by the <strong>flex</strong> compiler.<br />

The % symbol indicates the start of a comment up to the end of the line on<br />

which it occurs.<br />

A punctuation mark is always considered as a separate token (unless it lies<br />

within quotes), and is one of the following:<br />

( ) [ ] { } | ! ; ,<br />

Numbers are either integers or floating-point numbers.<br />

Examples<br />

211327 -32768 0 2.34 10.3e99 -<br />

0.81<br />

Atoms are of three types: alphanumeric, symbolic and quoted.<br />

An alphanumeric atom is a lowercase letter (a-z) followed by a sequence of<br />

zero or more alphabetic characters (a-z, A-Z or _) or digits (0-9).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!