Interactive Consultant¶
The Interactive Consultant tool enables experts to digitize their knowledge of a specific problem domain. With the resulting knowledge base, an online interface is automatically created that serves as a web tool supporting end users to find solutions for specific problems within that knowledge domain.
The tool uses source code in the IDP-Z3 language as input. It recognizes the annotations in vocabulary and in expressions. However, there are some specific changes and additions when using IDP-Z3 in the Interactive Consultant, which are explained further in this chapter.
Display block¶
The display block configures the user interface of the Interactive Consultant.
It consists of a set of display facts, i.e., predicate and function applications terminated by .
.
The following predicates and functions are available:
- expand
expand := {`s1, .., `sn}.
specifies that symbolss1, .., sn
are shown expanded, i.e., that all sub-sentences of the theory where they occur are shown on the screen.For example,
expand := {`length}.
will force the Interactive Consultant to show all sub-sentences containing length.- hide
hide(`s1, .., `sn)
specifies that symbolss1, .., sn
are not shown on the screen.For example,
hide(`length).
will force the Interactive Consultant to not display the box containing length information.- view()
view() = normal.
(default) specifies that symbols are displayed in normal mode.view() = expanded.
specifies that symbols are displayed expanded.- goal_symbol
goal_symbol := {`s1, .., `sn}.
specifies that symbolss1, .., sn
are always relevant, i.e. that they should never be greyed out.goal_symbol
can only be used in an enumeration.Irrelevant symbols and questions, i.e. expressions whose interpretation do not constrain the interpretation of the relevant symbols, are greyed out by the Interactive Consultant.
- moveSymbols
When the display block contains
moveSymbols()
, the Interactive Consultant is allowed to change the layout of symbols on the screen, so that relevant symbols come first.By default, the symbols do not move.
- optionalPropagation
When the display block contains
optionalPropagation()
, a toggle button is shown next to the menu to allow toggling immediate propagation on and off.By default, this button is not present.
- manualPropagation
When
manualPropagation()
is present in the display block, automatic propagation is disabled in the interface. Instead, a button is added to the menu that computes propagation when clicked.- optionalRelevance
When the display block contains
optionalRelevance()
, a toggle button is shown next to the menu to allow toggling immediate computation of relevance on and off.By default, this button is not present.
- manualRelevance
When
manualRelevance()
is present in the display block, automatic computation of relevant questions is disabled in the interface. Instead, a menu option is available in the “Reasoning” menu that computes relevance when selected.- unit
unit('unitstr', `s1, ..., `sn)
specifies the unit of one or more symbols. This unit will then show up in the symbol’s header in the Interactive Consultant.unitstr
may not be a symbol declared in the vocabulary.For example:
unit('m', `length, `perimeter).
- heading
Experimental: this feature is likely to change in the future.
heading('label', `p1, ..., `pn)
will force the display of thep1, ..., pn
symbols under a heading calledlabel
.label
may not be a symbol declared in the vocabulary.- counter
counter := {`p1, ..., `pn}
Enables a counter displaying the number of possible values next to dropdowns in the IC.- introduction
introduction('html text')
allows you to show an introductory message when the interface is opened, which can for instance be used to communicate the purpose of a KB to a user. This message may be formatted in html.- noOptimization
noOptimization(`s1, .., `sn)
specifies that no optimization buttons appear in the Interactive Consultant for symbolss1, .., sn
.For example,
noOptimization(`angle).
will hide the arrow up and arrow down buttons next to the input fields for angle.
Environment & Decision¶
Often, some elements of a problem instance are under the control of the user (possibly indirectly), while others are not.
To capture this difference, the FO[·] language allows the creation of 2 vocabularies and 2 theories. The first one is called ‘environment’, the second ‘decision’. Hence, a more advanced skeleton of an IDP-Z3 program is:
vocabulary environment {
// here comes the specification of the vocabulary to describe the environment
}
vocabulary decision {
import environment
// here comes the specification of the vocabulary to describe the decisions and their consequences
}
theory environment:environment {
// here comes the definitions and axioms satisfied by any environment possibly faced by the user
}
theory decision:decision {
// here comes the definitions and axioms to be satisfied by any solution
}
structure environment:environment {
// here comes the interpretation of some environmental symbols
}
structure decision:decision {
// here comes the interpretation of some decision symbols
}
display {
// here comes the configuration of the user interface
}
Default Structure¶
The default structure functions similarly to a normal Structure, in the sense that it can be used to set values of symbols. However, these values are set as if they were given by the user: they are shown in the interface as selected values. The symbols can still be assigned different values, or they can be unset.
In this way, this type of structure is used to form a default set of values for symbols. Such a structure is given the name ‘default’, to denote that it specifies default values. The syntax of the block remains the same.
structure default {
// here comes the structure
}
cDMN¶
Besides the FO(·) editor, the Interactive Consultant also contains a cDMN editor. cDMN is short for constraint Decision Model and Notation, a user-friendly and table-based alternative for a fragment of FO(·). If you would like to learn more about it, you can find more information on the cDMN documentation.