Introduction

In this chapter we learn to work with NEST. We start with the options of the system, because there are some setups that can help us with the work. After we learn, how to do a simplest consultation and at the end, we leart to set up a more complicated consultation.


Attributes and Propositions

Attribute is some thesis with which the system can operate. There are 4 types of attributes:

  • binary;
  • single;
  • multiple;
  • numeric.

Binary attributes are the basic type of attributes. Just one proposition is derived from this attribute and this proposition has the same name. This proposition (and the relevant attribute) takes a weight, which represented its „verity“ (if the weight is maximal, the proposition`ll be certainly valid, if the weight is minimal, the proposition`ll be certainly invalid). The weight is represented by an interval. With this interval, it is possible to express partial knowledge about the proposition`s verity.

For example, if we worked into the weight range [-1;1] (this weight range will be used in all following example) the following weight have these sense:

  • [-1;-1] - proposition is certainly invalid (FALSE);
  • [ 1; 1] - proposition is certainly valid (TRUE);
  • [-1; 1] - we know nothing about proposition (UNKNOWN);
  • [ 0; 0] - proposition is irrelevant (IRRELEVANT).

Single attributes are attributes, which take one value from the list of values. The typical example is „type of account“ in a bank. From this attribute, there are derived as much propositions as the count of values in the list (propositions are the same as the binary propositions). When the attribute takes some value (with the weight), one relevant proposition takes this weight and all others propositions take the weight „FALSE“.

For example, if it`s set that user opened a current account with the weight [0,6;0,6], all others types of accounts`ll take the weight „FALSE“.

Multiple attributes are like „single attributes“ but they can take more values from the list of values. The example can be the attribute „speaking languages of person“. From this attribute, there are derived as much propositions as the count of values in the list. When the attribute takes some value (with the weight), relevant propositions take relevant weight and others propositions take the weight, witch was preconfigured (UNKNOWN or IRRELEVNT).

Numeric attributes are attributes, which take numeric value from preconfigured range. The example can be „salary size“. An unlimited number of propositions can be derived from this attribute. Each proposition has set the weight function, which convert the number value to the weight.

The weight function is set by a fuzzy interval. This interval is identified by 4 numbers (fuzzy lower, crisp lower, crisp upper, fuzzy upper). If the number value is outside „fuzzy“ limits, the resulting weight`ll be „FALSE“, if the number value is inside „crisp“ limits, the resulting weight`ll be „TRUE“. If the numeric value is between „fuzzy“ and „crisp“ limits, the resulting weight`ll be counted with the linear function (the upper and lower number of weight interval are same). This calculation is illustrated into the following picture (the fuzzy interval: [10, 20, 40, 40]):

Propositions are divided to questions (proposition isn`t in conclusion of any rule), intermediate propositions (proposition is in a conclusion and in a condition of some rule), and goals (proposition isn`t in a condition of any rule) accordint to the positions of the propositions. If the proposition is a question, all others propositions derived from the same attribute`ll have to be the questions too. The proposition that is neither in condition nor in conclusion of any rule, is so-called solitary proposition. It`s ignored by NEST.

Attributes are divided to „environment“ and „case“ attributes according to the scope. Environment attributes have some relation to environment, to business, to affair, to thing, which change rare and it`s not needful to recognise them over again. The system transfers their values from one consultation to the others (if the user doesn`t stop it). Average rate of interest is the typical example. Case attributes are all the others attributes, i. e. attributes asked by system during each consultation.

The value of an attribute can be obtained from different sources. If the attribute is a goal or an intermediate attribute, the implicit source is the „inference“ (by the medium of rules). If the attribute is question, the implicit source is „question to user“. Another source is a „file“ - the system try to interpret the first line of a given file. Last source is an „external function“, which create the file with value. This sources can be set up so that if one source fail, the other will take it`s place. Last two expliced source can be used only with binary and numeric attributes.

Action is external programme, that is assigned to some proposition. If this proposition obtains at least the weight, that is set in the action, the external programme will be executed. If the action is assigned to the attribute, the result will be same as if this action was assigned to all propositions derived from this attribute.


Rules

The basic form of rule in NEST is following:
context: IF condition THEN conclusion 1[weight 1],..., conclusion n[weight n]

Context decides if the rule will be used or not. More information about contexts are in the next section

Condition is represented by a disjunction of any „term“, where „term“ can be either a proposition or a conjunction of propositions. If the condition cames true, the conclusion`ll obtain relevant contributory value. The condition cames true when it`s value overpass the threshold of the condition (0 for the compositional rules, for logical rules a weight set by a knowledge engineer). More information about this mechanism is in section „work with indeterminateness“.

Conclusion is represented by the proposition and the weight, which serves for count the weight of proposition. The rule can have more conclusion, but this situation is the same as there are more rules with identical condition.

Every rule may have set a priority (number from an interval [0;1]), by which rules are selected during the inference. (More information is in the section „Inference mechanism“.)

Action can be assigned to the rules, too. This action is executed when the system use this rule, e. g. when the condition of rules comes true.

Rules are divided to 3 basic types:

  • apriori rules;
  • logical rules;
  • compositional rules.

Apriori rules are that rules, that are always active, e.g. they haven`t condition (nor context), let us say the condition is the value „TRUE“. These rules represent „general trues“.

Logical rules have the conclusion, that don`t take values from all interval [-1;1], but only the „logical values“. If the condition comes true (e.g. lower limit of weight interval overpass the threshold for this rule), the conclusion will take „TRUE“ or „FALSE“, if the condition doesn`t come true, the condition will take „IRRELEVANT“.

Compositional rules work to whole interval [-1;1] how it`s explained in the section „work with indeterminateness“.


Contexts

Context decide if the rule, to which is context assigned, will be used or not. Context has it`s threshold for each rules (if the threshold isn`t defined, system`ll take the global threshold) and the rule is used, when the weight of context (the upper limit of the weight interval) overpass this threshold.

Context is represented (as the condition of rule) by disjunction of any „term“, where „term“ can be either a proposition or a conjunction of propositions.


Integrity constraints

Integrity constraints have the same form as compositional rules. The different between them is, that integrity constraints doesn`t participate to the inference of goals, but they are evaluated separately after the inference. They have the function of verification, whether the goals fulfil the other requirements. If the integrity constraint comes true, the system makes nothing. But if the integrity constraint come false, user`ll receive notice that this constraint was broken.


Elements of Knowledge Base

Knowledge base containts 5 „classes of knowlage“, which were described above (attributes, propositions, rules, contexts, integrity restrictions), and following global properties:

  • base description;
  • name of the expert, who affords knowledges to the base;
  • name of the knowledge engineer, who creates the base;
  • date of the creation;
  • weight range;
  • global context threshold;
  • global condition threshold;
  • implicit inference mechanism;
  • default weight of propositions;
  • global priority.

Knowledge base is stored in the file, which has the syntax based onto XML.


Basic Syntax of Base

 <base>
  <global>
  ...
  </global>
  <attributes>
  ...
  </attributes>
  <contexts>
  ...
  </contexts>
  <rules>
   <apriori_rules>
   ...
   </apriori_rules>
   <logical_rules>
   ...
   </logical_rules>
   <compositional_rules>
   ...
   </compositional_rules>
  </rules>
  <integrity_constraints>
  ...
  </integrity_constraints>
</base>


Syntax of Global Property

<global>
 <description> string </description> <!-- base -->
 <expert> string </expert> <!-- name of expert -->
 <knowledge_engineer> string </knowledge_engineer> <!-- name of knowledge engineer -->
 <date> date </date> <!-- date of creation -->
 <inference_mechanism>standard | logical | neural | hybrid</inference_mechanism> <!-- inference mechanism -->
 <weight_range> number </weight_range> <!-- weight range -->
 <default_weight>unknown | irrelevant</default_weight><!-- implicit weight of proposition -->
 <global_priority>first | last | minlength | maxlength | type | user</global_priority>
 <context_global_threshold> number </context_global_threshold>
 <condition_global_threshold> number </condition_global_threshold>
</global>


Syntax of Attributes

<attribute>
 <id> string </id>
 <name> string </name>
 <type>binary | single | multiple | numeric</type>
 <scope>case | environment</scope>
 <sources>
  <source>
   <source_type>infer | user | external_file | external_function</source_type>
   <source_file> string </source_file>
   <function> string </function>
   <parameters> string </parameters>
  </source>
  ...
 </sources>
 <comment> string </comment>
 <actions>
  <action>
   <function> string </function>
   <parameters> string </parameters>
   <action_threshold> string </action_threshold>
  </action>
 </actions>

 <propositions><!-- not for binary attributes -->
  <proposition>
   <id> string </id>
   <name> string </name>
   <weight_function><!-- only for numeric attributes -->
    <fuzzy_lower_bound> number </fuzzy_lower_bound>
    <crisp_lower_bound> number </crisp_lower_bound>
    <crisp_upper_bound> number </crisp_upper_bound>
    <fuzzy_upper_bound> number </fuzzy_upper_bound>
   </weight_function>
   <comment> string </comment>
   <actions>
    <action>
     <function>string</function>
     <parameters>string</parameters>
     <action_threshold> string </action_threshold>
    </action>
   </actions>
  </proposition>
  ...
 </propositions>
</attribute>


Syntax of Rules

Apriori rules

<apriori_rule>
 <id> string </id>
 <priority> number </priority>
 <conclusions>
  <conclusion>
   <id_attribute> string </id_attribute>
   <id_proposition> string </id_proposition>
   <negation> binary </negation>
   <weight> number </weight>
  </conclusion>
  ...
 </conclusions>
 <actions>
  <action>
   <function> string </function>
   <parameters> string </parameters>
  </action>
 </actions>
 <comment> string </comment>
</apriori_rule>

logical and compositional rules

<logical_rule> / <compositional_rule>
 <id> string </id>
 <priority> number </priority>
 <id_context> string </id_context>
 <context_threshold> number </context_threshold>
 <condition_threshold> number </condition_threshold> <!--  only for logicl rules  -->
 <condition>
  <conjunction>
   <literal>
    <id_attribute> string </id_attribute>
    <id_proposition> string </id_proposition>
    <negation> binary </negation>
   </literal>
   ...
  </conjunction>
  ...
 </condition>
 <conclusions>
  <conclusion>
   <id_attribute> string </id_attribute>
   <id_proposition> string </id_proposition>
   <negation> binary </negation>
   <weight> number </weight>
  </conclusion>
  ...
 </conclusions>
 <actions>
  <action>
   <function> string </function>
   <parameters> string </parameters>
  </action>
 </actions>
 <comment> string </comment>
</logical_rule> / </compositional_rule>


Syntax of Contexts

<context>
 <id> string </id>
 <comment> string </comment>
 <condition>
  <conjunction>
   <literal>
    <id_attribute> string </id_attribute>
    <id_proposition> string </id_proposition>
    <negation> binary </negation>
   </literal>
   ...
  </conjunction>
  ...
 </condition>
</context>


Syntax of Integrity Restrictions

<integrity_constraint>
 <id> string </id>
 <name> string </name>
 <condition>
  <conjunction>
   <literal>
    <id_attribute> string </id_attribute>
    <id_proposition> string </id_proposition>
    <negation> binary </negation>
   </literal>
   ...
  </conjunction>
  ...
 </condition>
 <conclusions>
  <conclusion>
   <id_attribute> string </id_attribute>
   <id_proposition> string </id_proposition>
   <negation> binary </negation>
   <weight> number </weight>
  </conclusion>
  ...
 </conclusions>
 <comment> string </comment>
</integrity_constraint>


Inference mechanism

The inference in the system NEST is the combination of the backward and forward chaining. At the begining of a consultation, the system takes all goals, denotes them in sequence as „actual“ and try to evaluates them.

First, the „actual“ proposition is analysed with the backward chaining by following way:

  • the system check, if the proposition is evaluate already (the proposition has the status „final“). If it is, the evaluation`ll be terminated;
  • the system detects a source of the actual proposition. If the source isn`t „inference“, the evaluation`ll be interupted and the system start up the source. If the source isn`t explicited, „inference“ will be used;
  • the system finds all rules that have the actual proposition in a conclusion. If any rule like this doesn`t exist, the evaluation`ll be interupted and the system sends a question to an user. If all contributions of finded rules are known, the system`ll count the final weight of the proposition (by a function GLOB - see section „work with indeterminateness“), a status of the proposition`ll take the value „final“ and the evaluation of the actual proposition`ll be terminated. If anycontribution or rule that aren`t known exists the system`ll sort these rules by relevant priority (first, last, minimal length, maximal length, defined by expert), it`ll take the first rule and it`ll try to evaluate it by following way:
    • if the weight of the context isn`t known, the system will evaluat this weight (it`s the same procedure like the evaluation of a weight of condition that follows). If the weight of the context (a lower limit of the interval) is lower or equal than a condition threshold, the contribution of rule`ll be „IRRELEVANT“;
    • the system evaluates a condition of the rule. First, weights of all terms are counted (for propositions, their weights are token, for conjunctions, weights of their propositions are puted together by a function CONJ) and these weights are puted together by a function DISJ. If the weight of any proposition isn`t known (the proposition hasn`t the status „final“), the system will take this proposition as „actual“ and start the evaluation for it;
    • the weight of the context and the weight of the condition are puted together by a function CTR (if the rule has context) and this weight is puted together with the weight of each conclusion. This result is a contribution of the rule and a status of the rule takes a value „final“.

If the evaluation is interupted, the system`ll recognise attributs, from which is derived the evaluated proposition. A value of this attribute is taked from relevant source and the system counts weights of all propositions, which are derived from this attribute (its status take the value „final“). After it, this propositons are taked in a sequence and the forward chaining is started for them. Here is a procedure for the forward chaining:

  • the system find all rules that have the actual proposition in a condition;
  • this rule is evaluated by the same procedure that is used during the backward chaining, but if an interruption is called during the evaluation of some proposition, this interruption`ll be ignored and the evaluation of the rule`ll be terminated (the system doesn`t send a question to an user, nor use another sources).
  • if the rule is evaluated succesfully, the system`ll take propositions from conclusions of the rule. These propositiona are evaluated in first by the procedure of backward chaining (with ignoration of interruptions). If the evaluation is succesful, the procedure of forward chaining`ll be started for this proposition.

When the system goes over all propositions by the forward chaining, whole evaluation is started again.


Function NEG

Function NEG is used for the calculation of a negation of a proposition. It`s defined as following:

NEG(w) = -w

or for the work with interval [w1;w2]:

NEG([w1;w2]) = [-w2;-w1]


Function CONJ

Function CONJ is used for the calculation of a conjunction of two propositions. It`s defined as following:

CONJ(v,w) = min(v,w)

or for the work with intervals [v1,v2],[w1;w2]:

CONJ([v1;v2],[w1;w2]) = [min(v1,w1); min(v2,w2)]


Function DISJ

Function DISJ is used for the calculation of a disjunction of two forms. It`s defined as following:

DISJ(v,w) = max(v,w)

or for the work with intervals [v1,v2],[w1;w2]:

DISJ([v1;v2],[w1;w2]) = [max(v1,w1); max(v2,w2)]


Function CTR

Function CTR is used for the calculation of a contribution of a rule (or for put together a weight of context and a weight of condition). It`s defined as following:

  • standard, neuronal and hybrid type of undeterminateness:
    CTR(a,w) = 0       ; a ≤ 0
CTR(a,w) = a * w   ; a > 0
  • logical type of undeterminateness:
    CTR(a,w) = 0                              ; a < 0
CTR(a,w) = sign(w) * max(0,a + |w| - 1)   ; a ≥ 0

For the work with intervals [a1;a2],[w1,w2], it is used the expression
CTR([a1;a2],[w1,w2]) = [CTR(a1,w1);CTR(a2,w2)]


Function GLOB

Function GLOB is used fo put together more contributions of rules. It`s defined as following:

  • standard type of undeterminateness:
    GLOB(v,w) = 0                    ; (v = 1, w = -1) or (v = -1, w = 1)
GLOB(v,w) = (v + w)/(1 + v * w)  ; other
  • logical and hybrid type of undeterminateness:
    GLOB(w1...wn) = min(Σw>0w ,1)  +  max(Σw<0w,-1)
  • neuronal type of undeterminateness:
    GLOB(w1...wn) = min(max(sΣw, -1), 1)
     where s = 1

For the work with intervals [a1;a2],[w1,w2], it is used the expression
GLOB([a1;a2],[w1,w2]) = [GLOB(a1,w1);GLOB(a2,w2)]


Function NORM

This function is defined in the real numbers. It regulates intervals to the interval [-1;1]. It`s used after the calculation of compositional rule`s contributions with by funciton CTR and after the function GLOB during the calculation of a weight of proposition`s condition. It`s defined as following:

NORM(w) := min(max(w,-range), range)

or for the work with interval [w1;w2]:

NORM([w1;w2]) = [min(max(w1,-range), range); min(max(w2,-range), range)]

where range = 0.999 (or another count of „9“ depends on the number of decimal places)


Function IMP

Function IMP is used for the calculation of a final weight of integrity restriction that decides if the integrity restriction was breaked and how much. It`s defined as following:

IMP(w,v) = 0                  ; w <= 0
IMP(w,v) = max(0, min(w - v)) ; w > 0

or for the work with interval [w1;w2]:

IMP([w1;w2],[v1,v2]) = [max(0, w1 - v1); max(0, w2 - v2)]

where w is the weight of condition (that can be modified by a context by the function CTR) and v is the weight of conclusion.


Showing Options

Call system options from the initial screen by the main menu Options / Options ...

All changes which you do in the options will be seted up after you click on the button OK. If you click on the button Cancel, the changes will not be saved.


General Sheet

Onto this sheet, there are two options: the number of decimal points and the language.

The number of decimal points determines with how many decimal points will the system work. This will put forth as in the internal system work - rounding, displaying results, ... - as in external files.

Language of the system determines the language by which the system will comunicate with an user. There are two possibilities - english and czech. This language doesn`t influence the syntax of knowledge base that is always the same (based on english).


Directory Sheet

Onto this sheet, there are 4 input boxes, where several directories are entered. A setting of these directories isn`t inevitable for the work of the system, but it can simplify a work with the system.

Directory with file „base.dtd“ determines the directory, where this file is placed. This file is required when the system open the knowledge base and if this directory isn`t set, the file must be placed in the same directory as the file of knowledge base.

Directory with file „answers.dtd“ determines the directory, where this file is placed. The file „answers.dtd“ has an analogical function as the file „base.dtd“, but it`s required when the system open the answers saved in the previous consultation.

Directory with knowlage bases is the directory, where knowledge bases are placed. If this directory is set, the system will use it as the default directory along opening base and it speed up a finding of demanded knowlage base.

NEST Editor directory is the directory, where the file „NEST_Editor.exe“ is placed (it`s the program for creating of knowlage bases). If this directory is set, the NEST Editor could be started from initial screen by the main menu Tools - NEST Editor. The directory will be set automatically, when the Editor is started by another way.

All directories can be seted directly, or by clicking on the button next to the input box and selecting a directory in the dialog.


Colors Sheet

Onto this sheet, you can set up 3 colors of text that are used for results of consultations.

Basic color is used when there is no reason to use another one.

Color for Positiv results is used for all results that have theirs lower limit greater then 0.

Color for Negative results is used for all results that have theirs upper limit lower then 0.


Sources Sheet

Onto this sheet, there is only one choice: Maximal time of external function. It determines the time (in milliseconds) of waiting to the end of an external function that is used as a source of answer. If the function doesn`t finish in this time, the system`ll keep the waiting and go to the next source.

If the left checkbox isn`t checked, the system will wait forever (an user can stop it by clickint on the button „Cancel“).


Base Opening

For open a base, use the main menu Base / Open Base onto the initial screen or click on the button Open base. After the execution of a standard dialog the system tries to load the given base. If it`s succeded, the file name will be show next to the caption Actual base followed by a description of the base. If the base can`t be loaded, the system show a reason.

The system can load knowledge bases that are saved in a file based on the XML with the syntax of knowledge base. During the opening of a base, the system requires the file „base.dtd“. According to this file, the system makes a check of the syntax. The file has to be placed in the same directory as the opening base, or the „Directory with file base.dtd“ must be set into the system options. Without this file, the system coudn`t open any knowledge file.

If you open a knowledge base in the time, when some other base is loaded in the system, this old base is automatically closed. It comes to this, that only one base can be opened in the system.


Start Consultation

A consultation can be started in the situation, when some knowledge base is loaded in the system.

You start the consultation onto the initial screen by using the main menu Base / Consult or by clicking on the button Consult.

A screen with options of consultation will appear after the start of the consultation. For the simplest consultation, all choises are seted right and you can directly click on the button OK. We will learn about this options in the chapter more complicated consultations.

After the confirmation of this options, the system start to recognize weight of goals and it give to an user questions that are needed to calculate this goals.


Question

When the system during the evaluation of goals finds the attribute whose weight can`t be infer from another propositons, a question is sended to the user. There are 4 types of questions:

  • question to a binary attribute;
  • question to a single attribute;
  • question to a set attribute;
  • question to a numeric attribute.

Question to a binary attribute: the system put a question „what is the weight of binary attribute“ and it appends the name of the attribute and its description. User has to enter a weight of the attribute next to the capton Weight. The weight is a number from the interval that is explicit to the botton of the screen (this interval is constant for whole base). If the number recedes from the 0, the answer`ll recede from the value „irrelevant“ and it`ll near the value „certainly yes“ (if the number is positive) or to the value „certainly no“ (if the number is negative).

The seted weight has to be confirmed by pressing the key Enter or by clicking to the button Confirm answer.

An alternative way is to use some of predefined answer by clickning to the button on the right section of the screen. The answer Certainly yes replaces the maximal weight from the interval, the answer Certainly no replaces the minimal weigh, the answer Irrelevant replaces the weight 0. The answer Unknown can`t be replaced by one number and you must used this button. In effect, it replaces all weights from the interval.

The button Postpone the answer transfers the answering to this question to a later time. An usage of that will be explicite in the chapter more complicated consultation.

Question to a single attribute: the system put a question „what is the value and the weight of single attribute“ and it appends the name of the attribute and its description. An user has to choose an answer to the selection box and assign a weight to this answer by the same way as to the binary attribute.

Question to a set attribute: the system put a question „what are the values and weights of multiple attribute“ and it appends the name of the attribute and its description. An user has to choose values, to which he want to specify weights, and drag this value from the box Accepted values to the box Selected values. For each selected value, he must assign a weight by the analogous way as to the binary attribute. The assigned value is showed next to the value into the box with selected values. The weight can be assigned with the buttons with one exception - the button Unknown assigns this value to whole attribute (that is to all answers) and end the answering to this question.

Question to a numeric attribute: the system put a question „what is the value of the numeric attribute“ and it appends the name of the attribute and its description. An user has to enter a value of this attribute. The value is a number from the interval that is showed on the bottom of the screen. This interval is different for each numeric attribute.

Once the user answers the question, the system continues in evaluation of the goals. If the user don`t want to contiue in the consultation, he could finish it by closing the question with the cross in right top corner.


Consultation Results

Once the system gets all answers to the questions needed for evaluation of goals, final weights are counted and the results are showed. The results are placed in a grid, where following items are given for each proposition:

  • proposition`s name;
  • minimal weight of the proposition;
  • maximal weight of the proposition;
  • status of the proposition shows, in which status is the proposition after the evaluation. There are 4 status - untouched, partial, final and provisional. Untouched means that the proposition didn`t be used during the evaluation. Partial means that the system went into it during the evaluation but finally, the weight of that proposion didn`t have to be counted. Final means that the proposion was needed and the weight has the final value. Provisional means that an user postpone some question (more informations in the chapter more complicated consultation) and the weight of this proposition could changed after answering of the postpone questions;
  • type of the proposition show the kind of the proposition. The proposition can be a goal, an intermediate proposition or a question.

The results grid can be sorted according to any of these collums, only click to a header of the column. The grid is sorted by the minimal weight implicitly.

A description of the proposition (if exists) is displayed in a right upper text box after you select the proposition by clicking on it.

You can see only goals in the grid implicitly. If you want see all propositions, swich a controller Show to an item All propositions.

If some integrity constraint was broken during the evaluations, you could see it in a grid on the right side of the screen (analogous rule as on the grid with results apply on this grid). The break of the integrity constraint means that there was broken some logic in the knowlage base and in a comment of this integrity constrains, there should be some advance, what to do to don`t break it.

You close the screen with results by clicking on the button Close in the right bottom corner. The whole consultation is finished by this.

Results of the consultation can be exported to files or to the Excel application (if you have it). Use the button Exports results in the right bottom corner. After cliced on it, you see a dialog window, where you can set the description of the consultation and where you choose a file to export (text file, html file or Excel). If you want add comments of each propositions check the Export comments choose. After the confirmation of this dialog window, you choose a external file in a standard dialog (not for Excel) and the results are exported.


Control of Consultation

If you want use some more comlicated kind of consultation, you`ll have to set it before run of the consultation. After you start the consultation with the button Consult in the initial screen, you see the screen with Control of consultation, where you can set all choices.

In the top part of the screen, you can change the goals of consultation. The system autamatically choose propositions as the goals that aren`t in a conclusion of any rule. These propositions are displayed in the right column Selected propositions. If you want choose another proposition (for speeding the consultation for example), choose an attribute, from which is the proposition derived, in the left column Attributes and drag the proposition from the middle column Potencional propositions to the right column. You can select as goals only intermediate propositions.

If you want cancel selected goal, you`ll drag it from the right to the middle column.

In the middle of the screen, there are 4 choises: Urcentainty processing, priority of rules, default weight, Att. of type environment.

Uncertainty processing determines what type of uncertaity will the system use during the evaluation. You can find more informations about uncertainty types in the chapter „Work with indeterminateness“.

Priority of rules determines in which order the system will process the rules in the situation, when more rules can be process in one time. First means that the system takes the rule that is first in the knowlage base, Last means the contrary. Minimal length means that the system takes the rule that has a shorter condition, Maximal length means that the system takes the rule with longer condition. Defined by expert means that the system takes the rules according to the priorities that were set by expert (or a knowledge engineer) in the knowledge base. If the priorities aren`t defined, the system use the choise First.

Default weight determines the weight that is assigned to propositions that havn`t get the weight else (during the evaluation or from an user). For example when an user doesn`t assign the weight to propositions derived from a set attribute in a question, theses propostitions take the default weight. The default weight could be Unknown, i.e. [-1 ; 1] (modify to the weight range of the base), or Irrelevant, i.e. [0 ; 0].

Attributes of type environment indicates if environment attributes are cleared (theirs weights) or not. If they aren`t cleared, weights from previos consultation are used for them.

In the bottom of the screen, you can find the choises for Answering mode and Reasoning mode. Answering mode Dialog is the classic consultation, when the system put questions to an user to all attributes that are needed to evaluate goals. About mode Questionnaire and Load answer from file will discourse int the next chapter, as well as about Postpone question.


Questionnaire

The questionnaire is an alternative of the classic dialog. The system doesn`t put the question step by step, but it put to an user a list of all questions that are in the base and the user can answer to these ones that he know. After the confirmation of the questionnaire, the system deduces results that are possible from the answers, but it doesn`t put any more question also if it cann`t evaluate the goals.

The questionnaire composes two parts. In the left one, there is a list of all questions. After you select one (click on it by left mouse button), the question appears in the right part of the screen. This question is same as the question during the dialog. You can answer on it by the same way. After the confirmation of the answer (press Enter or click on the button Confirm answer, no to the button OK), the set value appears in the list next to the name of question. On the left side of the list, the sign „+“ appears there. It symbolise that you had answered to this question yet.

You can change the set value by the same way as if you set the weight first one. If you want cancel some answer, click on the sing „+“ next to the name of question in the list (the sign dissapears, if you click again, the sign appears de nouveau).

In the third column of the list, there is a letter symbolises the type of the question, let us say attribute: b - binary, s - single, m - set, n - numeric.

Use OK button for confirm the questionnaire. If you want cancel the questionare (and whole consultation), click on the cross on the top right corner of the screen.

The answering by questionnaire can be combinated with the classic dialog (choose Dialog witch questionnaire choise in the control of the consultation). First, the system show you the questionnaire and when you confirm it, it tryes to evaluat qoals. If it fails, it`ll start to put questions for evaluat all goals.


Postpone Question

If you check the choise Postpone answers in the control of consultation, you can postpone any question during the consultation. The postpone attribute takes the weight „unknown“ and it`s marked as provisional. All propositions that use this attribute (some of it`s propositions) takes the status provisional, too. If an user isn`t content with results at the end of the consultation, he can click on the button Retry in the bottom right corner and continue in the consultation. The system put him all postponed attributes again and the user can specify the weights. In this refreshed consultation the postpone isn`t allowed.


Change Answers

You can change answers after the end of consutations. On the screen with results click on the button Change answers. Modifications go on the questionnaire. After its confirmation, the system recounts the results and shows them in the screen of results.


Save and Load Answers

After the end of consultation, you can save your answers to a file for their futur use. Click on the button Save answers in the bottom right corner. You can add the a description of the consultation that are displayed after the load of the answers.

If you want load the answers from the file, chose the choise Load answers from file in the Control of consultation and set this file to the text box File. After the confirmation of the controls, the system try to load the answers and if it`s succeded, it`ll shows you the questionnaire, where you can modify the answers. Below the questionnaire, you can see a description of the consultation.

During the loading of answers, the file „answers.dtd“ must be in the same directory as the loaded file. The system checks a syntax of the answers according to this file. The file „answers.dtd“ can be in an other directory, but this directory must be specified in the system options.


Load the Answers from Another Sources

The system hasn`t to take all answers from an user, but it can take a weight of attribute from other sources, concretely from a file or from an external function.

If the system takes the weight from the external file, an user`ll not check it. If the system fails to read the weight (it read the weight from the first line of the file that must be the text type), it`ll use the next source (it`s ofen the question to the user).

During the taking weight from the external function the system calls the external program and waits to it`s end. The external program has to create (or modify) the file, from which the system read the weight (by the same way as with the external file). The evaluation is stoped during the running of the external function and waits to the result. If the function doesn`t finish to a set time (this time can be seted in the system options), the system`ll use next source. The waiting can be breaked by an user by pressing the button Cancel.

„User“ can be set as the source of proposition. In this situation, the system put a question to an user also in the case when the proposition can be deduced from another propositions. If the user answer by the weight „UNKNOWN“, the system`ll use next source.


Run Actions

The actions can be defined in the knowlage base. The action is an external program that is started by the system, but the system doesn`t care for it. The action can be started when a proposition is evaluate or when a rule is used. If the action is defined for the proposition, a threshold can be assigned to it and the action`ll be started only if a weight of the propositon overpass this threshold.


Showing Editor Options

Call editor options from the initial screen by main menu Options / Options ...

All changes that you do in the options will be set up after you click on the button OK. If you click on the button Cancel, the changes will not be saved.


General Sheet of Editor

Onto this sheet, there are two options: the language and the default charset.

Language of the system determines the language by which the system will comunicate with an user. There are two possibilities - english and czech. This language doesn`t influence a syntax of the knowledge base that is always the same (based on english).

The default charset determines the charset for save the knowledge base. This charset has to be identical as the charset that uses your operating system. (If you don`t know it, try to use „UTF-8“.)


Toolbars Sheet

Onto this sheet, you can set up the toolbars (the set of buttons on top of the main screen) that are visible. File buttons containts buttons for a work with files (create a new base, open existing base, save base), Checking buttons containts a button for check base and Windows buttons containts buttons for ordering windows into the main screen.


Directory Sheet of Editor

Onto this sheet, there are 4 input boxes, where are entered several directories. Setting of this directories isn`t inevitable for the work of the system, but it can simplify it. First 3 are the same for the NEST system and NEST Editor and the sense of them are explained in the system options.

Last of them is the NEST directory, where you can set the directory with the file „NEST.exe“ - file for running NEST. If this directory is set, the NEST could be running from the main screen with main menu Tools / NEST. This directory is automaticly set, when the NEST is started by another way.

All directories can be set directly or by dialog window (click to the button next to the edit box).


Creation of New Base

You create new knowledge base on the main screen by the main menu File / New. The editor creates new base with a name NONAME. At the same time, the window with global properties of the base is showed. You can close this window and return to it later, but I recommend to fill everythings you can immediately after the creation of the base.


Open the Existing Base

You open the knowlage base on the main screen by the main menu File / Open. After you choose a file in a standard dialog box, the editor try to open the base and show it in the base`s window on a desktop. If the editor can`t open the file, it`ll write a reason.

The editor can load the files that are based on the XML and that have a syntax of the knowledge base.

In the editor, more bases can be opened in the same time. Each base has it`s own window on the desktop.


Save the Base

You save the base on the main screen by the main menu File / Save. If the base has already the name (e.g. the file), it`ll be saved under this name. If you save the base first time, you`ll have to choose a file in a standard dialog window. The base`s file has the extension „xml“.

For save the base under another name (to another file), choose the command File / Save as and choose the new name in a standard dialog window.

The base is save to a file based on the XML that has a syntax of the knowledge base.


Export of the Base

Export of the base is an instrumental for saving the base to a file that is readable for a human. This file can`t be loaded back to the editor.

You can export the base to two formats. First is the text file (the command File / Export base / txt file), the second is the html file (the command File / Export base / html file).


Window of the base

The base`s window is opened after the creation of a new base or after the opening of an existing base. The name of the base (e.g. the file of the base) is showing to the top band of the window.

The window is dividet to 5 columns, where you can see classes of knowlade: attributes, propositions, rules, contexts, integrity constraints. In each collumn, there are two boxes. In the top one, there are a list of all items of the knowledge class. After the selection of one of them, you can see it`s description in the bottom box.

You can change the size of all columns and boxes by an arraw that appear when you move the cursor between two boxes. You can hide the columns by click to one of them with right button of the mouse and select the column.


Global Properties of the Base

Global properties of the base are the properties that are set for whole base. Here is the list of the global properties:

  • base description contents the breaf comment of the base. An user of the base see it after he open this base;
  • expert - name of the expert, from who the knowledges comes;
  • knowledge engineer - name of the person, who creates the base;
  • date of base creation;
  • weight range - an interval [-weight range; weight range], in which all weights are set and showed. In this interval set all weights during the base creation. If you change this interval, all weight in the base are recounted. It`s recomanded to set this interval imediatly after creation of new base;
  • Global context threshold determines the weight that a context has to obtain to come true (and to apply a rule that has this context). You can set the context threshold individualy for each rule, but if you don`t set it, the system`ll use this global threshold;
  • Global conditional threshold determines the weight that a logical rule (e.g. the minimal limit of the interval) has to obtain to come true. The conditional threshold can be set individualy for each rule, too;
  • Inference mechanism, default weight a global priority determines the default set of these choise that will be used if an user doesn`t choose another.


Show Edit of Attributes and Propositions

For show a window of edit attributes and propositions, use the main menu Edit / Attributes and propositions. The alternative is to double click with left mouse button on the list with attributes or propositions.


Insert New Attribute

New attribute can be inserted into the screen of attributes editing by the menu Action / new attribute or by click on the button New attribute next to a box with a list of attributes. In the folow dialog box, you must select a type of new attribute - binary, single, set or numeric. After pressing the button OK, the selected attribute`ll be inserted with the ID „New_attribute“ and it`ll be placed to the end of attributes list. This new attribute is selected so you can change it`s property directly.


Edit Attribute Properties

An attribute must be selected for changing it`s properties - click on it in the list of attributes by right mouse button into the screen of attributes editing (if the attribute not exists yet, you must first insert it). After selection of it, the properties are showed in the top right panel, where you can modify it.

ID express the identifier of the attribute. The identifier must be unique for whole knowledge base. If the attribute has the name, an user`ll not see this identifier. The identifier is obligatory.

Name determines the name that see the user for this attribute. It shall be unique, but the system doesn`t require this. If the name isn`t set, the system`ll show the identifier in its place.

Comment can more specify the attribute. This item isn`t obligatory.

Scope determines, if the attributes is environment or case.

Lower and upper limit is set only for the numeric attributes and determine the interval, in which the value of the attribute must be set. If these limits aren`t set, the value`ll be unlimited. (It`s possible to set only one limit.)

In this place, you can see the type of attribute (top right corner) and the number of actions and the number of sources for this attribute (botton right corner).


Delete Attribute

Attribute can be deleted into the screen of attributes editing by the menu Action / delete attribute or by click on the button Delete attribute next to the box with the list of attributes. The system clamout for a confirmation and after, it delete the attribute from the knowlade base. The attribute could be deleted only if it isn`t used in any rule (or context or integrity restriction).


Order of Attributes in the Base

The order of attributes in the base has some importance that influence an inference - during the evaluation of goals, the attributes writed down to the list high are evaluated first. Results of the consultation are not affected by this order.

If you want change the order of attributes otherwise if you want move an attribute up or down in the list of attributes, select this attribute and move it with buttons „^“ and „v“.


Insert new Propositions

New proposition can be inserted only to single, set and numeric attributes. There is only one proposition derived from the binary attribute and this proposition pick the ID, the name and the comment from the attribute. If you want insert new proposition, first you`ll have to select the attribute from which the proposition is derived.

Choose the command in the menu Action / New proposition or click to the button New proposition next to the list of propositions. New proposition is automatically selected and you can modify it`s properties.


Editing Propositions

If you want change properties of a proposition, you`ll have to select this proposition first - click to it by left mouse button in the list of propositions in the screen of editation of attributes and propositions (If the proposition doesn`t exist yet, you`ll insert it first) and simultaneously, the attribute from which the proposition is derived has to be selected. After the proposition is selected, you can see and modify it`s properties to the right bottom panel. (The properties of binary propositions can`t be modified becouse this proposition pick all properties from the attribute.)

ID is the identifier of the proposition. It has to be unique in terms of the attribute, but it can be identical as the proposition derived from another attribute. An user`ll not see this identifier if the name of the proposition is set. The identifier is obligatory.

Name determines the name that see an user for this proposition. If the name isn`t set, the system`ll show the identifier in its place.

Comment can more specify the proposition. This item isn`t obligatory.

Limits of fuzzy interval (fuzzy lower, crisp lower, crisp upper, fuzzy upper) can be set only for the numeric proposition. These limits determine the shape of a fuzzy interval for converting a value of the attribute to the weight of the proposition.

In this place, you can see the number of actions for this proposition (botton right corner).


Delete Proposition

The proposition can be deleted in the screen of editation of attributes and propositions. First you must select the propositon (click to it in the list of propositions by left mouse button) and then choose the command in the menu Action / Delete proposition or click to the button Delete attribute next to the list. The system clamout for a confirmation and after, it deletes the proposition from the knowlade base. The proposition could be deleted only if it isn`t used in any rule (or context or integrity restrictions).


Order of Proposition in the Base

The sense of the order of propositions in the base is the same as the sense of the order of attributes. You can change the order by selecting a proposition and click to the button „^“ or „v“ for move it up or down.


Edit Actions

Actions can be added to attributes and to propositions. The proposition receives all actions from the attribute from which is derived (e.g. the actions of the attribute are assigned to all propositions derived from it).

For editing the actions, click to the buttons Change below the label Number of actions. You`ll see the screen for editing actions.

You add a new action by click to the button Add action, the selected action can be removed by the button Remove action. You can change the properties of the selected action to the right panel:

  • Exe file determines the executable file for the action. You can choose it with a standard dialog window after you click to the button ....
  • Parameters for execute the program are appended to the exe file when action is started.
  • Action threshold determines the weight that has to be overpass by the minimal limit of the proposition weight for start the action. If the threshold isn`t set, the system replace it by 0.


Edit Sources

For edit sources click to the button Change under the label Number of sources in the panel of attribute`s properties. You`ll see a screen for editing sources.

You can define more sources for each attribute. The next source`ll be used if the first one fails (for example the file of source doesn`t exist). You add new source by the button Add source, you remove the selected source by the button Delete source. The properties of the source can be modified on the right panel:

  • Type determines the kind of the source - inference, user (question to an user), file (load the value from a file), function (start an external function and read the value from a file after end of this function).
  • File (for two last type of source) determines the file from which the value is read. The value is read from first line of the (text) file.
  • Exe file (for last type of source) determines the file of function that will be started.
  • Parameters (for last type of source) are appended to the exe file when the function is started.


Show the Editiong of Rules

You start the editing of rules in the main menu by Edit / Rules or by double click to the list of rules.


Insert New Rules

New rule can be inserted in the screen of rules editing by clicking on the button New rule in the right botton corner. In a following dialog window, you must select a type of the rule - apriori, logical or compositional. After confirmation of the dialog, the new rule`ll be added to the end of the list with the ID „New_rule“. The new rule is selected so you can modify it`s properties.


Modify the Rule`s Properties

For modify rule`s properties, this rule must be selected - click on it by left mouse button in the list of rules in the screen of rules editing (if the rule doesn`t exist yet, you`ll insert it first). After the rule is selected, you can see it`s properties to the right panels, where you can modify them.

The properties are devided to the 3 panels. Over this panels, you can see the text box, where is the rule written in one string (this string is in the list of rules after the identifier, too). In the left upper panel, there is the condition of the rule ( the apriori rule hasn`t the condition), in the lower panel, there is the conclusion of the rule and in the right upper panel, there are the general properties of the rule.

Condition of the rule has a disjunctive normal form. It comes to this, that it`s composed from a disjunction of propositions or conjunctions of propositions. If you want add a new proposition to the condition, select it in the unrolling box and click to the button with an arraw under the box or drag it to the word Condition. The conjunction can be added by click to the button &. The proposition can be added to the conjunction by the same way as to the disjunction (to the condition), only first select the conjunction. If you want add a negation of the proposition, select the proposition after it`s added and check the box Negation.

For the logical rules, you can set in addition the condition threshold. This threshold determines the weight that must be overpass by a weight of condition (minimal limit of the interval) for the condition comes true. If the threshold isn`t set, it`ll be used the global condition threshold set in the global properties of knowledge base.

The conclusion of the rule contents one or more propositions. You add the proposition as the conclusion by selected it in the list of potential conclusions and click to the button with right arrow (or drag it to the list of Selected conclusions). To remove the proposition from the conclusions, use the analogous way. If you want a negation of proposition in the conclusion, select this proposition in the right column and check the box Negation.

For the compositional and apriori rules, you have to set in addition a weight of each conclusion (this weight represent the reliability of the rule). You can set this weight negative, but the result is the same as the positive weight with negation.

General properties of the rule
ID is an identifier of the rule. It must be unique in the base and it`s obligatory.

Priority is a number between 0 and 1. The higher number, the sooner use of the rule if the system select from more rules. If the priority isn`t set, the system use the value -1.

Comment can more specify the rule. It is only for the creator of the base, becouse an user doesn`t see this comment.

Context (for compositional and logical rule) contents an identifier of the context that is assigned to the rule. You select the context from a list of context (the unrolling box), so you must first create the context. You can set the context threshold that determines a weight that must be overpassed by the weight of context for the rule`ll be used. If the threshold isn`t set, the system`ll use the global context threshold from the global properties of the base.

The number of action shows, how many actions are assigned to the rule.


Delete Rule

You can delete the rule in the screen of editing rules. First, you must select the rule (click on it by left mouse button in the list of order), then click to the button Delete rule in right bottom corner. The system clamout for a confirmation and after, it deletes the rule from the knowlade base.


Order of the Rules in the Base

The order of rules in the base has some importance that influence an inference - if the system can use more rules, it`ll use the rule that is first (if the priority is First) or last (if the priority is Last) in the list of rules. The results of the consultation are not affected by this order.

If you want change the order of rules otherwise if you want move the rule up or down in the list of rules, select this rule and move it with buttons „^“ and „v“.


Edit the Actions of the Rule

You can edit actions of the rules by the analogous way as the actions of the attributes, only a threshold of the action isn`t set - the action is started always when it`s used the rule.


Edit of the Contexts

For the work with contexts (insert, delete, edit, ...), use the analogous ways as for the work with rule - but the contexts havn`t conclusions.


Edit of the Integrity Restrictions

For the work with integrity restrictions (insert, delete, edit, ...), use the analogous ways as for the work with rule.


Check of Base

For chack of base, use the command of main menu Checking / Check base.

The check of base contents:

  • Check of ID - search of identical ID in the base (except propositions).
  • Check the cycles - search cycles in the rules.
  • Check the question - search the proposition derived from one attribute, when one proposition is used as question and the second as intermediate proposition.


Edit of Attributes and Propositions

Show Edit of Attributes and Propositions

For show a window of edit attributes and propositions, use the main menu Edit / Attributes and propositions. The alternative is to double click with left mouse button on the list with attributes or propositions.

Insert New Attribute

New attribute can be inserted into the screen of attributes editing by the menu Action / new attribute or by click on the button New attribute next to a box with a list of attributes. In the folow dialog box, you must select a type of new attribute - binary, single, set or numeric. After pressing the button OK, the selected attribute`ll be inserted with the ID „New_attribute“ and it`ll be placed to the end of attributes list. This new attribute is selected so you can change it`s property directly.

Edit Attribute Properties

An attribute must be selected for changing it`s properties - click on it in the list of attributes by right mouse button into the screen of attributes editing (if the attribute not exists yet, you must first insert it). After selection of it, the properties are showed in the top right panel, where you can modify it.

ID express the identifier of the attribute. The identifier must be unique for whole knowledge base. If the attribute has the name, an user`ll not see this identifier. The identifier is obligatory.

Name determines the name that see the user for this attribute. It shall be unique, but the system doesn`t require this. If the name isn`t set, the system`ll show the identifier in its place.

Comment can more specify the attribute. This item isn`t obligatory.

Scope determines, if the attributes is environment or case.

Lower and upper limit is set only for the numeric attributes and determine the interval, in which the value of the attribute must be set. If these limits aren`t set, the value`ll be unlimited. (It`s possible to set only one limit.)

In this place, you can see the type of attribute (top right corner) and the number of actions and the number of sources for this attribute (botton right corner).

Delete Attribute

Attribute can be deleted into the screen of attributes editing by the menu Action / delete attribute or by click on the button Delete attribute next to the box with the list of attributes. The system clamout for a confirmation and after, it delete the attribute from the knowlade base. The attribute could be deleted only if it isn`t used in any rule (or context or integrity restriction).

Order of Attributes in the Base

The order of attributes in the base has some importance that influence an inference - during the evaluation of goals, the attributes writed down to the list high are evaluated first. Results of the consultation are not affected by this order.

If you want change the order of attributes otherwise if you want move an attribute up or down in the list of attributes, select this attribute and move it with buttons „^“ and „v“.

Insert new Propositions

New proposition can be inserted only to single, set and numeric attributes. There is only one proposition derived from the binary attribute and this proposition pick the ID, the name and the comment from the attribute. If you want insert new proposition, first you`ll have to select the attribute from which the proposition is derived.

Choose the command in the menu Action / New proposition or click to the button New proposition next to the list of propositions. New proposition is automatically selected and you can modify it`s properties.

Editing Propositions

If you want change properties of a proposition, you`ll have to select this proposition first - click to it by left mouse button in the list of propositions in the screen of editation of attributes and propositions (If the proposition doesn`t exist yet, you`ll insert it first) and simultaneously, the attribute from which the proposition is derived has to be selected. After the proposition is selected, you can see and modify it`s properties to the right bottom panel. (The properties of binary propositions can`t be modified becouse this proposition pick all properties from the attribute.)

ID is the identifier of the proposition. It has to be unique in terms of the attribute, but it can be identical as the proposition derived from another attribute. An user`ll not see this identifier if the name of the proposition is set. The identifier is obligatory.

Name determines the name that see an user for this proposition. If the name isn`t set, the system`ll show the identifier in its place.

Comment can more specify the proposition. This item isn`t obligatory.

Limits of fuzzy interval (fuzzy lower, crisp lower, crisp upper, fuzzy upper) can be set only for the numeric proposition. These limits determine the shape of a fuzzy interval for converting a value of the attribute to the weight of the proposition.

In this place, you can see the number of actions for this proposition (botton right corner).

Delete Proposition

The proposition can be deleted in the screen of editation of attributes and propositions. First you must select the propositon (click to it in the list of propositions by left mouse button) and then choose the command in the menu Action / Delete proposition or click to the button Delete attribute next to the list. The system clamout for a confirmation and after, it deletes the proposition from the knowlade base. The proposition could be deleted only if it isn`t used in any rule (or context or integrity restrictions).

Order of Proposition in the Base

The sense of the order of propositions in the base is the same as the sense of the order of attributes. You can change the order by selecting a proposition and click to the button „^“ or „v“ for move it up or down.

Edit Actions

Actions can be added to attributes and to propositions. The proposition receives all actions from the attribute from which is derived (e.g. the actions of the attribute are assigned to all propositions derived from it).

For editing the actions, click to the buttons Change below the label Number of actions. You`ll see the screen for editing actions.

You add a new action by click to the button Add action, the selected action can be removed by the button Remove action. You can change the properties of the selected action to the right panel:

  • Exe file determines the executable file for the action. You can choose it with a standard dialog window after you click to the button ....
  • Parameters for execute the program are appended to the exe file when action is started.
  • Action threshold determines the weight that has to be overpass by the minimal limit of the proposition weight for start the action. If the threshold isn`t set, the system replace it by 0.

Edit Sources

For edit sources click to the button Change under the label Number of sources in the panel of attribute`s properties. You`ll see a screen for editing sources.

You can define more sources for each attribute. The next source`ll be used if the first one fails (for example the file of source doesn`t exist). You add new source by the button Add source, you remove the selected source by the button Delete source. The properties of the source can be modified on the right panel:

  • Type determines the kind of the source - inference, user (question to an user), file (load the value from a file), function (start an external function and read the value from a file after end of this function).
  • File (for two last type of source) determines the file from which the value is read. The value is read from first line of the (text) file.
  • Exe file (for last type of source) determines the file of function that will be started.
  • Parameters (for last type of source) are appended to the exe file when the function is started.


Edit Rules

Show the Editiong of Rules

You start the editing of rules in the main menu by Edit / Rules or by double click to the list of rules.

Insert New Rules

New rule can be inserted in the screen of rules editing by clicking on the button New rule in the right botton corner. In a following dialog window, you must select a type of the rule - apriori, logical or compositional. After confirmation of the dialog, the new rule`ll be added to the end of the list with the ID „New_rule“. The new rule is selected so you can modify it`s properties.

Modify the Rule`s Properties

For modify rule`s properties, this rule must be selected - click on it by left mouse button in the list of rules in the screen of rules editing (if the rule doesn`t exist yet, you`ll insert it first). After the rule is selected, you can see it`s properties to the right panels, where you can modify them.

The properties are devided to the 3 panels. Over this panels, you can see the text box, where is the rule written in one string (this string is in the list of rules after the identifier, too). In the left upper panel, there is the condition of the rule ( the apriori rule hasn`t the condition), in the lower panel, there is the conclusion of the rule and in the right upper panel, there are the general properties of the rule.

Condition of the rule has a disjunctive normal form. It comes to this, that it`s composed from a disjunction of propositions or conjunctions of propositions. If you want add a new proposition to the condition, select it in the unrolling box and click to the button with an arraw under the box or drag it to the word Condition. The conjunction can be added by click to the button &. The proposition can be added to the conjunction by the same way as to the disjunction (to the condition), only first select the conjunction. If you want add a negation of the proposition, select the proposition after it`s added and check the box Negation.

For the logical rules, you can set in addition the condition threshold. This threshold determines the weight that must be overpass by a weight of condition (minimal limit of the interval) for the condition comes true. If the threshold isn`t set, it`ll be used the global condition threshold set in the global properties of knowledge base.

The conclusion of the rule contents one or more propositions. You add the proposition as the conclusion by selected it in the list of potential conclusions and click to the button with right arrow (or drag it to the list of Selected conclusions). To remove the proposition from the conclusions, use the analogous way. If you want a negation of proposition in the conclusion, select this proposition in the right column and check the box Negation.

For the compositional and apriori rules, you have to set in addition a weight of each conclusion (this weight represent the reliability of the rule). You can set this weight negative, but the result is the same as the positive weight with negation.

General properties of the rule
ID is an identifier of the rule. It must be unique in the base and it`s obligatory.

Priority is a number between 0 and 1. The higher number, the sooner use of the rule if the system select from more rules. If the priority isn`t set, the system use the value -1.

Comment can more specify the rule. It is only for the creator of the base, becouse an user doesn`t see this comment.

Context (for compositional and logical rule) contents an identifier of the context that is assigned to the rule. You select the context from a list of context (the unrolling box), so you must first create the context. You can set the context threshold that determines a weight that must be overpassed by the weight of context for the rule`ll be used. If the threshold isn`t set, the system`ll use the global context threshold from the global properties of the base.

The number of action shows, how many actions are assigned to the rule.

Delete Rule

You can delete the rule in the screen of editing rules. First, you must select the rule (click on it by left mouse button in the list of order), then click to the button Delete rule in right bottom corner. The system clamout for a confirmation and after, it deletes the rule from the knowlade base.

Order of the Rules in the Base

The order of rules in the base has some importance that influence an inference - if the system can use more rules, it`ll use the rule that is first (if the priority is First) or last (if the priority is Last) in the list of rules. The results of the consultation are not affected by this order.

If you want change the order of rules otherwise if you want move the rule up or down in the list of rules, select this rule and move it with buttons „^“ and „v“.

Edit the Actions of the Rule

You can edit actions of the rules by the analogous way as the actions of the attributes, only a threshold of the action isn`t set - the action is started always when it`s used the rule.


Editor Options

Showing Editor Options

Call editor options from the initial screen by main menu Options / Options ...

All changes that you do in the options will be set up after you click on the button OK. If you click on the button Cancel, the changes will not be saved.

General Sheet of Editor

Onto this sheet, there are two options: the language and the default charset.

Language of the system determines the language by which the system will comunicate with an user. There are two possibilities - english and czech. This language doesn`t influence a syntax of the knowledge base that is always the same (based on english).

The default charset determines the charset for save the knowledge base. This charset has to be identical as the charset that uses your operating system. (If you don`t know it, try to use „UTF-8“.)

Toolbars Sheet

Onto this sheet, you can set up the toolbars (the set of buttons on top of the main screen) that are visible. File buttons containts buttons for a work with files (create a new base, open existing base, save base), Checking buttons containts a button for check base and Windows buttons containts buttons for ordering windows into the main screen.

Directory Sheet of Editor

Onto this sheet, there are 4 input boxes, where are entered several directories. Setting of this directories isn`t inevitable for the work of the system, but it can simplify it. First 3 are the same for the NEST system and NEST Editor and the sense of them are explained in the system options.

Last of them is the NEST directory, where you can set the directory with the file „NEST.exe“ - file for running NEST. If this directory is set, the NEST could be running from the main screen with main menu Tools / NEST. This directory is automaticly set, when the NEST is started by another way.

All directories can be set directly or by dialog window (click to the button next to the edit box).


Knowledge Base

Elements of Knowledge Base

Knowledge base containts 5 „classes of knowlage“, which were described above (attributes, propositions, rules, contexts, integrity restrictions), and following global properties:

  • base description;
  • name of the expert, who affords knowledges to the base;
  • name of the knowledge engineer, who creates the base;
  • date of the creation;
  • weight range;
  • global context threshold;
  • global condition threshold;
  • implicit inference mechanism;
  • default weight of propositions;
  • global priority.

Knowledge base is stored in the file, which has the syntax based onto XML.

Basic Syntax of Base

 <base>
  <global>
  ...
  </global>
  <attributes>
  ...
  </attributes>
  <contexts>
  ...
  </contexts>
  <rules>
   <apriori_rules>
   ...
   </apriori_rules>
   <logical_rules>
   ...
   </logical_rules>
   <compositional_rules>
   ...
   </compositional_rules>
  </rules>
  <integrity_constraints>
  ...
  </integrity_constraints>
</base>

Syntax of Global Property

<global>
 <description> string </description> <!-- base -->
 <expert> string </expert> <!-- name of expert -->
 <knowledge_engineer> string </knowledge_engineer> <!-- name of knowledge engineer -->
 <date> date </date> <!-- date of creation -->
 <inference_mechanism>standard | logical | neural | hybrid</inference_mechanism> <!-- inference mechanism -->
 <weight_range> number </weight_range> <!-- weight range -->
 <default_weight>unknown | irrelevant</default_weight><!-- implicit weight of proposition -->
 <global_priority>first | last | minlength | maxlength | type | user</global_priority>
 <context_global_threshold> number </context_global_threshold>
 <condition_global_threshold> number </condition_global_threshold>
</global>

Syntax of Attributes

<attribute>
 <id> string </id>
 <name> string </name>
 <type>binary | single | multiple | numeric</type>
 <scope>case | environment</scope>
 <sources>
  <source>
   <source_type>infer | user | external_file | external_function</source_type>
   <source_file> string </source_file>
   <function> string </function>
   <parameters> string </parameters>
  </source>
  ...
 </sources>
 <comment> string </comment>
 <actions>
  <action>
   <function> string </function>
   <parameters> string </parameters>
   <action_threshold> string </action_threshold>
  </action>
 </actions>

 <propositions><!-- not for binary attributes -->
  <proposition>
   <id> string </id>
   <name> string </name>
   <weight_function><!-- only for numeric attributes -->
    <fuzzy_lower_bound> number </fuzzy_lower_bound>
    <crisp_lower_bound> number </crisp_lower_bound>
    <crisp_upper_bound> number </crisp_upper_bound>
    <fuzzy_upper_bound> number </fuzzy_upper_bound>
   </weight_function>
   <comment> string </comment>
   <actions>
    <action>
     <function>string</function>
     <parameters>string</parameters>
     <action_threshold> string </action_threshold>
    </action>
   </actions>
  </proposition>
  ...
 </propositions>
</attribute>

Syntax of Rules

Apriori rules

<apriori_rule>
 <id> string </id>
 <priority> number </priority>
 <conclusions>
  <conclusion>
   <id_attribute> string </id_attribute>
   <id_proposition> string </id_proposition>
   <negation> binary </negation>
   <weight> number </weight>
  </conclusion>
  ...
 </conclusions>
 <actions>
  <action>
   <function> string </function>
   <parameters> string </parameters>
  </action>
 </actions>
 <comment> string </comment>
</apriori_rule>

logical and compositional rules

<logical_rule> / <compositional_rule>
 <id> string </id>
 <priority> number </priority>
 <id_context> string </id_context>
 <context_threshold> number </context_threshold>
 <condition_threshold> number </condition_threshold> <!--  only for logicl rules  -->
 <condition>
  <conjunction>
   <literal>
    <id_attribute> string </id_attribute>
    <id_proposition> string </id_proposition>
    <negation> binary </negation>
   </literal>
   ...
  </conjunction>
  ...
 </condition>
 <conclusions>
  <conclusion>
   <id_attribute> string </id_attribute>
   <id_proposition> string </id_proposition>
   <negation> binary </negation>
   <weight> number </weight>
  </conclusion>
  ...
 </conclusions>
 <actions>
  <action>
   <function> string </function>
   <parameters> string </parameters>
  </action>
 </actions>
 <comment> string </comment>
</logical_rule> / </compositional_rule>

Syntax of Contexts

<context>
 <id> string </id>
 <comment> string </comment>
 <condition>
  <conjunction>
   <literal>
    <id_attribute> string </id_attribute>
    <id_proposition> string </id_proposition>
    <negation> binary </negation>
   </literal>
   ...
  </conjunction>
  ...
 </condition>
</context>

Syntax of Integrity Restrictions

<integrity_constraint>
 <id> string </id>
 <name> string </name>
 <condition>
  <conjunction>
   <literal>
    <id_attribute> string </id_attribute>
    <id_proposition> string </id_proposition>
    <negation> binary </negation>
   </literal>
   ...
  </conjunction>
  ...
 </condition>
 <conclusions>
  <conclusion>
   <id_attribute> string </id_attribute>
   <id_proposition> string </id_proposition>
   <negation> binary </negation>
   <weight> number </weight>
  </conclusion>
  ...
 </conclusions>
 <comment> string </comment>
</integrity_constraint>


Knowledge Representation

Introduction

Knowledges into the NEST are represented by the way of:

  • attributes and propositions derived from attributes;
  • rules;
  • contexts;
  • integrity restrictions.
Each of this „knowledge class“ are described in one of following section. All this classes are storaged in the knowledge base, which is described in the last section of this chapter.

Attributes and Propositions

Attribute is some thesis with which the system can operate. There are 4 types of attributes:

  • binary;
  • single;
  • multiple;
  • numeric.

Binary attributes are the basic type of attributes. Just one proposition is derived from this attribute and this proposition has the same name. This proposition (and the relevant attribute) takes a weight, which represented its „verity“ (if the weight is maximal, the proposition`ll be certainly valid, if the weight is minimal, the proposition`ll be certainly invalid). The weight is represented by an interval. With this interval, it is possible to express partial knowledge about the proposition`s verity.

For example, if we worked into the weight range [-1;1] (this weight range will be used in all following example) the following weight have these sense:

  • [-1;-1] - proposition is certainly invalid (FALSE);
  • [ 1; 1] - proposition is certainly valid (TRUE);
  • [-1; 1] - we know nothing about proposition (UNKNOWN);
  • [ 0; 0] - proposition is irrelevant (IRRELEVANT).

Single attributes are attributes, which take one value from the list of values. The typical example is „type of account“ in a bank. From this attribute, there are derived as much propositions as the count of values in the list (propositions are the same as the binary propositions). When the attribute takes some value (with the weight), one relevant proposition takes this weight and all others propositions take the weight „FALSE“.

For example, if it`s set that user opened a current account with the weight [0,6;0,6], all others types of accounts`ll take the weight „FALSE“.

Multiple attributes are like „single attributes“ but they can take more values from the list of values. The example can be the attribute „speaking languages of person“. From this attribute, there are derived as much propositions as the count of values in the list. When the attribute takes some value (with the weight), relevant propositions take relevant weight and others propositions take the weight, witch was preconfigured (UNKNOWN or IRRELEVNT).

Numeric attributes are attributes, which take numeric value from preconfigured range. The example can be „salary size“. An unlimited number of propositions can be derived from this attribute. Each proposition has set the weight function, which convert the number value to the weight.

The weight function is set by a fuzzy interval. This interval is identified by 4 numbers (fuzzy lower, crisp lower, crisp upper, fuzzy upper). If the number value is outside „fuzzy“ limits, the resulting weight`ll be „FALSE“, if the number value is inside „crisp“ limits, the resulting weight`ll be „TRUE“. If the numeric value is between „fuzzy“ and „crisp“ limits, the resulting weight`ll be counted with the linear function (the upper and lower number of weight interval are same). This calculation is illustrated into the following picture (the fuzzy interval: [10, 20, 40, 40]):

Propositions are divided to questions (proposition isn`t in conclusion of any rule), intermediate propositions (proposition is in a conclusion and in a condition of some rule), and goals (proposition isn`t in a condition of any rule) accordint to the positions of the propositions. If the proposition is a question, all others propositions derived from the same attribute`ll have to be the questions too. The proposition that is neither in condition nor in conclusion of any rule, is so-called solitary proposition. It`s ignored by NEST.

Attributes are divided to „environment“ and „case“ attributes according to the scope. Environment attributes have some relation to environment, to business, to affair, to thing, which change rare and it`s not needful to recognise them over again. The system transfers their values from one consultation to the others (if the user doesn`t stop it). Average rate of interest is the typical example. Case attributes are all the others attributes, i. e. attributes asked by system during each consultation.

The value of an attribute can be obtained from different sources. If the attribute is a goal or an intermediate attribute, the implicit source is the „inference“ (by the medium of rules). If the attribute is question, the implicit source is „question to user“. Another source is a „file“ - the system try to interpret the first line of a given file. Last source is an „external function“, which create the file with value. This sources can be set up so that if one source fail, the other will take it`s place. Last two expliced source can be used only with binary and numeric attributes.

Action is external programme, that is assigned to some proposition. If this proposition obtains at least the weight, that is set in the action, the external programme will be executed. If the action is assigned to the attribute, the result will be same as if this action was assigned to all propositions derived from this attribute.

Rules

The basic form of rule in NEST is following:
context: IF condition THEN conclusion 1[weight 1],..., conclusion n[weight n]

Context decides if the rule will be used or not. More information about contexts are in the next section

Condition is represented by a disjunction of any „term“, where „term“ can be either a proposition or a conjunction of propositions. If the condition cames true, the conclusion`ll obtain relevant contributory value. The condition cames true when it`s value overpass the threshold of the condition (0 for the compositional rules, for logical rules a weight set by a knowledge engineer). More information about this mechanism is in section „work with indeterminateness“.

Conclusion is represented by the proposition and the weight, which serves for count the weight of proposition. The rule can have more conclusion, but this situation is the same as there are more rules with identical condition.

Every rule may have set a priority (number from an interval [0;1]), by which rules are selected during the inference. (More information is in the section „Inference mechanism“.)

Action can be assigned to the rules, too. This action is executed when the system use this rule, e. g. when the condition of rules comes true.

Rules are divided to 3 basic types:

  • apriori rules;
  • logical rules;
  • compositional rules.

Apriori rules are that rules, that are always active, e.g. they haven`t condition (nor context), let us say the condition is the value „TRUE“. These rules represent „general trues“.

Logical rules have the conclusion, that don`t take values from all interval [-1;1], but only the „logical values“. If the condition comes true (e.g. lower limit of weight interval overpass the threshold for this rule), the conclusion will take „TRUE“ or „FALSE“, if the condition doesn`t come true, the condition will take „IRRELEVANT“.

Compositional rules work to whole interval [-1;1] how it`s explained in the section „work with indeterminateness“.

Contexts

Context decide if the rule, to which is context assigned, will be used or not. Context has it`s threshold for each rules (if the threshold isn`t defined, system`ll take the global threshold) and the rule is used, when the weight of context (the upper limit of the weight interval) overpass this threshold.

Context is represented (as the condition of rule) by disjunction of any „term“, where „term“ can be either a proposition or a conjunction of propositions.

Integrity constraints

Integrity constraints have the same form as compositional rules. The different between them is, that integrity constraints doesn`t participate to the inference of goals, but they are evaluated separately after the inference. They have the function of verification, whether the goals fulfil the other requirements. If the integrity constraint comes true, the system makes nothing. But if the integrity constraint come false, user`ll receive notice that this constraint was broken.


More Complicated Consultation

Control of Consultation

If you want use some more comlicated kind of consultation, you`ll have to set it before run of the consultation. After you start the consultation with the button Consult in the initial screen, you see the screen with Control of consultation, where you can set all choices.

In the top part of the screen, you can change the goals of consultation. The system autamatically choose propositions as the goals that aren`t in a conclusion of any rule. These propositions are displayed in the right column Selected propositions. If you want choose another proposition (for speeding the consultation for example), choose an attribute, from which is the proposition derived, in the left column Attributes and drag the proposition from the middle column Potencional propositions to the right column. You can select as goals only intermediate propositions.

If you want cancel selected goal, you`ll drag it from the right to the middle column.

In the middle of the screen, there are 4 choises: Urcentainty processing, priority of rules, default weight, Att. of type environment.

Uncertainty processing determines what type of uncertaity will the system use during the evaluation. You can find more informations about uncertainty types in the chapter „Work with indeterminateness“.

Priority of rules determines in which order the system will process the rules in the situation, when more rules can be process in one time. First means that the system takes the rule that is first in the knowlage base, Last means the contrary. Minimal length means that the system takes the rule that has a shorter condition, Maximal length means that the system takes the rule with longer condition. Defined by expert means that the system takes the rules according to the priorities that were set by expert (or a knowledge engineer) in the knowledge base. If the priorities aren`t defined, the system use the choise First.

Default weight determines the weight that is assigned to propositions that havn`t get the weight else (during the evaluation or from an user). For example when an user doesn`t assign the weight to propositions derived from a set attribute in a question, theses propostitions take the default weight. The default weight could be Unknown, i.e. [-1 ; 1] (modify to the weight range of the base), or Irrelevant, i.e. [0 ; 0].

Attributes of type environment indicates if environment attributes are cleared (theirs weights) or not. If they aren`t cleared, weights from previos consultation are used for them.

In the bottom of the screen, you can find the choises for Answering mode and Reasoning mode. Answering mode Dialog is the classic consultation, when the system put questions to an user to all attributes that are needed to evaluate goals. About mode Questionnaire and Load answer from file will discourse int the next chapter, as well as about Postpone question.

Questionnaire

The questionnaire is an alternative of the classic dialog. The system doesn`t put the question step by step, but it put to an user a list of all questions that are in the base and the user can answer to these ones that he know. After the confirmation of the questionnaire, the system deduces results that are possible from the answers, but it doesn`t put any more question also if it cann`t evaluate the goals.

The questionnaire composes two parts. In the left one, there is a list of all questions. After you select one (click on it by left mouse button), the question appears in the right part of the screen. This question is same as the question during the dialog. You can answer on it by the same way. After the confirmation of the answer (press Enter or click on the button Confirm answer, no to the button OK), the set value appears in the list next to the name of question. On the left side of the list, the sign „+“ appears there. It symbolise that you had answered to this question yet.

You can change the set value by the same way as if you set the weight first one. If you want cancel some answer, click on the sing „+“ next to the name of question in the list (the sign dissapears, if you click again, the sign appears de nouveau).

In the third column of the list, there is a letter symbolises the type of the question, let us say attribute: b - binary, s - single, m - set, n - numeric.

Use OK button for confirm the questionnaire. If you want cancel the questionare (and whole consultation), click on the cross on the top right corner of the screen.

The answering by questionnaire can be combinated with the classic dialog (choose Dialog witch questionnaire choise in the control of the consultation). First, the system show you the questionnaire and when you confirm it, it tryes to evaluat qoals. If it fails, it`ll start to put questions for evaluat all goals.

Postpone Question

If you check the choise Postpone answers in the control of consultation, you can postpone any question during the consultation. The postpone attribute takes the weight „unknown“ and it`s marked as provisional. All propositions that use this attribute (some of it`s propositions) takes the status provisional, too. If an user isn`t content with results at the end of the consultation, he can click on the button Retry in the bottom right corner and continue in the consultation. The system put him all postponed attributes again and the user can specify the weights. In this refreshed consultation the postpone isn`t allowed.

Change Answers

You can change answers after the end of consutations. On the screen with results click on the button Change answers. Modifications go on the questionnaire. After its confirmation, the system recounts the results and shows them in the screen of results.

Save and Load Answers

After the end of consultation, you can save your answers to a file for their futur use. Click on the button Save answers in the bottom right corner. You can add the a description of the consultation that are displayed after the load of the answers.

If you want load the answers from the file, chose the choise Load answers from file in the Control of consultation and set this file to the text box File. After the confirmation of the controls, the system try to load the answers and if it`s succeded, it`ll shows you the questionnaire, where you can modify the answers. Below the questionnaire, you can see a description of the consultation.

During the loading of answers, the file „answers.dtd“ must be in the same directory as the loaded file. The system checks a syntax of the answers according to this file. The file „answers.dtd“ can be in an other directory, but this directory must be specified in the system options.

Load the Answers from Another Sources

The system hasn`t to take all answers from an user, but it can take a weight of attribute from other sources, concretely from a file or from an external function.

If the system takes the weight from the external file, an user`ll not check it. If the system fails to read the weight (it read the weight from the first line of the file that must be the text type), it`ll use the next source (it`s ofen the question to the user).

During the taking weight from the external function the system calls the external program and waits to it`s end. The external program has to create (or modify) the file, from which the system read the weight (by the same way as with the external file). The evaluation is stoped during the running of the external function and waits to the result. If the function doesn`t finish to a set time (this time can be seted in the system options), the system`ll use next source. The waiting can be breaked by an user by pressing the button Cancel.

„User“ can be set as the source of proposition. In this situation, the system put a question to an user also in the case when the proposition can be deduced from another propositions. If the user answer by the weight „UNKNOWN“, the system`ll use next source.

Run Actions

The actions can be defined in the knowlage base. The action is an external program that is started by the system, but the system doesn`t care for it. The action can be started when a proposition is evaluate or when a rule is used. If the action is defined for the proposition, a threshold can be assigned to it and the action`ll be started only if a weight of the propositon overpass this threshold.


System Options

Showing Options

Call system options from the initial screen by the main menu Options / Options ...

All changes which you do in the options will be seted up after you click on the button OK. If you click on the button Cancel, the changes will not be saved.

General Sheet

Onto this sheet, there are two options: the number of decimal points and the language.

The number of decimal points determines with how many decimal points will the system work. This will put forth as in the internal system work - rounding, displaying results, ... - as in external files.

Language of the system determines the language by which the system will comunicate with an user. There are two possibilities - english and czech. This language doesn`t influence the syntax of knowledge base that is always the same (based on english).

Directory Sheet

Onto this sheet, there are 4 input boxes, where several directories are entered. A setting of these directories isn`t inevitable for the work of the system, but it can simplify a work with the system.

Directory with file „base.dtd“ determines the directory, where this file is placed. This file is required when the system open the knowledge base and if this directory isn`t set, the file must be placed in the same directory as the file of knowledge base.

Directory with file „answers.dtd“ determines the directory, where this file is placed. The file „answers.dtd“ has an analogical function as the file „base.dtd“, but it`s required when the system open the answers saved in the previous consultation.

Directory with knowlage bases is the directory, where knowledge bases are placed. If this directory is set, the system will use it as the default directory along opening base and it speed up a finding of demanded knowlage base.

NEST Editor directory is the directory, where the file „NEST_Editor.exe“ is placed (it`s the program for creating of knowlage bases). If this directory is set, the NEST Editor could be started from initial screen by the main menu Tools - NEST Editor. The directory will be set automatically, when the Editor is started by another way.

All directories can be seted directly, or by clicking on the button next to the input box and selecting a directory in the dialog.

Colors Sheet

Onto this sheet, you can set up 3 colors of text that are used for results of consultations.

Basic color is used when there is no reason to use another one.

Color for Positiv results is used for all results that have theirs lower limit greater then 0.

Color for Negative results is used for all results that have theirs upper limit lower then 0.

Sources Sheet

Onto this sheet, there is only one choice: Maximal time of external function. It determines the time (in milliseconds) of waiting to the end of an external function that is used as a source of answer. If the function doesn`t finish in this time, the system`ll keep the waiting and go to the next source.

If the left checkbox isn`t checked, the system will wait forever (an user can stop it by clickint on the button „Cancel“).


The Simplest Consultation

Base Opening

For open a base, use the main menu Base / Open Base onto the initial screen or click on the button Open base. After the execution of a standard dialog the system tries to load the given base. If it`s succeded, the file name will be show next to the caption Actual base followed by a description of the base. If the base can`t be loaded, the system show a reason.

The system can load knowledge bases that are saved in a file based on the XML with the syntax of knowledge base. During the opening of a base, the system requires the file „base.dtd“. According to this file, the system makes a check of the syntax. The file has to be placed in the same directory as the opening base, or the „Directory with file base.dtd“ must be set into the system options. Without this file, the system coudn`t open any knowledge file.

If you open a knowledge base in the time, when some other base is loaded in the system, this old base is automatically closed. It comes to this, that only one base can be opened in the system.

Start Consultation

A consultation can be started in the situation, when some knowledge base is loaded in the system.

You start the consultation onto the initial screen by using the main menu Base / Consult or by clicking on the button Consult.

A screen with options of consultation will appear after the start of the consultation. For the simplest consultation, all choises are seted right and you can directly click on the button OK. We will learn about this options in the chapter more complicated consultations.

After the confirmation of this options, the system start to recognize weight of goals and it give to an user questions that are needed to calculate this goals.

Question

When the system during the evaluation of goals finds the attribute whose weight can`t be infer from another propositons, a question is sended to the user. There are 4 types of questions:

  • question to a binary attribute;
  • question to a single attribute;
  • question to a set attribute;
  • question to a numeric attribute.

Question to a binary attribute: the system put a question „what is the weight of binary attribute“ and it appends the name of the attribute and its description. User has to enter a weight of the attribute next to the capton Weight. The weight is a number from the interval that is explicit to the botton of the screen (this interval is constant for whole base). If the number recedes from the 0, the answer`ll recede from the value „irrelevant“ and it`ll near the value „certainly yes“ (if the number is positive) or to the value „certainly no“ (if the number is negative).

The seted weight has to be confirmed by pressing the key Enter or by clicking to the button Confirm answer.

An alternative way is to use some of predefined answer by clickning to the button on the right section of the screen. The answer Certainly yes replaces the maximal weight from the interval, the answer Certainly no replaces the minimal weigh, the answer Irrelevant replaces the weight 0. The answer Unknown can`t be replaced by one number and you must used this button. In effect, it replaces all weights from the interval.

The button Postpone the answer transfers the answering to this question to a later time. An usage of that will be explicite in the chapter more complicated consultation.

Question to a single attribute: the system put a question „what is the value and the weight of single attribute“ and it appends the name of the attribute and its description. An user has to choose an answer to the selection box and assign a weight to this answer by the same way as to the binary attribute.

Question to a set attribute: the system put a question „what are the values and weights of multiple attribute“ and it appends the name of the attribute and its description. An user has to choose values, to which he want to specify weights, and drag this value from the box Accepted values to the box Selected values. For each selected value, he must assign a weight by the analogous way as to the binary attribute. The assigned value is showed next to the value into the box with selected values. The weight can be assigned with the buttons with one exception - the button Unknown assigns this value to whole attribute (that is to all answers) and end the answering to this question.

Question to a numeric attribute: the system put a question „what is the value of the numeric attribute“ and it appends the name of the attribute and its description. An user has to enter a value of this attribute. The value is a number from the interval that is showed on the bottom of the screen. This interval is different for each numeric attribute.

Once the user answers the question, the system continues in evaluation of the goals. If the user don`t want to contiue in the consultation, he could finish it by closing the question with the cross in right top corner.

Consultation Results

Once the system gets all answers to the questions needed for evaluation of goals, final weights are counted and the results are showed. The results are placed in a grid, where following items are given for each proposition:

  • proposition`s name;
  • minimal weight of the proposition;
  • maximal weight of the proposition;
  • status of the proposition shows, in which status is the proposition after the evaluation. There are 4 status - untouched, partial, final and provisional. Untouched means that the proposition didn`t be used during the evaluation. Partial means that the system went into it during the evaluation but finally, the weight of that proposion didn`t have to be counted. Final means that the proposion was needed and the weight has the final value. Provisional means that an user postpone some question (more informations in the chapter more complicated consultation) and the weight of this proposition could changed after answering of the postpone questions;
  • type of the proposition show the kind of the proposition. The proposition can be a goal, an intermediate proposition or a question.

The results grid can be sorted according to any of these collums, only click to a header of the column. The grid is sorted by the minimal weight implicitly.

A description of the proposition (if exists) is displayed in a right upper text box after you select the proposition by clicking on it.

You can see only goals in the grid implicitly. If you want see all propositions, swich a controller Show to an item All propositions.

If some integrity constraint was broken during the evaluations, you could see it in a grid on the right side of the screen (analogous rule as on the grid with results apply on this grid). The break of the integrity constraint means that there was broken some logic in the knowlage base and in a comment of this integrity constrains, there should be some advance, what to do to don`t break it.

You close the screen with results by clicking on the button Close in the right bottom corner. The whole consultation is finished by this.

Results of the consultation can be exported to files or to the Excel application (if you have it). Use the button Exports results in the right bottom corner. After cliced on it, you see a dialog window, where you can set the description of the consultation and where you choose a file to export (text file, html file or Excel). If you want add comments of each propositions check the Export comments choose. After the confirmation of this dialog window, you choose a external file in a standard dialog (not for Excel) and the results are exported.


Work with Files

Creation of New Base

You create new knowledge base on the main screen by the main menu File / New. The editor creates new base with a name NONAME. At the same time, the window with global properties of the base is showed. You can close this window and return to it later, but I recommend to fill everythings you can immediately after the creation of the base.

Open the Existing Base

You open the knowlage base on the main screen by the main menu File / Open. After you choose a file in a standard dialog box, the editor try to open the base and show it in the base`s window on a desktop. If the editor can`t open the file, it`ll write a reason.

The editor can load the files that are based on the XML and that have a syntax of the knowledge base.

In the editor, more bases can be opened in the same time. Each base has it`s own window on the desktop.

Save the Base

You save the base on the main screen by the main menu File / Save. If the base has already the name (e.g. the file), it`ll be saved under this name. If you save the base first time, you`ll have to choose a file in a standard dialog window. The base`s file has the extension „xml“.

For save the base under another name (to another file), choose the command File / Save as and choose the new name in a standard dialog window.

The base is save to a file based on the XML that has a syntax of the knowledge base.

Export of the Base

Export of the base is an instrumental for saving the base to a file that is readable for a human. This file can`t be loaded back to the editor.

You can export the base to two formats. First is the text file (the command File / Export base / txt file), the second is the html file (the command File / Export base / html file).


Work with Indeterminateness

NEST works with weights that express as the indeterminateness in the knowlage base as the indeterminateness in answers of users. While weights of rules are set by one value, the weights during a consultation are represented by intervals. Weights of the rules w (and answers of users that have only one value) are converted to the interval [w;w].

7 functions are defined for a work with indeterminateness (NEG, CONJ, DISJ, CTR, GLOB, NORM, IMP). These functions are defined on the interval [-1;1] (function NORM is defined on the set of real numbers). If the knowlage base uses another weight range, the weights`ll be regulated to this interval.

4 types of the work with indeterminateness are implemented in NEST:

  • standard;
  • logical;
  • neuronal;
  • hybrid.

5 functions (NEG, CONJ, DISJ, NORM, IMP) are defined equally for all types, in others two, there are some differences.

Function NEG

Function NEG is used for the calculation of a negation of a proposition. It`s defined as following:

NEG(w) = -w

or for the work with interval [w1;w2]:

NEG([w1;w2]) = [-w2;-w1]

Function CONJ

Function CONJ is used for the calculation of a conjunction of two propositions. It`s defined as following:

CONJ(v,w) = min(v,w)

or for the work with intervals [v1,v2],[w1;w2]:

CONJ([v1;v2],[w1;w2]) = [min(v1,w1); min(v2,w2)]

Function DISJ

Function DISJ is used for the calculation of a disjunction of two forms. It`s defined as following:

DISJ(v,w) = max(v,w)

or for the work with intervals [v1,v2],[w1;w2]:

DISJ([v1;v2],[w1;w2]) = [max(v1,w1); max(v2,w2)]

Function CTR

Function CTR is used for the calculation of a contribution of a rule (or for put together a weight of context and a weight of condition). It`s defined as following:

  • standard, neuronal and hybrid type of undeterminateness:
    CTR(a,w) = 0       ; a ≤ 0
CTR(a,w) = a * w   ; a > 0
  • logical type of undeterminateness:
    CTR(a,w) = 0                              ; a < 0
CTR(a,w) = sign(w) * max(0,a + |w| - 1)   ; a ≥ 0

For the work with intervals [a1;a2],[w1,w2], it is used the expression
CTR([a1;a2],[w1,w2]) = [CTR(a1,w1);CTR(a2,w2)]

Function GLOB

Function GLOB is used fo put together more contributions of rules. It`s defined as following:

  • standard type of undeterminateness:
    GLOB(v,w) = 0                    ; (v = 1, w = -1) or (v = -1, w = 1)
GLOB(v,w) = (v + w)/(1 + v * w)  ; other
  • logical and hybrid type of undeterminateness:
    GLOB(w1...wn) = min(Σw>0w ,1)  +  max(Σw<0w,-1)
  • neuronal type of undeterminateness:
    GLOB(w1...wn) = min(max(sΣw, -1), 1)
     where s = 1

For the work with intervals [a1;a2],[w1,w2], it is used the expression
GLOB([a1;a2],[w1,w2]) = [GLOB(a1,w1);GLOB(a2,w2)]

Function NORM

This function is defined in the real numbers. It regulates intervals to the interval [-1;1]. It`s used after the calculation of compositional rule`s contributions with by funciton CTR and after the function GLOB during the calculation of a weight of proposition`s condition. It`s defined as following:

NORM(w) := min(max(w,-range), range)

or for the work with interval [w1;w2]:

NORM([w1;w2]) = [min(max(w1,-range), range); min(max(w2,-range), range)]

where range = 0.999 (or another count of „9“ depends on the number of decimal places)

Function IMP

Function IMP is used for the calculation of a final weight of integrity restriction that decides if the integrity restriction was breaked and how much. It`s defined as following:

IMP(w,v) = 0                  ; w <= 0
IMP(w,v) = max(0, min(w - v)) ; w > 0

or for the work with interval [w1;w2]:

IMP([w1;w2],[v1,v2]) = [max(0, w1 - v1); max(0, w2 - v2)]

where w is the weight of condition (that can be modified by a context by the function CTR) and v is the weight of conclusion.