<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.visual-prolog.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=SergeMukhin</id>
	<title>wiki.visual-prolog.com - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.visual-prolog.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=SergeMukhin"/>
	<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Special:Contributions/SergeMukhin"/>
	<updated>2026-04-09T02:23:06Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Terms/in&amp;diff=4959</id>
		<title>Language Reference/Terms/in</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Terms/in&amp;diff=4959"/>
		<updated>2024-09-27T03:25:48Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;vipbnf&amp;gt;&amp;lt;InOperator&amp;gt;:&lt;br /&gt;
  in&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;in&amp;lt;/vp&amp;gt; operator is used to test for member ship of a collection (e.g. a list) and to nondeterministically generate the members of a collection.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;predicates&lt;br /&gt;
    p : (Type X, Type* L).&lt;br /&gt;
clauses&lt;br /&gt;
    p(X, L) :-&lt;br /&gt;
        if X in L then&lt;br /&gt;
            write(&amp;quot;X is in L\n&amp;quot;)&lt;br /&gt;
        end if.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&amp;lt;vp&amp;gt;p&amp;lt;/vp&amp;gt; is a procedure that takes a value &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; and a list &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt; as arguments.  If &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is in the list &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt; then it will write &amp;lt;vp&amp;gt;&amp;quot;X is in L&amp;quot;&amp;lt;/vp&amp;gt;.  In this case in is used as an in-test (membership test).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;predicates&lt;br /&gt;
    q : (Type* L).&lt;br /&gt;
clauses&lt;br /&gt;
    q(L) :-&lt;br /&gt;
        foreach X in L do&lt;br /&gt;
            writef(&amp;quot;% is in L\n&amp;quot;, X)&lt;br /&gt;
        end foreach.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&amp;lt;vp&amp;gt;q&amp;lt;/vp&amp;gt; is a procedure that takes a list &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt; as argument.  The &amp;quot;in&amp;quot; operator is used to nondeterministically return the members of L, so that they can be written.}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;in&amp;lt;/vp&amp;gt; operator can be defined for any domain and interface using the &amp;lt;vp&amp;gt;in_test&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;in_iterate&amp;lt;/vp&amp;gt; attributes.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;in_test(&amp;lt;predicate name&amp;gt;)&amp;lt;/vp&amp;gt; attribute defines the predicate that is used as in-test for a certain domain or interface.  Likewise the &amp;lt;vp&amp;gt;in_iterate&amp;lt;/vp&amp;gt; attribute defines the predicate that is used as in-iterator for the domain/interface.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;domains&lt;br /&gt;
    tree{E} = empty; node(tree{E} Left, E Value, tree{E} Right)&lt;br /&gt;
        [in_test(isMemberTree), in_iterate(getAll_nd)].&amp;lt;/vip&amp;gt;&lt;br /&gt;
When the program contains &amp;lt;vp&amp;gt;A in B&amp;lt;/vp&amp;gt; where &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is bound &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is a &amp;lt;vp&amp;gt;tree{E}&amp;lt;/vp&amp;gt; then &amp;lt;vp&amp;gt;isMemberTree&amp;lt;/vp&amp;gt; is actually called.&lt;br /&gt;
&lt;br /&gt;
In that case &amp;lt;vp&amp;gt;A in B&amp;lt;/vp&amp;gt; corresponds to &amp;lt;vp&amp;gt;isMemberTree(A, B)&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is free the call corresponds to &amp;lt;vp&amp;gt;A = getAll_nd(B)&amp;lt;/vp&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
For a domain &amp;lt;collection&amp;gt; the predicate must have the type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicates&lt;br /&gt;
    &amp;lt;predicate&amp;gt; : (&amp;lt;some-type&amp;gt; Elem, &amp;lt;collection&amp;gt; Collection) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;interface collection [in_test(contains), in_iterate(getAll_nd)]&lt;br /&gt;
...&lt;br /&gt;
end interface collection&amp;lt;/vip&amp;gt;&lt;br /&gt;
When the program contains &amp;lt;vp&amp;gt;A in B&amp;lt;/vp&amp;gt; where &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is bound &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is a &amp;lt;vp&amp;gt;collection&amp;lt;/vp&amp;gt; then &amp;lt;vp&amp;gt;contains&amp;lt;/vp&amp;gt; is actually called.&lt;br /&gt;
&lt;br /&gt;
In that case &amp;lt;vp&amp;gt;A in B&amp;lt;/vp&amp;gt; corresponds to &amp;lt;vp&amp;gt;B:contains(A)&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is free the call corresponds to &amp;lt;vp&amp;gt;A = B:getAll_nd()&amp;lt;/vp&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
For a domain &amp;lt;vp&amp;gt;&amp;lt;collection&amp;gt;&amp;lt;/vp&amp;gt; the &amp;lt;vp&amp;gt;in_test&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;in_iterate&amp;lt;/vp&amp;gt; predicate must fulfill these schematic declarations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;domains&lt;br /&gt;
    &amp;lt;collection&amp;gt; = ... [in_test(&amp;lt;in_test&amp;gt;), in_iterate(&amp;lt;in_iterate&amp;gt;)].&lt;br /&gt;
class predicates&lt;br /&gt;
    &amp;lt;in_test&amp;gt; : (&amp;lt;some-type&amp;gt; Elem, &amp;lt;collection&amp;gt; Collection) determ.&lt;br /&gt;
    &amp;lt;in_iterate : (&amp;lt;collection&amp;gt; Collection) -&amp;gt; &amp;lt;some-type&amp;gt; Elem nondeterm.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For an interface &amp;lt;vp&amp;gt;&amp;lt;collection&amp;gt;&amp;lt;/vp&amp;gt; the &amp;lt;vp&amp;gt;in_test&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;in_iterate&amp;lt;/vp&amp;gt; predicate must fulfill these schematic declarations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface &amp;lt;collection&amp;gt; [in_test(&amp;lt;in_test&amp;gt;), in_iterate(&amp;lt;in_iterate&amp;gt;)]&lt;br /&gt;
predicates&lt;br /&gt;
    &amp;lt;in_test&amp;gt; : (&amp;lt;some-type&amp;gt; Elem) determ.&lt;br /&gt;
    &amp;lt;in_iterate : () -&amp;gt; &amp;lt;some-type&amp;gt; Elem nondeterm.&lt;br /&gt;
...&lt;br /&gt;
end interface &amp;lt;collection&amp;gt;&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;in&amp;lt;/vp&amp;gt; operator is predefined on list domains, and in PFC the collections have suitable attributes.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    p() :-&lt;br /&gt;
        foreach X in [1, 2, 3, 4] do % in_iterate&lt;br /&gt;
            if X in [2, 4] then % in_test&lt;br /&gt;
                ...&lt;br /&gt;
            end if&lt;br /&gt;
        end foreach.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first &amp;lt;vp&amp;gt;in&amp;lt;/vp&amp;gt; is the predefined &amp;lt;vp&amp;gt;in_iterate&amp;lt;/vp&amp;gt; for the list domain, and the second one is the predefined &amp;lt;vp&amp;gt;in_test&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    q() :-&lt;br /&gt;
        M1 = setM_redBlack::new(),&lt;br /&gt;
        M1:inset(&amp;quot;a&amp;quot;),&lt;br /&gt;
        M1:inset(&amp;quot;b&amp;quot;),&lt;br /&gt;
        M2 = setM_redBlack::new(),&lt;br /&gt;
        M2:inset(&amp;quot;b&amp;quot;),&lt;br /&gt;
        foreach X in M1 do % in_iterate&lt;br /&gt;
            if X in M2 then % in_test&lt;br /&gt;
                ...&lt;br /&gt;
            end if&lt;br /&gt;
        end foreach.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For collections the &amp;lt;vp&amp;gt;in&amp;lt;/vp&amp;gt; operators resolve to &amp;lt;vp&amp;gt;contains&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;getAll_nd&amp;lt;/vp&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface collection{@Type}&lt;br /&gt;
    [in_test(contains), in_iterate(getAll_nd)]&lt;br /&gt;
&lt;br /&gt;
predicates&lt;br /&gt;
    contains : (@Type Value) determ.&lt;br /&gt;
    % @short Succeeds if the collection contains the value @Type&lt;br /&gt;
    % @end&lt;br /&gt;
&lt;br /&gt;
predicates&lt;br /&gt;
    getAll_nd : () -&amp;gt; @Type Value nondeterm.&lt;br /&gt;
    % @short @Type is nondeterministic iteration of the elements in the collection.&lt;br /&gt;
    % @end&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
end interface collection&amp;lt;/vip&amp;gt;}}&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{LanguageReferenceSubarticle|Terms/in}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Terms&amp;diff=4949</id>
		<title>Language Reference/Terms</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Terms&amp;diff=4949"/>
		<updated>2024-08-09T05:44:48Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{languageReferenceNavbar|Terms}}&lt;br /&gt;
&lt;br /&gt;
This section describes terms and how execution/evaluation of terms and clauses proceeds.&lt;br /&gt;
&lt;br /&gt;
Semantically, there are two kinds of terms: &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;formulas&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;expressions&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
*Expressions represent values, like the number 7.&lt;br /&gt;
*Formulas represent logical statements, like &amp;quot;the number 7 is greater than the number 3&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Syntactically the two kinds have a huge overlap and therefore the syntax unites the two kinds into &amp;#039;&amp;#039;terms&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The following definition of &amp;lt;vpbnf&amp;gt;&amp;lt;Term&amp;gt;&amp;lt;/vpbnf&amp;gt; is simplified, in the sense that it includes syntactic constructions that are not legal. For example, one cannot legally write &amp;lt;vp&amp;gt;! + !&amp;lt;/vp&amp;gt;. We do however believe that using this simple syntax description in combination with intuitive understanding of language concepts, the type system, and the operator hierarchy described below is better for most purposes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Term&amp;gt;:&lt;br /&gt;
    ( &amp;lt;Term&amp;gt; )&lt;br /&gt;
    &amp;lt;Literal&amp;gt;&lt;br /&gt;
    &amp;lt;Variable&amp;gt;&lt;br /&gt;
    &amp;lt;Identifier&amp;gt;&lt;br /&gt;
    &amp;lt;MemberAccess&amp;gt;&lt;br /&gt;
    &amp;lt;PredicateCall&amp;gt;&lt;br /&gt;
    &amp;lt;PredicateExpression&amp;gt;&lt;br /&gt;
    &amp;lt;UnaryOperator&amp;gt; &amp;lt;Term&amp;gt;&lt;br /&gt;
    &amp;lt;Term&amp;gt; &amp;lt;Operator&amp;gt; &amp;lt;Term&amp;gt;&lt;br /&gt;
    &amp;lt;Cut&amp;gt;&lt;br /&gt;
    &amp;lt;Ellipsis&amp;gt;&lt;br /&gt;
    &amp;lt;FactvariableAssignment&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Backtracking ===&lt;br /&gt;
&lt;br /&gt;
The evaluation of a Prolog program is a search for a &amp;quot;solution&amp;quot; to the goal. Each step in the search for a solution can either &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeed&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fail&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;. At certain points in the program execution there are more than one possible choices for finding a solution. When such a choice point is met a so called &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;backtrack point&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is created. A backtrack point is a recording of the program state plus a pointer to the choice that was not executed. If it turn out that the original choice could not provide the solution (i.e. if it &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fails&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;), then the program will &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;backtrack&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; to the recorded backtrack point. Thereby restoring the program state and pursuing the other choice. The mechanism will be described and exemplified in details in the following sections.&lt;br /&gt;
&lt;br /&gt;
=== Literals ===&lt;br /&gt;
&lt;br /&gt;
Literals have {{lang2|Domains|Universal_Types|universal type}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Literal&amp;gt;:&lt;br /&gt;
   &amp;lt;IntegerLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;RealLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;CharacterLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;StringLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;BinaryLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;ListLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;CompoundDomainLiteral&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also {{lang2|Lexical Elements|Literals|Literals (in Lexical Elements)}}&lt;br /&gt;
&lt;br /&gt;
=== Variables ===&lt;br /&gt;
&lt;br /&gt;
Variables in Visual Prolog are immutable: once they are bound to a value they retain that value, but backtracking can unbind the variable again during the process of restoring a previous program state.&lt;br /&gt;
&lt;br /&gt;
A variable can thus be bound (during unification and matching), if it is already bound then it evaluates to the value that it is bound to.&lt;br /&gt;
&lt;br /&gt;
Variables are names starting with an upper-case letter or with an underscore (_), followed by a sequence of letters (both uppercase and lowercase), digits, and underscore characters (all in all called an UppercaseIdentifier):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Variable&amp;gt;:&lt;br /&gt;
    &amp;lt;UppercaseIdentifer&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following are examples of valid variable names:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;My_first_correct_variable_name&lt;br /&gt;
_&lt;br /&gt;
_Sales_10_11_86&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
while the next two are invalid:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;1stattempt&lt;br /&gt;
second_attempt&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variable consisting of single underscore character (i.e. &amp;lt;vp&amp;gt;_&amp;lt;/vp&amp;gt;) is known as the &amp;#039;&amp;#039;anonymous variable&amp;#039;&amp;#039;. The anonymous variable is used in patterns and bindings where the corresponding value is of no interest and should be ignored.  Every occurrence of the anonymous variable is an independent anonymous variable, i.e. even though the anonymous variable is used several times in a single clause they have no relation to each other.&lt;br /&gt;
&lt;br /&gt;
If variables that starts with an underscore are not anonymous, but they are still intended for values of no interest that should be ignored.  The compiler will issue a warning if the value of such a warning is actually not ignored.&lt;br /&gt;
&lt;br /&gt;
Prolog variables are local to the clause in which it occurs. That is, if two clauses each contain a variable called &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt;, these &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt;-s are two distinct variables.&lt;br /&gt;
&lt;br /&gt;
A variable is said to be &amp;#039;&amp;#039;free&amp;#039;&amp;#039; when it is not yet associated with a term and to be &amp;#039;&amp;#039;bound&amp;#039;&amp;#039; or instantiated when it is unified with a term.&lt;br /&gt;
&lt;br /&gt;
The Visual Prolog compiler does not make a distinction between upper and lower case letters in names, except for the first letter. This means that the two variables &amp;lt;vp&amp;gt;SourceCode&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;SOURCECODE&amp;lt;/vp&amp;gt; are the same.&lt;br /&gt;
&lt;br /&gt;
=== Identifier ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Identifier&amp;gt;: one of&lt;br /&gt;
    &amp;lt;MemberName&amp;gt;&lt;br /&gt;
    &amp;lt;GlobalScopeMembername&amp;gt;&lt;br /&gt;
    &amp;lt;ScopeQualifiedMemberName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;MemberName&amp;gt;:&lt;br /&gt;
    &amp;lt;LowerCaseIdentifier&amp;gt;&lt;br /&gt;
&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Identifiers are used to refer to named entities (i.e. classes, interfaces, constants, domains, predicates, facts, ...).&lt;br /&gt;
&lt;br /&gt;
An identifier can just be a lower case identifier (i.e. a lowercase letter followed by a sequence of letters, numbers and underscore characters).&lt;br /&gt;
&lt;br /&gt;
Many entities can have the same name.  So it may be necessary or desirable to qualify the lowercase identifier the name of the particular scope of interest, or to state that the name is in the global namespace.&lt;br /&gt;
&lt;br /&gt;
{{Example| These are examples of unqualified identifiers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;integer&lt;br /&gt;
mainExe&lt;br /&gt;
myPredicate&amp;lt;/vip&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Global Entities Access ====&lt;br /&gt;
&lt;br /&gt;
The only global entities, which exist in Visual Prolog, are built-in domains, predicates, and constants. Global names are directly accessible in any scope. There might however exist situations where a global name is shadowed by a local or imported name. In that case the global entity can be qualified with a double colon &amp;#039;&amp;lt;vp&amp;gt;::&amp;lt;/vp&amp;gt;&amp;#039; (without a prefixed class/interface name). The double colon can be used everywhere, but the most important place is where an interface name is used as formal parameter type specifier.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;GlobalScopeMemberName&amp;gt;:&lt;br /&gt;
    :: &amp;lt;MemberName&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Example| The built-in domain &amp;lt;vp&amp;gt;integer&amp;lt;/vp&amp;gt; is defined in the global scope, to avoid ambiguity or stress that it is this particular domains you can use the global scope member name:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;::integer&amp;lt;/vip&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Class/Interface Member Access ====&lt;br /&gt;
&lt;br /&gt;
Static members of classes and interfaces are accessed by means of qualification with the class name (and optionally a namespace prefix):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;ScopeQualifiedMemberName&amp;gt;&lt;br /&gt;
    &amp;lt;NamespacePrefix&amp;gt;-opt &amp;lt;ScopeName&amp;gt; :: &amp;lt;MemberName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;NamespacePrefix&amp;gt;:&lt;br /&gt;
    &amp;lt;NamespaceIdentifier&amp;gt;-opt \&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ScopeName&amp;gt;:&lt;br /&gt;
    &amp;lt;LowercaseIdentifier&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ScopeName is the name of the class or interface that defines/declares the name.&lt;br /&gt;
&lt;br /&gt;
Namespace prefixing is explained in: {{lang2|Namespaces|Referencing names in namespaces|Referencing names in namespaces}}.&lt;br /&gt;
&lt;br /&gt;
Some names can be accessed without qualification, see {{lang2|Basic_Concepts|Scoping_&amp;amp;_Visibility|scoping &amp;amp; visibility}}.&lt;br /&gt;
&lt;br /&gt;
=== Predicate Call ===&lt;br /&gt;
&lt;br /&gt;
A predicate call have the form&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;PredicateCall&amp;gt;:&lt;br /&gt;
     &amp;lt;Term&amp;gt; ( &amp;lt;Term&amp;gt;-comma-sep-list-opt )&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first term must be an expression that evaluates to a value with predicate type.  Typically, it is either the name of a predicate in a class, or an expression that evaluates to a predicate member of an object.&lt;br /&gt;
&lt;br /&gt;
Notice that some predicates return values, whereas other predicates do not. A predicate that returns a value is an expression, and the predicate call is often referred to as a &amp;#039;&amp;#039;&amp;#039;function&amp;#039;&amp;#039;&amp;#039; call.  A predicate that does return a value is a formula.&lt;br /&gt;
&lt;br /&gt;
A predicate is invoked by applying arguments to the predicate. The predicate must have a flow-pattern that matches the free/bound state of the arguments.&lt;br /&gt;
&lt;br /&gt;
Most predicates are defined by a set of clauses, but some predicates are built into the language and some are defined externally in a DLL (perhaps in a foreign programming language).&lt;br /&gt;
&lt;br /&gt;
When a predicate is invoked by a predicate call, each clause is executed in turn until one of them &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeeds&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, or there are no more clauses left to execute. If no clause succeeds the predicate &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fails&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
If a clause succeeds and there are more relevant clauses left, a &amp;#039;&amp;#039;&amp;#039;backtrackpoint&amp;#039;&amp;#039;&amp;#039; is created to the next relevant clause.&lt;br /&gt;
&lt;br /&gt;
Thus, a predicate can &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fail&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeed&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, and even &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeed&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; multiple times.&lt;br /&gt;
&lt;br /&gt;
Each clause has a head and optionally a body.&lt;br /&gt;
&lt;br /&gt;
When a predicate is called the clauses are tried in turn (from top to bottom). For each clause the arguments in the head is unified with the arguments from the call. If this unification succeeds then the body of the clause (if present) is executed. The clause &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeeds,&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; if the match of the head &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeeds&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; and the body &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeeds&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;. Otherwise it &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fails&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp() :- qqq(X), write(X), fail.&lt;br /&gt;
&lt;br /&gt;
   qqq(1).&lt;br /&gt;
   qqq(2).&lt;br /&gt;
   qqq(3).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is called it in turn calls &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt;. When &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; is called, it first creates a backtrack point pointing to the second clause. Then the first clause is executed. Hereby the free variable &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; from &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is matched against the number &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;, whereby &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is bound to &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; (i.e. &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;) is written and then &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; cause backtracking to the backtrackpoint. Hereby program control is set to the second clause in &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; and the program state is set back to the state it was in when &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; was first entered, i.e. &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; in &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is unbound again.&lt;br /&gt;
&lt;br /&gt;
Before the actual execution of the second clause in &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; begins a backtrack point to the third clause is created.  The execution then proceeds as it did for &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Unification ===&lt;br /&gt;
&lt;br /&gt;
When a predicate is called the arguments from the call is &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;unified&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; with the terms in the head of each clause.&lt;br /&gt;
&lt;br /&gt;
Unification is the process of binding variables in such a way that two terms become equal, making as few bindings as possible (i.e. leaving as much as possible open for further binding).&lt;br /&gt;
&lt;br /&gt;
Variables can be bound to any kind of terms, including variables or terms containing variables.&lt;br /&gt;
&lt;br /&gt;
Unification is either possible or impossible, i.e. it can &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeed&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fail&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Variables and terms to which they are unified have types, a variable can only be bound to a term of the same type as the variable, or a subtype. When two variables are bound to each other they must therefore have exactly the same type.&lt;br /&gt;
&lt;br /&gt;
Unification takes place (as mentioned) between a predicate call and the clause head. It also takes place when two terms are compared for equality.&lt;br /&gt;
&lt;br /&gt;
{{Example| Consider two terms (of the same type):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;T1 = f1(g(), X, 17, Y, 17)&lt;br /&gt;
T2 = f1(Z, Z, V, U, 43)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will attempt to unify these two terms from left to right (i.e. a left-to-right pre-traversal).&lt;br /&gt;
&lt;br /&gt;
Both &amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt; are &amp;lt;vp&amp;gt;f1/5&amp;lt;/vp&amp;gt; terms, this match. Therefore we attempt to unify each of the arguments from &amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; with each correspondent argument of &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt;. First we must unify &amp;lt;vp&amp;gt;Z&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;, this can be unified if we bind &amp;lt;vp&amp;gt;Z&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;. So far everything is fine and we have the first binding in our unifier:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Z = g()&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next two arguments are &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;Z&amp;lt;/vp&amp;gt;, which already has been bound to &amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;. These two arguments can also be unified if we also bind &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;. So we now have the following contributions to our unifier:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;X = Z = g()&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we must bind &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;17&amp;lt;/vp&amp;gt; and then we must bind &amp;lt;vp&amp;gt;Y&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;U&amp;lt;/vp&amp;gt;. So far everything unifies with the following unifier:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;X = Z = g()&lt;br /&gt;
V = 17&lt;br /&gt;
Y = U&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two unified terms are now equivalent to these terms:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;T1 = f1(g(), g(), 17, Y, 17)&lt;br /&gt;
T2 = f1(g(), g(), 17, Y, 43)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But we have not yet unified the two last arguments, which are &amp;lt;vp&amp;gt;17&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;43&amp;lt;/vp&amp;gt;. No variable binding can make these terms equal, so all in all the unification &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fails&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt; cannot be unified.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
In the example above &amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; could have been a predicate call and &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt; a clause head. But they could also have been two terms that were compared with equal &amp;quot;&amp;lt;vp&amp;gt;=&amp;lt;/vp&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Matching ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Matching&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is the same as unification except that variables can only be bound to grounded terms. A &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;grounded&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; term is a term that does not contain any unbound variables.&lt;br /&gt;
&lt;br /&gt;
It is the flow-patterns that are stated for predicates, that make it possible to use matching rather than full-blown unification.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp(Z, Z, 17).&lt;br /&gt;
   qqq() :-&lt;br /&gt;
      ppp(g(), X, 17).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unification of the &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt;-call with the &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt;-clause is possible with the following unifier:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Z = X = g()&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; have the flow &amp;lt;vp&amp;gt;(i,o,i)&amp;lt;/vp&amp;gt; then the unification is just a match:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt; is input as the first argument, this is bound to &amp;lt;vp&amp;gt;Z&amp;lt;/vp&amp;gt;&lt;br /&gt;
*The second argument in the clause is therefore bound and can thus be output to &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt;, which therefore becomes bound to &amp;#039;&amp;#039;&amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
*finally the third argument is &amp;lt;vp&amp;gt;17&amp;lt;/vp&amp;gt; used as input this number is simply compared to the third argument in the clause.&lt;br /&gt;
&lt;br /&gt;
It is the flow-pattern that makes it possible to predict that the clause does not need real unification.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Nested Function Calls ===&lt;br /&gt;
&lt;br /&gt;
Terms that have to be unified or matched with each other are allowed to contain sub-terms that are actually expressions or function calls that have to be evaluated before the unification/matching can be completed.&lt;br /&gt;
&lt;br /&gt;
The evaluation of such sub-terms is done on a by-need basis.&lt;br /&gt;
&lt;br /&gt;
In a predicate call all input arguments are evaluated before the predicate is called, all output arguments are variables, which does not need evaluation.&lt;br /&gt;
&lt;br /&gt;
Clause heads can also contain terms that have to be evaluated, before matching/unification can be determined.&lt;br /&gt;
&lt;br /&gt;
*all matching/unification that does not require any evaluation is performed before any evaluation is performed;&lt;br /&gt;
*then evaluation corresponding to input arguments is performed one by one left-to-right. Comparing each value to the corresponding input after each evaluation;&lt;br /&gt;
*then the clause body is evaluated;&lt;br /&gt;
*then the output arguments are evaluated (left-to-right);&lt;br /&gt;
*then the return value (if the predicate is a function) is evaluated.&lt;br /&gt;
&lt;br /&gt;
If any of these &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fail&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; then the rest of the evaluation is not carried out.&lt;br /&gt;
&lt;br /&gt;
All in all the base principles are:&lt;br /&gt;
&lt;br /&gt;
*input after other match, before body evaluation&lt;br /&gt;
*output after body evaluation&lt;br /&gt;
*left-to-right&lt;br /&gt;
&lt;br /&gt;
=== Arguments ===&lt;br /&gt;
{{:Language Reference/Terms/Arguments}}&lt;br /&gt;
=== Fact Variable Assignment ===&lt;br /&gt;
&lt;br /&gt;
Assign operator &amp;lt;vp&amp;gt;:=&amp;lt;/vp&amp;gt; is used to assign a new value for a {{lang2|Facts|Fact_Variable_Declarations|fact variable}} &amp;lt;vpbnf&amp;gt;&amp;lt;FactVariable&amp;gt;&amp;lt;/vpbnf&amp;gt;. The &amp;lt;vpbnf&amp;gt;&amp;lt;Term&amp;gt;&amp;lt;/vpbnf&amp;gt; must be evaluated to a value of suitable type (i.e. the same type as the fact variable, or a subtype).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;FactVariableAssignment&amp;gt;:&lt;br /&gt;
    &amp;lt;FactVariable&amp;gt; := &amp;lt;Term&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Facts ===&lt;br /&gt;
&lt;br /&gt;
A fact database contains a number of fully instantiated (grounded) predicate heads corresponding to the facts from the facts section declaration. The facts can be accessed by a predicate call, using the fact name as the predicate name. The predicate call is matched against each fact in turn; succeeding with a possible backtrack point to the next fact each time the predicate call match the fact. When there are no more facts in the fact database then the predicate call fails.&lt;br /&gt;
&lt;br /&gt;
New facts can be &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;asserted&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; using the predicates {{lang2|Built-in_entities|assert|assert/1}}, {{lang2|Built-in_entities|asserta|asserta/1}}, and {{lang2|Built-in_entities|assertz|assertz/1}}. {{lang2|Built-in_entities|assert|assert/1}} is the same as {{lang2|Built-in_entities|assertz|assertz/1}} and it asserts a new fact to the end of the list of facts, whereas {{lang2|Built-in_entities|asserta|asserta/1}} asserts a new fact to the start of the list.&lt;br /&gt;
&lt;br /&gt;
Existing facts can be &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;retracted&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; with the predicate {{lang2|Built-in_entities|retract|retract/1}} and {{lang2|Built-in_entities|retractall|retractAll/1}}. {{lang2|Built-in_entities|retract|retract/1}} retracts the first fact that match the argument binding variables in the argument and leaving a backtrack point so that more facts will potentially be retracted when backtracking.&lt;br /&gt;
&lt;br /&gt;
{{lang2|Built-in_entities|retractall|retractAll/1}} retracts all facts that matches the arguments and succeeds without any binding.&lt;br /&gt;
&lt;br /&gt;
=== Operators ===&lt;br /&gt;
&lt;br /&gt;
Operators are organized in a precedence hierarchy. In the rule below operators in each group have same precedence, which is higher than those below. I.e. the power operator has higher precedence than unary minus and plus, which in turn has higher precedence than the multiplication operators, etc. Parenthesis can be used to circumvent the precedence (and for clarification).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Operator&amp;gt;: one of&lt;br /&gt;
    &amp;lt;PowerOperator&amp;gt;&lt;br /&gt;
    &amp;lt;UnaryOperator&amp;gt;&lt;br /&gt;
    &amp;lt;MultiplicationOperator&amp;gt;&lt;br /&gt;
    &amp;lt;AdditionOperator&amp;gt;&lt;br /&gt;
    &amp;lt;OtherwiseOperator&amp;gt;&lt;br /&gt;
    &amp;lt;RelationOperator&amp;gt;&lt;br /&gt;
    &amp;lt;MustUnifyOperator&amp;gt;&lt;br /&gt;
    &amp;lt;InOperator&amp;gt;&lt;br /&gt;
    &amp;lt;AndOperator&amp;gt;&lt;br /&gt;
    &amp;lt;OrOperator&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;UnaryOperator&amp;gt;: one of&lt;br /&gt;
    - +&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All operators except the &amp;lt;vpbnf&amp;gt;&amp;lt;UnaryOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;&amp;#039;s are binary.  The power operator is right associative, all other operators are left associative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vpbnf&amp;gt;&amp;lt;RelationOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;, &amp;lt;vpbnf&amp;gt;&amp;lt;MustUnifyOperator&amp;gt;&amp;lt;/vpbnf&amp;gt; and &amp;lt;vpbnf&amp;gt;&amp;lt;InOperator&amp;gt;&amp;lt;/vpbnf&amp;gt; have same precedence.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Notice&amp;#039;&amp;#039;&amp;#039; that the placement &amp;lt;vpbnf&amp;gt;&amp;lt;UnaryOperator&amp;gt;&amp;lt;/vpbnf&amp;gt; is not consistent with mathematics, where these operators are at the same level as the &amp;lt;vpbnf&amp;gt;&amp;lt;AdditionalOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;&amp;#039;s.  The difference has no influence of the calculated value, but it allows writing &amp;lt;vp&amp;gt;2*-2&amp;lt;/vp&amp;gt;, where mathematics would require a parenthesis around the second operator &amp;lt;vp&amp;gt;2*(-2)&amp;lt;/vp&amp;gt;.  It also means that &amp;lt;vp&amp;gt;-2*2&amp;lt;/vp&amp;gt; is mmeans (-2)*2 where it would be &amp;lt;vp&amp;gt;-(2*2)&amp;lt;/vp&amp;gt; in mathematics (the resulting value is the same).&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vp&amp;gt;-2^2&amp;lt;/vp&amp;gt; is the same as &amp;lt;vp&amp;gt;-(2^2)&amp;lt;/vp&amp;gt; because ^ has higher precedence than unary minus.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vp&amp;gt;3^2^2&amp;lt;/vp&amp;gt; is the same as &amp;lt;vp&amp;gt;3^(2^2)&amp;lt;/vp&amp;gt; because ^ is right associative.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vp&amp;gt;-2*-3^-4+5&amp;lt;/vp&amp;gt; is the same as &amp;lt;vp&amp;gt;((-2) * (-(3 ^ (-4)))) + 5&amp;lt;/vp&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example| The following term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;7 + 3 * 5 * 13 + 4 + 3 = X / 6 ; A &amp;lt; 7,  p(X)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
has the same meaning as this term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;((((7 + ((3 * 5) * 13)) + 4) + 3) = (X / 6)) ; ((A &amp;lt; 7) , p(X))&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I.e. at outermost level the term is an &amp;quot;&amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;&amp;quot; of two terms, the first of these is a relational (&amp;lt;vp&amp;gt;=&amp;lt;/vp&amp;gt;) term, the second is an &amp;quot;&amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt;&amp;quot; term, etc.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
&lt;br /&gt;
The arithmetic operators are used for arithmetic operations on numbers. They are expressions, which takes expressions as arguments. They have root types as arguments and return universal types as result. (See {{lang2|Domains|Universal_and_Root_Types|Universal and Root types}}.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;PowerOperator&amp;gt;:&lt;br /&gt;
    ^&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;MultiplicationOperator&amp;gt;: one of&lt;br /&gt;
    * / div mod quot rem&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;AdditionOperator&amp;gt;: one of&lt;br /&gt;
    +  -&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Relational Operators ===&lt;br /&gt;
&lt;br /&gt;
The relational operators are formulas, which takes expressions as arguments. Given this nature they are non-associative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;RelationOperator&amp;gt;: one of&lt;br /&gt;
  =   &amp;gt;   &amp;lt;   &amp;gt;=   &amp;lt;=   &amp;lt;&amp;gt;   &amp;gt;&amp;lt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the left term is evaluated, then the right term is evaluated and then the results are compared.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Notice&amp;#039;&amp;#039;&amp;#039; that &amp;lt;vp&amp;gt;&amp;lt;&amp;gt;&amp;lt;/vp&amp;gt; (different) is not the dual operation of = (equal). &amp;lt;vp&amp;gt;&amp;lt;&amp;gt;&amp;lt;/vp&amp;gt; compares two values, whereas &amp;lt;vp&amp;gt;=&amp;lt;/vp&amp;gt; tries to unify two terms (in the general case at least).&lt;br /&gt;
&lt;br /&gt;
The dual to expression &amp;lt;vp&amp;gt;A = B&amp;lt;/vp&amp;gt; is &amp;lt;vp&amp;gt;not (A = B)&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Must Unify Operator ====&lt;br /&gt;
&lt;br /&gt;
The must unify operator is a procedure, which takes expressions as arguments. It is non-associative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;MustUnifyOperator&amp;gt;:&lt;br /&gt;
  ==&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vpbnf&amp;gt;A == B&amp;lt;/vpbnf&amp;gt; unifies &amp;lt;vpbnf&amp;gt;A&amp;lt;/vpbnf&amp;gt; and &amp;lt;vpbnf&amp;gt;B&amp;lt;/vpbnf&amp;gt;; if the unification fails an exception is raised, otherwise the predicate succeeds.  Therefore &amp;lt;vpbnf&amp;gt;A == B&amp;lt;/vpbnf&amp;gt; always succeeds.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    p(L) :-&lt;br /&gt;
        [H|T] == L,&lt;br /&gt;
        ...&amp;lt;/vip&amp;gt;&lt;br /&gt;
&amp;lt;vp&amp;gt;p&amp;lt;/vp&amp;gt; is a procedure. An exception will be raised if it is called with an empty list, because &amp;lt;vp&amp;gt;[H|T]&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt; cannot unify.}}&lt;br /&gt;
&lt;br /&gt;
=== Bitwise and boolean operators ===&lt;br /&gt;
&lt;br /&gt;
The following operators for bitwise operations on &amp;lt;vp&amp;gt;unsigned&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;unsigned64&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;unsignedNative&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;&lt;br /&gt;
A ** B % A and B&lt;br /&gt;
A ++ B % A or B&lt;br /&gt;
A -- B % A and not B&lt;br /&gt;
A ^^ B % A exclusive or B&lt;br /&gt;
~~ A % not A&lt;br /&gt;
A &amp;lt;&amp;lt; N % Shifts the bits in A N times to the left.&lt;br /&gt;
A &amp;gt;&amp;gt; N % Shifts the bits in A N times to the right.&lt;br /&gt;
&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The logical operations (&amp;lt;vp&amp;gt;**&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;++&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;^^&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;~~&amp;lt;/vp&amp;gt;) can also be used on &amp;lt;vp&amp;gt;boolean&amp;lt;/vp&amp;gt; values.&lt;br /&gt;
&lt;br /&gt;
The shift operations discard bits that is shifted out of the number, and shift-in zero bits in the opposite end.&lt;br /&gt;
&lt;br /&gt;
=== Logical Operators ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vpbnf&amp;gt;&amp;lt;AndOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;(s) and &amp;lt;vpbnf&amp;gt;&amp;lt;OrOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;(s) are formulas, which takes formulas as arguments. They are all left associative. The &amp;lt;vp&amp;gt;,&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;and &amp;lt;/vp&amp;gt; are synonyms and so are &amp;lt;vp&amp;gt;; &amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;AndOperator&amp;gt;: one of&lt;br /&gt;
 ,   and&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;OrOperator&amp;gt;: one of&lt;br /&gt;
  ;  or orelse&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== and (,) ====&lt;br /&gt;
&lt;br /&gt;
The evaluation of an &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term &amp;lt;vp&amp;gt;A, B&amp;lt;/vp&amp;gt; proceeds as follows. First the left sub-term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is evaluated. If this evaluation fails, the whole &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term fails. If &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds then the right sub-term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is evaluated. If this evaluation fails, the whole &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term fails, otherwise the &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term succeeds.&lt;br /&gt;
&lt;br /&gt;
Thus the second sub-term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is only evaluated, if the first sub-term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp() :-&lt;br /&gt;
       qqq(), rrr().&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is called it will first call &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; and if &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; succeeds, then it will call &amp;lt;vp&amp;gt;rrr&amp;lt;/vp&amp;gt;. If &amp;lt;vp&amp;gt;rrr&amp;lt;/vp&amp;gt; succeeds, then the &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term and subsequently the whole clause succeeds.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== or (;) ====&lt;br /&gt;
&lt;br /&gt;
The evaluation of an &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt;; &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; proceeds as follows. First a backtrack point to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is created and then the first term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is evaluated. If the evaluation of the first term succeeds, then the whole &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; term succeeds and is left with a backtrack to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt;. If the evaluation of the first term fails, the backtrack point to the second term is activated.&lt;br /&gt;
&lt;br /&gt;
If the backtrack point to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is activated (either because the first term fails, or because something later in the execution invokes the backtrack point), then the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is evaluated and the whole &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; term will succeed if &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
Thus an &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; term can succeed with a backtrack point and the second sub-term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is only evaluated on backtrack.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp() :-&lt;br /&gt;
       (V = 3 or V = 7), write(V), fail.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we have used the keyword &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;, but you can also use semi-colon &amp;lt;vp&amp;gt;;&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is called we first create a backtrack point to the term &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; and then we evaluate &amp;lt;vp&amp;gt;V = 3&amp;lt;/vp&amp;gt;. Thereby &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; will be bound to &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt; we then continue to the &amp;lt;vp&amp;gt;write(V)&amp;lt;/vp&amp;gt; after &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt; has been written &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; is met. &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; always fails so we effectuate the backtrack point leading us to the term &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Backtracking also undo all bindings made since the backtrack point was created. In this case it means that &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; is unbound.&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; is evaluated and &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; becomes bound to &amp;lt;vp&amp;gt;7&amp;lt;/vp&amp;gt; and er continue to the term &amp;lt;vp&amp;gt;write(V)&amp;lt;/vp&amp;gt;, and then &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; is met again, this time there are no more backtrack points &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; fails.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Using parentheses &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; can be nested deeply in clauses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   p(X) = Y :-&lt;br /&gt;
       (X = 1, !, Z = 3 or Z = 7), Y = 2*Z.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We recommend careful usage of &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;. It is mainly intended for usage in test-conditions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   isOutside(X) :-&lt;br /&gt;
       (X &amp;lt; 10 or X &amp;gt; 90), !.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; is a nondeterministic construction, but &amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; can be used as a deterministic pendant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   isOutside(X) :-&lt;br /&gt;
       X &amp;lt; 10 orelse X &amp;gt; 90.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== orelse ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; is a deterministic pendant to the nondeterministic &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;.  &amp;lt;vp&amp;gt;A orelse B&amp;lt;/vp&amp;gt; will succeed if &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds or if &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; succeeds, but it will &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; leave a backtrack point to &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; if &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
The evaluation of an &amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; term &amp;lt;vp&amp;gt;A orelse B&amp;lt;/vp&amp;gt; proceeds as follows: First a backtrack point to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is created and then the first term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is evaluated. If the evaluation of the first term succeeds then the backtrack to the second term (and any backtrack point within it) &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; are removed again and the whole &amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; term succeeds. If the evaluation of the first term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; fails, the backtrack point to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is evaluated.&lt;br /&gt;
&lt;br /&gt;
So an &amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; term does not leave a backtrack point.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp(V) :-&lt;br /&gt;
       (V = 3 orelse V = 7), write(V).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is called we first create a backtrack point to the term &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; and then we evaluate the term &amp;lt;vp&amp;gt;V = 3&amp;lt;/vp&amp;gt;, if &amp;lt;vp&amp;gt;V = 3&amp;lt;/vp&amp;gt; succeeds we remove the backtrack point to &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; again and then continue to &amp;lt;vp&amp;gt;write(V)&amp;lt;/vp&amp;gt;.  If &amp;lt;vp&amp;gt;V = 3&amp;lt;/vp&amp;gt; fails the backtrack point to &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; is effectuated.  If &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; succeeds we continue to &amp;lt;vp&amp;gt;write(V)&amp;lt;/vp&amp;gt;, if &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; fails the entire &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; predicate will fail.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== otherwise ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;otherwise&amp;lt;/vp&amp;gt; is an expression operator; though it has control flow that makes it resemble the logical operators. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;A otherwise B&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an expression (&amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; must be expressions).  If the evaluation of &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds by evaluating to the value VA then &amp;lt;vp&amp;gt;A otherwise B&amp;lt;/vp&amp;gt; evaluates to VA, otherwise (i.e. if the evaluation of &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; fails) then &amp;lt;vp&amp;gt;A otherwise B&amp;lt;/vp&amp;gt; will be the result of evaluating &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;otherwise&amp;lt;/vp&amp;gt; is right associative:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;A otherwise B otherwise C&lt;br /&gt;
=&amp;gt;&lt;br /&gt;
A otherwise (B otherwise C)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It has lower precedence than all other expression operators, but higher than relational operators:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;V &amp;lt; A + tryGet() otherwise 9&lt;br /&gt;
=&amp;gt;&lt;br /&gt;
V &amp;lt; ((A + tryGet()) otherwise 9)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;core&amp;lt;/vp&amp;gt; have been enriched with a predicate &amp;lt;vp&amp;gt;isSome&amp;lt;/vp&amp;gt; for providing default values for &amp;lt;vp&amp;gt;core::optional&amp;lt;/vp&amp;gt; matching:&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;V = isSome(Optional) otherwise 0&amp;lt;/vip&amp;gt;&lt;br /&gt;
If &amp;lt;vp&amp;gt;Optional&amp;lt;/vp&amp;gt; have the form &amp;lt;vp&amp;gt;some(X)&amp;lt;/vp&amp;gt; then &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; will get the value &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; otherwise &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; will get the value &amp;lt;vp&amp;gt;0&amp;lt;/vp&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
==== not ====&lt;br /&gt;
&lt;br /&gt;
The {{lang2|Built-in_entities|not|not/1}} takes a term as the argument. The evaluation of &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; first evaluates &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt;. If &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds, then &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; fails, if &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; fails, then &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
Notice that &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; will never bind any variables, because if &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; succeeds then &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; has failed, and a failed term does not bind anything. If &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; on the other hand fails, it cannot bind any variables either, because then the term itself failed.&lt;br /&gt;
&lt;br /&gt;
Also notice that &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; can never succeed with backtrack points, because if &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; succeeds then &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; have failed, and a failed term cannot contain any backtrack points. This in turn means that all possibilities of success in &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; have been exhausted.&lt;br /&gt;
&lt;br /&gt;
==== cut (!) ====&lt;br /&gt;
&lt;br /&gt;
Cut &amp;quot;&amp;lt;vp&amp;gt;!&amp;lt;/vp&amp;gt;&amp;quot; removes all backtrack points created since the entrance to the current predicate, this means all backtrack points to subsequent clauses, plus backtrack points in predicate calls made in the current clause before the &amp;quot;&amp;lt;vp&amp;gt;!&amp;lt;/vp&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Cut&amp;gt;:&lt;br /&gt;
    !&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp(X) :-&lt;br /&gt;
       X &amp;gt; 7,&lt;br /&gt;
       !,&lt;br /&gt;
       write(&amp;quot;Greater than seven&amp;quot;).&lt;br /&gt;
   ppp(_X) :-&lt;br /&gt;
       write(&amp;quot;Not greater than seven&amp;quot;).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is executed, there is first created a backtrack point to the second clause, and then the first clause is executed. If the test &amp;quot;&amp;lt;vp&amp;gt;X &amp;gt; 7&amp;lt;/vp&amp;gt;&amp;quot; succeeds then the cut &amp;quot;&amp;lt;vp&amp;gt;!&amp;lt;/vp&amp;gt;&amp;quot; is reached. This cut &amp;quot;&amp;lt;vp&amp;gt;!&amp;lt;/vp&amp;gt;&amp;quot; will remove the backtrack point to the second clause.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp() :-&lt;br /&gt;
       qqq(X),&lt;br /&gt;
       X &amp;gt; 7,&lt;br /&gt;
       !,&lt;br /&gt;
       write(&amp;quot;Found one&amp;quot;).&lt;br /&gt;
   ppp() :-&lt;br /&gt;
       write(&amp;quot;Did not find one&amp;quot;).&lt;br /&gt;
clauses&lt;br /&gt;
   qqq(3).&lt;br /&gt;
   qqq(12).&lt;br /&gt;
   qqq(13).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is executed it first creates a backtrack point to the second &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; clause and then &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; is called. The &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; will create a backtrack point to the second &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; clause and execute the first clause, thereby returning the value &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt;. In &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; variable &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is bound to this value and then compared to &amp;lt;vp&amp;gt;7&amp;lt;/vp&amp;gt;. This test fails and, therefore, the control backtracks to the second clause of &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before executing the second clause a new backtrack point to the third clause of &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; is created and then the second clause returns &amp;lt;vp&amp;gt;12&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This time the test against &amp;lt;vp&amp;gt;7&amp;lt;/vp&amp;gt; succeeds and, therefore, the cut is executed. This cut will remove both the backtrack point left in &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; as well as the backtrack point to the second clause of &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== cut Scopes =====&lt;br /&gt;
&lt;br /&gt;
A cut scope is a scope to which the effect of a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is limited. Meaning that if a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is met within a cut scope then only backtrack points within that scope are discarded, while backtrack points outside (i.e. prior to) the cut scope remains.&lt;br /&gt;
&lt;br /&gt;
The clauses of a predicate is a cut scope. Meeting a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; will (at most) discard the backtrack points that was created after entrance to the predicate.  Backtrack points created before entrance to the predicate will remain.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   aaa() :- p1_nd(), qqq().&lt;br /&gt;
   qqq() :- p2_nd(), !.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;aaa&amp;lt;/vp&amp;gt; calls &amp;lt;vp&amp;gt;p1_nd&amp;lt;/vp&amp;gt;, which leaves a backtrack point, and then it calls &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt;. &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; calls &amp;lt;vp&amp;gt;p2_nd&amp;lt;/vp&amp;gt;, which also leaves a backtrack point. Then we meet a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt;. This &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is in the &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt;-scope of the &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; predicate, so it is only the backtrack point in &amp;lt;vp&amp;gt;p2_nd&amp;lt;/vp&amp;gt; which is discarded, the one in &amp;lt;vp&amp;gt;p1_nd&amp;lt;/vp&amp;gt; remains.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Several terms introduce cut scopes (see the respective terms: {{lang2|Terms|List_Comprehension|list comprehension}}, {{lang2|Terms|if-then-else|if-then-else}}, {{lang2|Terms|foreach|foreach}}). Here we will use &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; to illustrate the effect of cut scopes.  Consider the schematic &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;if Cond then T1 else T2 end if&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The condition &amp;lt;vp&amp;gt;Cond&amp;lt;/vp&amp;gt; is a cut-scope, meaning that a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; inside &amp;lt;vp&amp;gt;Cond&amp;lt;/vp&amp;gt; will only have effect inside &amp;lt;vp&amp;gt;Cond&amp;lt;/vp&amp;gt;. &amp;lt;vp&amp;gt;Cut&amp;lt;/vp&amp;gt;s inside &amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt;, on the other hand, have effect outside the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; statement.&lt;br /&gt;
&lt;br /&gt;
Consider this code fragment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;X = getMember_nd([3,1,2]),&lt;br /&gt;
if X = getMember_nd([3,3]), ! then&lt;br /&gt;
   write(X)&lt;br /&gt;
else&lt;br /&gt;
   !&lt;br /&gt;
end if,&lt;br /&gt;
fail&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt; is a nondeterministic predicate. The evaluation of this code will go as follows. First &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is bound to &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt; leaves a backtrack point (so that &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; can later become &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt; and then even &amp;lt;vp&amp;gt;2&amp;lt;/vp&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Then we evaluate the condition in the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term. The first part of this condition succeeds as &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt; is a member of &amp;lt;vp&amp;gt;[3,3]&amp;lt;/vp&amp;gt;. The first part also leaves a backtrack point, so that it can be examined whether &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is a member several times.&lt;br /&gt;
&lt;br /&gt;
Now we meet a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt;. This &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is inside the condition part of an &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; statement, so it only has local effect, meaning that it only discards the backtrack point in the second &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt;, but leaves the backtrack point in the first &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt; predicate.&lt;br /&gt;
&lt;br /&gt;
The whole condition succeeds and we enter the then-part and write out &amp;quot;&amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
After the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; we meet &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt;, which backtracks us to the first &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt; then binds &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;, and leaves a backtrack point (so that &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; can later become &amp;lt;vp&amp;gt;2&amp;lt;/vp&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Then we evaluate the condition in the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term. The first part of this condition fails as &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt; is not a member of &amp;lt;vp&amp;gt;[3,3]&amp;lt;/vp&amp;gt;. So we enter the &amp;lt;vp&amp;gt;else&amp;lt;/vp&amp;gt;-part.&lt;br /&gt;
&lt;br /&gt;
Here we meet a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt;. This &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is in the &amp;lt;vp&amp;gt;else&amp;lt;/vp&amp;gt;-part of a conditional term so it has effect outside the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term and subsequently it discards the backtrack point in the first &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When we meet the &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; after the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term there are no more backtrack points in the code and it will fail. So all in all &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; never becomes &amp;lt;vp&amp;gt;2&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== fail/0 and succeed/0 ====&lt;br /&gt;
&lt;br /&gt;
{{lang2|Built-in_entities|fail|fail/0}} and {{lang2|Built-in_entities|succeed|succeed/0}} are two built-in nullary predicates. {{lang2|Built-in_entities|fail|fail/0}} always fails and {{lang2|Built-in_entities|succeed|succeed/0}} always succeeds, besides this the predicates have no effect.&lt;br /&gt;
&lt;br /&gt;
=== in ===&lt;br /&gt;
{{:Language Reference/Terms/in}}&lt;br /&gt;
=== List Comprehension ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;ListComprehensionTerm&amp;gt; :&lt;br /&gt;
    [ &amp;lt;Term&amp;gt; || &amp;lt;Term&amp;gt; ]&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list comprehension term is a list expression. Consider this schematic term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;[ Exp || Gen ]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt; is (typically) a &amp;lt;vp&amp;gt;nondeterm&amp;lt;/vp&amp;gt; term. &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt; is evaluated for each solution of &amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt;, and the resulting &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt;&amp;#039;s are collected in a list. The &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt; corresponding to the first solution of &amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt; is the first element in the list, etc. This list is the result of the list comprehension term. &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt; must be procedure (or erroneous). Both &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt; are {{lang2|Terms|Cut_Scopes|cut scopes}}.&lt;br /&gt;
&lt;br /&gt;
The list comprehension (normally) reads: The list of &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt;&amp;#039;s such that &amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;[ X || X = getMember_nd(L), X mod 2 = 0 ]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This reads the list of &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt;&amp;#039;s such that &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is in &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is even. So this expression is the even numbers of &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;[ X + 1 || X = getMember_nd(L), X mod 2 = 0 ]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the collected expression is more complex. This makes say the term more awkward:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;the list of (X+1)&amp;#039;s such that ...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This expression again finds the even elements in &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt;, but the resulting list contains all these values incremented.&lt;br /&gt;
&lt;br /&gt;
This term is completely equivalent to this term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;[ Y || X = getMember_nd(L), X mod 2 = 0 , Y = X+1 ]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This term is easier to say:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;The list of Y&amp;#039;s such that (there exists an) X which is member of L, and which is even, and Y is X+1.&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Anonymous Predicates ===&lt;br /&gt;
{{:Language Reference/Terms/Anonymous Predicates}}&lt;br /&gt;
=== Object Member Access ===&lt;br /&gt;
Whenever we have a reference to an object, we can access the object member predicates of that object.&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;MemberAccess&amp;gt;:&lt;br /&gt;
    &amp;lt;Term&amp;gt; : &amp;lt;Identifier&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Currently, the {{lang|Terms|term}} must be a variable or a fact variable).&lt;br /&gt;
&lt;br /&gt;
The {{lang2|Lexical_Elements|Identifiers|identifier}} must have the type of the {{lang|Terms|term}}.&lt;br /&gt;
&lt;br /&gt;
Inside an implementation object member predicates can be invoked without reference to an object, because &amp;quot;&amp;lt;vp&amp;gt;This&amp;lt;/vp&amp;gt;&amp;quot; is subsumed, see {{lang2|Basic_Concepts|Scoping_&amp;amp;_Visibility|Scoping}}.&lt;br /&gt;
&lt;br /&gt;
=== Object Expressions ===&lt;br /&gt;
&lt;br /&gt;
An object expressions is an expressions that evaluates to an object.  Like anonymous predicates it can capture values from and access facts in the context it appears in.&lt;br /&gt;
&lt;br /&gt;
The syntax is like a regular class implementation without a name, but with a construction interface:&lt;br /&gt;
&lt;br /&gt;
{{Example|&amp;lt;vip&amp;gt;Object = &lt;br /&gt;
    implement : observer&lt;br /&gt;
      clauses&lt;br /&gt;
        onNext(A) :- F(toString(A)).&lt;br /&gt;
        onCompletion() :- F(&amp;quot;\n&amp;quot;).&lt;br /&gt;
    end implement&amp;lt;/vip&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
the &amp;lt;vp&amp;gt;implement ... end implement&amp;lt;/vp&amp;gt; part is an object expression.&lt;br /&gt;
To make object expressions a lightweight construction the keyword &amp;lt;vp&amp;gt;clauses&amp;lt;/vp&amp;gt; is implicit/optional at the beginning of the scope (unless the scope has &amp;lt;vp&amp;gt;open&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;supports&amp;lt;/vp&amp;gt; or &amp;lt;vp&amp;gt;inherits&amp;lt;/vp&amp;gt; qualifications).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;ObjectExpression&amp;gt;: one of&lt;br /&gt;
    &amp;lt;FullObjectExpression&amp;gt;&lt;br /&gt;
    &amp;lt;SimpleObjectExpression&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;FullObjectExpression&amp;gt;:&lt;br /&gt;
    implement : &amp;lt;ConstructionType&amp;gt;&lt;br /&gt;
        &amp;lt;ScopeQualifications&amp;gt;&lt;br /&gt;
        &amp;lt;Sections&amp;gt;&lt;br /&gt;
    end implement&lt;br /&gt;
&lt;br /&gt;
&amp;lt;SimpleObjectExpression&amp;gt;:&lt;br /&gt;
    implement : &amp;lt;ConstructionType&amp;gt;&lt;br /&gt;
        &amp;lt;Clause&amp;gt;-dot-term-list-opt&lt;br /&gt;
        &amp;lt;Sections&amp;gt;&lt;br /&gt;
    end implement&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There will be exactly one constructor &amp;lt;vp&amp;gt;new\0&amp;lt;/vp&amp;gt;. Like for other objects you don&amp;#039;t need to supply an implementation if the constructor is &amp;#039;trivial&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;inherits&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;supports&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;open&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;delegate&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;resolve&amp;lt;/vp&amp;gt; works in the same way as in regular implementations.&lt;br /&gt;
&lt;br /&gt;
=== Scoping ===&lt;br /&gt;
&lt;br /&gt;
The predicates can refer to the context like anonymous predicates but can also refer to facts and inherited classes inside the object.&lt;br /&gt;
&lt;br /&gt;
Object expressions are nested within other scopes, these scopes are all visible from the object expression.  If a name is defined in more than one surrounding scope then the reference is to the closest level.  Names from named scopes can be resolved with the scope name, but names from surrounding object expressions must be resolved by means of a variable as described in the &amp;quot;This&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
=== This ===&lt;br /&gt;
&lt;br /&gt;
In a predicate in an object expression the variable &amp;lt;vp&amp;gt;This&amp;lt;/vp&amp;gt; represent the object of the object expression.  There are no predefined names for surrounding &amp;lt;vp&amp;gt;This&amp;lt;/vp&amp;gt; variables.  So if you want to refer to an outer &amp;lt;vp&amp;gt;This&amp;lt;/vp&amp;gt; you will have to put it in another variable e.g. &amp;lt;vp&amp;gt;Outer = This&amp;lt;/vp&amp;gt; and then use that variable inside the object expression.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;...&lt;br /&gt;
    Outer = This,&lt;br /&gt;
    Object = &lt;br /&gt;
        implement : observer&lt;br /&gt;
            onNext(A) :- F(Outer, toString(A))).&lt;br /&gt;
            onCompletion() :- F(Outer, &amp;quot;\n&amp;quot;)).&lt;br /&gt;
        end implement&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Polymorphism (limitation) ===&lt;br /&gt;
&lt;br /&gt;
Occasionally there will be situations where we will need a type variable.  An example would be a predicate &amp;lt;vp&amp;gt;p : () -&amp;gt; observer{A}&amp;lt;/vp&amp;gt; implemented using an object expression. Unfortunately, this is not possible until we get access to the type variables of polymorphic constructions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;&lt;br /&gt;
clauses&lt;br /&gt;
    p(Value) = &lt;br /&gt;
        implement : observer{A} % A is unknown/unbound&lt;br /&gt;
        facts&lt;br /&gt;
            v : A = Value. % A is unknown/unbound&lt;br /&gt;
        clauses&lt;br /&gt;
            onNext(V) :- v := V.&lt;br /&gt;
            onCompleted():- write(v).&lt;br /&gt;
        end implement.&lt;br /&gt;
&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The examples below will be based on &amp;lt;vp&amp;gt;iterator&amp;lt;/vp&amp;gt; object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface iterator&lt;br /&gt;
predicates&lt;br /&gt;
   hasNext : () determ.&lt;br /&gt;
   next : () -&amp;gt; integer.&lt;br /&gt;
end interface iterator&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which we will write using this predicate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    writeAll : (iterator It).&lt;br /&gt;
clauses&lt;br /&gt;
    writeAll(It) :-&lt;br /&gt;
        if It:hasNext() then&lt;br /&gt;
            writef(&amp;quot;%\n&amp;quot;, It:next()),&lt;br /&gt;
            writeAll(It)&lt;br /&gt;
        else&lt;br /&gt;
            write(&amp;quot;&amp;lt;&amp;lt;&amp;lt;end&amp;gt;&amp;gt;&amp;gt;\n&amp;quot;)&lt;br /&gt;
        end if.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Simple  object ====&lt;br /&gt;
&lt;br /&gt;
{{Example|We can write a simple &amp;quot;null&amp;quot; &amp;lt;vp&amp;gt;iterator&amp;lt;/vp&amp;gt; that is finished immediately.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    test1 : ().&lt;br /&gt;
clauses&lt;br /&gt;
    test1() :-&lt;br /&gt;
        It =&lt;br /&gt;
            implement : iterator&lt;br /&gt;
                hasNext() :-&lt;br /&gt;
                    fail.&lt;br /&gt;
                next() = _ :-&lt;br /&gt;
                    exception::raise_error().&lt;br /&gt;
            end implement,&lt;br /&gt;
        writeAll(It).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calling &amp;lt;vp&amp;gt;test1&amp;lt;/vp&amp;gt; will produce&lt;br /&gt;
 &amp;lt;&amp;lt;&amp;lt;end&amp;gt;&amp;gt;&amp;gt;&lt;br /&gt;
 }}&lt;br /&gt;
&lt;br /&gt;
==== Own state====&lt;br /&gt;
&lt;br /&gt;
{{Example|In this example we create an iterator object that har its own fact &amp;lt;vp&amp;gt;n&amp;lt;/vp&amp;gt; which is used to count down from &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    test2 : ().&lt;br /&gt;
clauses&lt;br /&gt;
    test2() :-&lt;br /&gt;
        It =&lt;br /&gt;
            implement : iterator&lt;br /&gt;
                hasNext() :-&lt;br /&gt;
                    n &amp;gt; 0.&lt;br /&gt;
                next() = N :-&lt;br /&gt;
                    N = n,&lt;br /&gt;
                    n := n - 1.&lt;br /&gt;
            facts&lt;br /&gt;
                n : integer := 3.&lt;br /&gt;
            end implement,&lt;br /&gt;
        writeAll(It).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calling &amp;lt;vp&amp;gt;test2&amp;lt;/vp&amp;gt; will produce&lt;br /&gt;
  3&lt;br /&gt;
  2&lt;br /&gt;
  1&lt;br /&gt;
 &amp;lt;&amp;lt;&amp;lt;end&amp;gt;&amp;gt;&amp;gt;&lt;br /&gt;
 }}&lt;br /&gt;
&lt;br /&gt;
==== Capturing values ====&lt;br /&gt;
&lt;br /&gt;
{{Example|The count down object from above can be placed in its own predicate, and we can capture the value to count down &amp;lt;vp&amp;gt;From&amp;lt;/vp&amp;gt; in the context:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    countDown : (integer From) -&amp;gt; iterator It.&lt;br /&gt;
clauses&lt;br /&gt;
    countDown(From) =&lt;br /&gt;
        implement : iterator&lt;br /&gt;
            hasNext() :-&lt;br /&gt;
                n &amp;gt; 0.&lt;br /&gt;
            next() = N :-&lt;br /&gt;
                N = n,&lt;br /&gt;
                n := n - 1.&lt;br /&gt;
        facts&lt;br /&gt;
            n : integer := From.&lt;br /&gt;
        end implement.&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    test3 : ().&lt;br /&gt;
clauses&lt;br /&gt;
    test3() :-&lt;br /&gt;
        It = countDown(2),&lt;br /&gt;
        writeAll(It).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calling &amp;lt;vp&amp;gt;test3&amp;lt;/vp&amp;gt; will produce&lt;br /&gt;
  2&lt;br /&gt;
  1&lt;br /&gt;
 &amp;lt;&amp;lt;&amp;lt;end&amp;gt;&amp;gt;&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Example|Here &amp;lt;vp&amp;gt;map&amp;lt;/vp&amp;gt; create an iterator that maps the values returned  &amp;lt;vp&amp;gt;iterator&amp;lt;/vp&amp;gt; just like it would have modified the values of a list.  Notice how the object expression captures the variables &amp;lt;vp&amp;gt;F&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;It&amp;lt;/vp&amp;gt; and accesses them in its member predicates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    map : (function{integer, integer} Function, iterator It) -&amp;gt; iterator Mapped.&lt;br /&gt;
clauses&lt;br /&gt;
    map(F, It) =&lt;br /&gt;
        implement : iterator&lt;br /&gt;
            hasNext() :-&lt;br /&gt;
                It:hasNext().&lt;br /&gt;
            next() = F(It:next()).&lt;br /&gt;
        end implement.&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    test4 : ().&lt;br /&gt;
clauses&lt;br /&gt;
    test4() :-&lt;br /&gt;
        It1 = countDown(2),&lt;br /&gt;
        It2 = map({ (V) = V + 7 }, It1),&lt;br /&gt;
        writeAll(It2).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calling &amp;lt;vp&amp;gt;test4&amp;lt;/vp&amp;gt; will produce&lt;br /&gt;
  9&lt;br /&gt;
  8&lt;br /&gt;
 &amp;lt;&amp;lt;&amp;lt;end&amp;gt;&amp;gt;&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Capturing a fact ====&lt;br /&gt;
&lt;br /&gt;
{{Example|Here the fact &amp;lt;vp&amp;gt;count&amp;lt;/vp&amp;gt; from the context is captured and manipulated from within the object expression.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class facts&lt;br /&gt;
    count : integer := 3.&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    test5 : ().&lt;br /&gt;
clauses&lt;br /&gt;
    test5() :-&lt;br /&gt;
        It =&lt;br /&gt;
            implement : iterator&lt;br /&gt;
                hasNext() :-&lt;br /&gt;
                    count &amp;gt; 0.&lt;br /&gt;
                next() = N :-&lt;br /&gt;
                    N = count,&lt;br /&gt;
                    count := count - 1.&lt;br /&gt;
            end implement,&lt;br /&gt;
        writeAll(It).&lt;br /&gt;
&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calling &amp;lt;vp&amp;gt;test5&amp;lt;/vp&amp;gt; will produce&lt;br /&gt;
  3&lt;br /&gt;
  2&lt;br /&gt;
  1&lt;br /&gt;
 &amp;lt;&amp;lt;&amp;lt;end&amp;gt;&amp;gt;&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== inherits ====&lt;br /&gt;
&lt;br /&gt;
{{Example|Suppose we have a class &amp;lt;vp&amp;gt;randomIterator&amp;lt;/vp&amp;gt; which generates random numbers and supports the &amp;lt;vp&amp;gt;iterator&amp;lt;/vp&amp;gt; iterator.&lt;br /&gt;
We can inherit from this iterator to create a iterator that &amp;quot;throws a dice&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    test6 : ().&lt;br /&gt;
clauses&lt;br /&gt;
    test6() :-&lt;br /&gt;
        Dice =&lt;br /&gt;
            implement : iterator inherits randomIterator&lt;br /&gt;
            clauses&lt;br /&gt;
                next() = randomIterator::next() mod 6 + 1.&lt;br /&gt;
            end implement,&lt;br /&gt;
        foreach _ = std::cIterate(5) do&lt;br /&gt;
            writef(&amp;quot;Dice : %\n&amp;quot;, Dice:next())&lt;br /&gt;
        end foreach.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By inheriting &amp;lt;vp&amp;gt;randomIterator&amp;lt;/vp&amp;gt; we get the implementation of &amp;lt;vp&amp;gt;hasNext&amp;lt;/vp&amp;gt; and only need to implement &amp;lt;vp&amp;gt;next&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Notice that it is necessary to use the &amp;lt;vp&amp;gt;clauses&amp;lt;/vp&amp;gt; keyword in this case because the class has an &amp;lt;vp&amp;gt;inherits&amp;lt;/vp&amp;gt; qualification.&lt;br /&gt;
&lt;br /&gt;
Assuming that &amp;lt;vp&amp;gt;randomIterator&amp;lt;/vp&amp;gt; will never end, we just iterate &amp;lt;vp&amp;gt;5&amp;lt;/vp&amp;gt; times.&lt;br /&gt;
&lt;br /&gt;
Calling &amp;lt;vp&amp;gt;test5&amp;lt;/vp&amp;gt; will produce (something like):&lt;br /&gt;
 Dice : 1&lt;br /&gt;
 Dice : 2&lt;br /&gt;
 Dice : 4&lt;br /&gt;
 Dice : 2&lt;br /&gt;
 Dice : 3&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Domain, Functor, and Constant Access ===&lt;br /&gt;
&lt;br /&gt;
Domains, functors, and constants are all accessed as if they are class members. Even if they are declared in an interface. This means that when they are qualified, then they are always qualified with class/interface name and a double colon.&lt;br /&gt;
&lt;br /&gt;
=== foreach ===&lt;br /&gt;
{{:Language Reference/Terms/Foreach}}&lt;br /&gt;
=== if-then-else ===&lt;br /&gt;
{{:Language Reference/Terms/If-then-else}}&lt;br /&gt;
=== try-catch-finally ===&lt;br /&gt;
{{:Language Reference/Terms/Try-catch-finally}}&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Ide/Key_Bindings&amp;diff=4928</id>
		<title>Ide/Key Bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Ide/Key_Bindings&amp;diff=4928"/>
		<updated>2024-02-27T10:35:20Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: remove old accelerators&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{ideNavbar|Key Bindings}}&lt;br /&gt;
&lt;br /&gt;
The table below shows Visual Prolog accelerator keys by functions.&lt;br /&gt;
&lt;br /&gt;
:{| {{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Edit&lt;br /&gt;
|-&lt;br /&gt;
| Copy&lt;br /&gt;
| Ctrl-C or Ctrl-Ins&lt;br /&gt;
|-&lt;br /&gt;
| Copy  Position&lt;br /&gt;
| Ctrl-Alt-Shift-C&lt;br /&gt;
|-&lt;br /&gt;
| Cut&lt;br /&gt;
| Ctrl-X or Shift-Del&lt;br /&gt;
|-&lt;br /&gt;
| Paste&lt;br /&gt;
| Ctrl-V or Shift-Ins&lt;br /&gt;
|-&lt;br /&gt;
| Undo&lt;br /&gt;
| Ctrl-Z&lt;br /&gt;
|-&lt;br /&gt;
| Redo&lt;br /&gt;
| Ctrl-Y&lt;br /&gt;
|-&lt;br /&gt;
| Select All&lt;br /&gt;
| Ctrl-A&lt;br /&gt;
|-&lt;br /&gt;
| Select Current Word&lt;br /&gt;
| Ctrl-W&lt;br /&gt;
|-&lt;br /&gt;
| Delete&lt;br /&gt;
| Del&lt;br /&gt;
|-&lt;br /&gt;
| Delete Line&lt;br /&gt;
| Ctrl-Shift-L&lt;br /&gt;
|-&lt;br /&gt;
| Delete to End of Line&lt;br /&gt;
| Ctrl-Shift-E&lt;br /&gt;
|-&lt;br /&gt;
| Delete to Start of Line&lt;br /&gt;
| Ctrl-Shift-H&lt;br /&gt;
|-&lt;br /&gt;
| Word Delete To End&lt;br /&gt;
| Ctrl-Del&lt;br /&gt;
|-&lt;br /&gt;
| Replace&lt;br /&gt;
| Ctrl-H&lt;br /&gt;
|-&lt;br /&gt;
| Lower Case&lt;br /&gt;
| Ctrl-U&lt;br /&gt;
|-&lt;br /&gt;
| Upper Case&lt;br /&gt;
| Ctrl-Shift-U&lt;br /&gt;
|-&lt;br /&gt;
| Toggle Case&lt;br /&gt;
| Ctrl-Alt-U&lt;br /&gt;
|-&lt;br /&gt;
| Zoom In&lt;br /&gt;
| Ctrl-[+] or Ctrl-Mouse wheel up&lt;br /&gt;
|-&lt;br /&gt;
| Zoom Out&lt;br /&gt;
| Ctrl-[-] or Ctrl-Mouse wheel down&lt;br /&gt;
|-&lt;br /&gt;
| Zoom to Normal&lt;br /&gt;
| Ctrl-0&lt;br /&gt;
|-&lt;br /&gt;
| Comment Line(s)&lt;br /&gt;
| Ctrl-Alt-5&lt;br /&gt;
|-&lt;br /&gt;
| Uncomment Line(s)&lt;br /&gt;
| Ctrl-Alt-Shift-5&lt;br /&gt;
|-&lt;br /&gt;
| Duplcate Line&lt;br /&gt;
| Ctrl-Alt-R&lt;br /&gt;
|-&lt;br /&gt;
| Add qualification&lt;br /&gt;
| Ctrl-Shift-S&lt;br /&gt;
|-&lt;br /&gt;
| Insert Date Stamp&lt;br /&gt;
| Ctrl-Shift-Y&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Navigation&lt;br /&gt;
|-&lt;br /&gt;
| Find&lt;br /&gt;
| Ctrl-F&lt;br /&gt;
|-&lt;br /&gt;
| Find in Files&lt;br /&gt;
| Ctrl-Shift-F&lt;br /&gt;
|-&lt;br /&gt;
| Find Next&lt;br /&gt;
| F3&lt;br /&gt;
|-&lt;br /&gt;
| Find Previous&lt;br /&gt;
| Shift-F3&lt;br /&gt;
|-&lt;br /&gt;
| Last Searchs Result Window&lt;br /&gt;
| Ctrl-Alt-S&lt;br /&gt;
|-&lt;br /&gt;
| Locate in Project Tree&lt;br /&gt;
| Ctrl-T&lt;br /&gt;
|-&lt;br /&gt;
| Go Back&lt;br /&gt;
| Ctrl-Shift-F8&lt;br /&gt;
|-&lt;br /&gt;
| Go to Address&lt;br /&gt;
| Ctrl-G&lt;br /&gt;
|-&lt;br /&gt;
| Go to Definition&lt;br /&gt;
| F12&lt;br /&gt;
Ctrl-Shift-C&lt;br /&gt;
|-&lt;br /&gt;
| Go To Declaration&lt;br /&gt;
| Ctrl-F12&lt;br /&gt;
Ctrl-Shift-D&lt;br /&gt;
|-&lt;br /&gt;
| Go to Related Files&lt;br /&gt;
| Ctrl-R&lt;br /&gt;
|-&lt;br /&gt;
| Go to Executing Predicate Source&lt;br /&gt;
| Ctrl-E&lt;br /&gt;
|-&lt;br /&gt;
| Go To Line&lt;br /&gt;
| Ctrl-F2&lt;br /&gt;
|-&lt;br /&gt;
| Go To Position on Clipboard&lt;br /&gt;
| Shift-F2&lt;br /&gt;
|-&lt;br /&gt;
| Go To Next Error&lt;br /&gt;
| F8&lt;br /&gt;
|-&lt;br /&gt;
| Go To Previous Error&lt;br /&gt;
| Shift-F8&lt;br /&gt;
|-&lt;br /&gt;
| Go To Next Bookmark&lt;br /&gt;
| F6&lt;br /&gt;
|-&lt;br /&gt;
| Go To Previous Bookmark&lt;br /&gt;
| Shift-F6&lt;br /&gt;
|-&lt;br /&gt;
| Window Navigation Dialog&lt;br /&gt;
| Ctrl-Tab or Ctrl-F6&lt;br /&gt;
|-&lt;br /&gt;
| Set/Remove bookmark&lt;br /&gt;
| Ctrl-K&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Compile&lt;br /&gt;
|-&lt;br /&gt;
| Build&lt;br /&gt;
| Ctrl-Shift-B&lt;br /&gt;
|-&lt;br /&gt;
| Stop Build&lt;br /&gt;
| Ctrl-Break&lt;br /&gt;
|-&lt;br /&gt;
| Compile&lt;br /&gt;
| Ctrl-F7&lt;br /&gt;
|-&lt;br /&gt;
| Rebuild Project&lt;br /&gt;
| Ctrl-Shift-Alt-B&lt;br /&gt;
|-&lt;br /&gt;
| Run&lt;br /&gt;
| Ctrl-F5&lt;br /&gt;
|-&lt;br /&gt;
| Run in Window&lt;br /&gt;
| Alt-F5&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Debug&lt;br /&gt;
|-&lt;br /&gt;
| Start Debugging &lt;br /&gt;
| F5&lt;br /&gt;
|-&lt;br /&gt;
| Run Debugging Skipping Soft Breakpoints&lt;br /&gt;
| Ctrl-Shift-F10&lt;br /&gt;
|-&lt;br /&gt;
| Stop Debugging&lt;br /&gt;
| Shift-F5&lt;br /&gt;
|-&lt;br /&gt;
| Restart Debugging&lt;br /&gt;
| Ctrl-Shift-F5&lt;br /&gt;
|-&lt;br /&gt;
| CallStack Window&lt;br /&gt;
| Ctrl-Alt-C&lt;br /&gt;
|-&lt;br /&gt;
| Variable Window&lt;br /&gt;
| Ctrl-Alt-V&lt;br /&gt;
|-&lt;br /&gt;
| Watch Window&lt;br /&gt;
| Ctrl-Alt-W&lt;br /&gt;
|-&lt;br /&gt;
| Facts Window&lt;br /&gt;
| Ctrl-Alt-F&lt;br /&gt;
|-&lt;br /&gt;
| Threads Window&lt;br /&gt;
| Ctrl-Alt-H&lt;br /&gt;
|-&lt;br /&gt;
| Modules Window&lt;br /&gt;
| Ctrl-Alt-L&lt;br /&gt;
|-&lt;br /&gt;
| Exceptions Window&lt;br /&gt;
| Ctrl-Alt-X&lt;br /&gt;
|-&lt;br /&gt;
| Breakpoints Window&lt;br /&gt;
| Ctrl-Alt-B&lt;br /&gt;
|-&lt;br /&gt;
| Bookmarks Window&lt;br /&gt;
| Ctrl-Alt-K&lt;br /&gt;
|-&lt;br /&gt;
| Disassembly Window&lt;br /&gt;
| Ctrl-Alt-D&lt;br /&gt;
|-&lt;br /&gt;
| Disassembly Window from Current Line&lt;br /&gt;
| Ctrl-D&lt;br /&gt;
|-&lt;br /&gt;
| Registers window&lt;br /&gt;
| Ctrl-Alt-G&lt;br /&gt;
|-&lt;br /&gt;
| Memory Dump 1 Window&lt;br /&gt;
| Ctrl-Alt-M&lt;br /&gt;
|-&lt;br /&gt;
| Toggle Breakpoint&lt;br /&gt;
| F9&lt;br /&gt;
|-&lt;br /&gt;
| Toggle Hard/Soft Breakpoint&lt;br /&gt;
| Ctrl-F9&lt;br /&gt;
|-&lt;br /&gt;
| Breakpoint Properties&lt;br /&gt;
| Alt-F9&lt;br /&gt;
|-&lt;br /&gt;
| Step Into&lt;br /&gt;
| F11&lt;br /&gt;
|-&lt;br /&gt;
| Step out of&lt;br /&gt;
| Shift-F11&lt;br /&gt;
|-&lt;br /&gt;
| Step Over&lt;br /&gt;
| F10&lt;br /&gt;
|-&lt;br /&gt;
| Run To Cursor&lt;br /&gt;
| Ctrl-F10&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Project&lt;br /&gt;
|-&lt;br /&gt;
| Add Module to Project&lt;br /&gt;
| Ctrl-Shift-A&lt;br /&gt;
|-&lt;br /&gt;
| Create Project Item&lt;br /&gt;
| Ctrl-N&lt;br /&gt;
|-&lt;br /&gt;
| Create Project Item in Existing Package&lt;br /&gt;
| Ctrl-Alt-N&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
IDE&lt;br /&gt;
|-&lt;br /&gt;
| Close all other editors&lt;br /&gt;
| Ctrl-Q&lt;br /&gt;
|-&lt;br /&gt;
| Prune open editors&lt;br /&gt;
| Ctrl-Shift-Q&lt;br /&gt;
|-&lt;br /&gt;
| Close the active window&lt;br /&gt;
| Ctrl-F4&lt;br /&gt;
|-&lt;br /&gt;
| Project window&lt;br /&gt;
| Ctrl-Alt-P&lt;br /&gt;
|-&lt;br /&gt;
| Project Settings&lt;br /&gt;
| Alt-F7&lt;br /&gt;
|-&lt;br /&gt;
| Open File&lt;br /&gt;
| Ctrl-O&lt;br /&gt;
|-&lt;br /&gt;
| Save File&lt;br /&gt;
| F2&lt;br /&gt;
|-&lt;br /&gt;
| Save Project&lt;br /&gt;
| Ctrl-S&lt;br /&gt;
|-&lt;br /&gt;
| Source Browser&lt;br /&gt;
| Ctrl-B&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Other&lt;br /&gt;
|-&lt;br /&gt;
| Help&lt;br /&gt;
| F1&lt;br /&gt;
|-&lt;br /&gt;
| Messages Window&lt;br /&gt;
| Ctrl-Alt-O&lt;br /&gt;
|-&lt;br /&gt;
| Error/Warnings Window&lt;br /&gt;
| Ctrl-Alt-E&lt;br /&gt;
|-&lt;br /&gt;
| Print&lt;br /&gt;
| Ctrl-P&lt;br /&gt;
|-&lt;br /&gt;
| Exit IDE&lt;br /&gt;
| Alt-F4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ru:IDE:Горячие Клавиши]]&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Ide/Key_Bindings&amp;diff=4927</id>
		<title>Ide/Key Bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Ide/Key_Bindings&amp;diff=4927"/>
		<updated>2024-02-25T12:46:47Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: remove old accelerators&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{ideNavbar|Key Bindings}}&lt;br /&gt;
&lt;br /&gt;
The table below shows Visual Prolog accelerator keys by functions.&lt;br /&gt;
&lt;br /&gt;
:{| {{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Edit&lt;br /&gt;
|-&lt;br /&gt;
| Copy&lt;br /&gt;
| Ctrl-C or Ctrl-Ins&lt;br /&gt;
|-&lt;br /&gt;
| Copy  Position&lt;br /&gt;
| Ctrl-Alt-Shift-C&lt;br /&gt;
|-&lt;br /&gt;
| Cut&lt;br /&gt;
| Ctrl-X or Shift-Del&lt;br /&gt;
|-&lt;br /&gt;
| Paste&lt;br /&gt;
| Ctrl-V or Shift-Ins&lt;br /&gt;
|-&lt;br /&gt;
| Undo&lt;br /&gt;
| Ctrl-Z&lt;br /&gt;
|-&lt;br /&gt;
| Redo&lt;br /&gt;
| Ctrl-Y&lt;br /&gt;
|-&lt;br /&gt;
| Select All&lt;br /&gt;
| Ctrl-A&lt;br /&gt;
|-&lt;br /&gt;
| Select Current Word&lt;br /&gt;
| Ctrl-W&lt;br /&gt;
|-&lt;br /&gt;
| Delete&lt;br /&gt;
| Del&lt;br /&gt;
|-&lt;br /&gt;
| Delete Line&lt;br /&gt;
| Ctrl-Shift-L&lt;br /&gt;
|-&lt;br /&gt;
| Delete to End of Line&lt;br /&gt;
| Ctrl-Shift-E&lt;br /&gt;
|-&lt;br /&gt;
| Delete to Start of Line&lt;br /&gt;
| Ctrl-Shift-H&lt;br /&gt;
|-&lt;br /&gt;
| Word Delete To End&lt;br /&gt;
| Ctrl-Del&lt;br /&gt;
|-&lt;br /&gt;
| Replace&lt;br /&gt;
| Ctrl-H&lt;br /&gt;
|-&lt;br /&gt;
| Lower Case&lt;br /&gt;
| Ctrl-U&lt;br /&gt;
|-&lt;br /&gt;
| Upper Case&lt;br /&gt;
| Ctrl-Shift-U&lt;br /&gt;
|-&lt;br /&gt;
| Toggle Case&lt;br /&gt;
| Ctrl-Alt-U&lt;br /&gt;
|-&lt;br /&gt;
| Zoom In&lt;br /&gt;
| Ctrl-[+] or Ctrl-Mouse wheel up&lt;br /&gt;
|-&lt;br /&gt;
| Zoom Out&lt;br /&gt;
| Ctrl-[-] or Ctrl-Mouse wheel down&lt;br /&gt;
|-&lt;br /&gt;
| Zoom to Normal&lt;br /&gt;
| Ctrl-0&lt;br /&gt;
|-&lt;br /&gt;
| Comment Line(s)&lt;br /&gt;
| Ctrl-Alt-5&lt;br /&gt;
|-&lt;br /&gt;
| Uncomment Line(s)&lt;br /&gt;
| Ctrl-Alt-Shift-5&lt;br /&gt;
|-&lt;br /&gt;
| Duplcate Line&lt;br /&gt;
| Ctrl-Alt-R&lt;br /&gt;
|-&lt;br /&gt;
| Add qualification&lt;br /&gt;
| Ctrl-Shift-S&lt;br /&gt;
|-&lt;br /&gt;
| Insert Date Stamp&lt;br /&gt;
| Ctrl-Shift-Y&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Navigation&lt;br /&gt;
|-&lt;br /&gt;
| Find&lt;br /&gt;
| Ctrl-F&lt;br /&gt;
|-&lt;br /&gt;
| Find in Files&lt;br /&gt;
| Ctrl-Shift-F&lt;br /&gt;
|-&lt;br /&gt;
| Find Next&lt;br /&gt;
| F3&lt;br /&gt;
|-&lt;br /&gt;
| Find Previous&lt;br /&gt;
| Shift-F3&lt;br /&gt;
|-&lt;br /&gt;
| Last Searchs Result Window&lt;br /&gt;
| Ctrl-Alt-S&lt;br /&gt;
|-&lt;br /&gt;
| Locate in Project Tree&lt;br /&gt;
| Ctrl-T&lt;br /&gt;
|-&lt;br /&gt;
| Go Back&lt;br /&gt;
| Ctrl-Shift-F8&lt;br /&gt;
|-&lt;br /&gt;
| Go to Address&lt;br /&gt;
| Ctrl-G&lt;br /&gt;
|-&lt;br /&gt;
| Go to Definition&lt;br /&gt;
| F12&lt;br /&gt;
Ctrl-Shift-C&lt;br /&gt;
|-&lt;br /&gt;
| Go To Declaration&lt;br /&gt;
| Ctrl-F12&lt;br /&gt;
Ctrl-Shift-D&lt;br /&gt;
|-&lt;br /&gt;
| Go to Related Files&lt;br /&gt;
| Ctrl-R&lt;br /&gt;
|-&lt;br /&gt;
| Go to Executing Predicate Source&lt;br /&gt;
| Ctrl-E&lt;br /&gt;
|-&lt;br /&gt;
| Go To Line&lt;br /&gt;
| Ctrl-F2&lt;br /&gt;
|-&lt;br /&gt;
| Go To Position on Clipboard&lt;br /&gt;
| Shift-F2&lt;br /&gt;
|-&lt;br /&gt;
| Go To Next Error&lt;br /&gt;
| F8&lt;br /&gt;
|-&lt;br /&gt;
| Go To Previous Error&lt;br /&gt;
| Shift-F8&lt;br /&gt;
|-&lt;br /&gt;
| Go To Next Bookmark&lt;br /&gt;
| F6&lt;br /&gt;
|-&lt;br /&gt;
| Go To Previous Bookmark&lt;br /&gt;
| Shift-F6&lt;br /&gt;
|-&lt;br /&gt;
| Window Navigation Dialog&lt;br /&gt;
| Ctrl-Tab or Ctrl-F6&lt;br /&gt;
|-&lt;br /&gt;
| Set/Remove bookmark&lt;br /&gt;
| Ctrl-K&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Compile&lt;br /&gt;
|-&lt;br /&gt;
| Build&lt;br /&gt;
| Ctrl-Shift-B&lt;br /&gt;
|-&lt;br /&gt;
| Stop Build&lt;br /&gt;
| Ctrl-Break&lt;br /&gt;
|-&lt;br /&gt;
| Compile&lt;br /&gt;
| Ctrl-F7&lt;br /&gt;
|-&lt;br /&gt;
| Rebuild Project&lt;br /&gt;
| Ctrl-Shift-Alt-B&lt;br /&gt;
|-&lt;br /&gt;
| Run&lt;br /&gt;
| Ctrl-F5&lt;br /&gt;
|-&lt;br /&gt;
| Run in Window&lt;br /&gt;
| Alt-F5&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Debug&lt;br /&gt;
|-&lt;br /&gt;
| Start Debugging &lt;br /&gt;
| F5&lt;br /&gt;
|-&lt;br /&gt;
| Run Debugging Skipping Soft Breakpoints&lt;br /&gt;
| Ctrl-Shift-F10&lt;br /&gt;
|-&lt;br /&gt;
| Stop Debugging&lt;br /&gt;
| Shift-F5&lt;br /&gt;
|-&lt;br /&gt;
| Restart Debugging&lt;br /&gt;
| Ctrl-Shift-F5&lt;br /&gt;
|-&lt;br /&gt;
| CallStack Window&lt;br /&gt;
| Ctrl-Alt-C&lt;br /&gt;
|-&lt;br /&gt;
| Variable Window&lt;br /&gt;
| Ctrl-Alt-V&lt;br /&gt;
|-&lt;br /&gt;
| Watch Window&lt;br /&gt;
| Ctrl-Alt-W&lt;br /&gt;
|-&lt;br /&gt;
| Facts Window&lt;br /&gt;
| Ctrl-Alt-F&lt;br /&gt;
|-&lt;br /&gt;
| Threads Window&lt;br /&gt;
| Ctrl-Alt-H&lt;br /&gt;
|-&lt;br /&gt;
| Modules Window&lt;br /&gt;
| Ctrl-Alt-L&lt;br /&gt;
|-&lt;br /&gt;
| Exceptions Window&lt;br /&gt;
| Ctrl-Alt-X&lt;br /&gt;
|-&lt;br /&gt;
| Breakpoints Window&lt;br /&gt;
| Ctrl-Alt-B&lt;br /&gt;
|-&lt;br /&gt;
| Bookmarks Window&lt;br /&gt;
| Ctrl-Alt-K&lt;br /&gt;
|-&lt;br /&gt;
| Disassembly Window&lt;br /&gt;
| Ctrl-Alt-D&lt;br /&gt;
|-&lt;br /&gt;
| Disassembly Window from Current Line&lt;br /&gt;
| Ctrl-D&lt;br /&gt;
|-&lt;br /&gt;
| Registers window&lt;br /&gt;
| Ctrl-Alt-G&lt;br /&gt;
|-&lt;br /&gt;
| Memory Dump 1 Window&lt;br /&gt;
| Ctrl-Alt-M&lt;br /&gt;
|-&lt;br /&gt;
| Toggle Breakpoint&lt;br /&gt;
| F9&lt;br /&gt;
|-&lt;br /&gt;
| Toggle Hard/Soft Breakpoint&lt;br /&gt;
| Ctrl-F9&lt;br /&gt;
|-&lt;br /&gt;
| Breakpoint Properties&lt;br /&gt;
| Alt-F9&lt;br /&gt;
|-&lt;br /&gt;
| Breakpoint -&amp;gt; Bookmark&lt;br /&gt;
| Ctrl-Alt-F9&lt;br /&gt;
|-&lt;br /&gt;
| Bookmark -&amp;gt;  Breakpoint&lt;br /&gt;
| Ctrl-Alt-F9&lt;br /&gt;
|-&lt;br /&gt;
| Step Into&lt;br /&gt;
| F11&lt;br /&gt;
|-&lt;br /&gt;
| Step out of&lt;br /&gt;
| Shift-F11&lt;br /&gt;
|-&lt;br /&gt;
| Step Over&lt;br /&gt;
| F10&lt;br /&gt;
|-&lt;br /&gt;
| Run To Cursor&lt;br /&gt;
| Ctrl-F10&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Project&lt;br /&gt;
|-&lt;br /&gt;
| Add Module to Project&lt;br /&gt;
| Ctrl-Shift-A&lt;br /&gt;
|-&lt;br /&gt;
| Create Project Item&lt;br /&gt;
| Ctrl-N&lt;br /&gt;
|-&lt;br /&gt;
| Create Project Item in Existing Package&lt;br /&gt;
| Ctrl-Alt-N&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
IDE&lt;br /&gt;
|-&lt;br /&gt;
| Close all other editors&lt;br /&gt;
| Ctrl-Q&lt;br /&gt;
|-&lt;br /&gt;
| Prune open editors&lt;br /&gt;
| Ctrl-Shift-Q&lt;br /&gt;
|-&lt;br /&gt;
| Close the active window&lt;br /&gt;
| Ctrl-F4&lt;br /&gt;
|-&lt;br /&gt;
| Project window&lt;br /&gt;
| Ctrl-Alt-P&lt;br /&gt;
|-&lt;br /&gt;
| Project Settings&lt;br /&gt;
| Alt-F7&lt;br /&gt;
|-&lt;br /&gt;
| Open File&lt;br /&gt;
| Ctrl-O&lt;br /&gt;
|-&lt;br /&gt;
| Save File&lt;br /&gt;
| F2&lt;br /&gt;
|-&lt;br /&gt;
| Save Project&lt;br /&gt;
| Ctrl-S&lt;br /&gt;
|-&lt;br /&gt;
| Source Browser&lt;br /&gt;
| Ctrl-B&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Other&lt;br /&gt;
|-&lt;br /&gt;
| Help&lt;br /&gt;
| F1&lt;br /&gt;
|-&lt;br /&gt;
| Messages Window&lt;br /&gt;
| Ctrl-Alt-O&lt;br /&gt;
|-&lt;br /&gt;
| Error/Warnings Window&lt;br /&gt;
| Ctrl-Alt-E&lt;br /&gt;
|-&lt;br /&gt;
| Print&lt;br /&gt;
| Ctrl-P&lt;br /&gt;
|-&lt;br /&gt;
| Exit IDE&lt;br /&gt;
| Alt-F4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ru:IDE:Горячие Клавиши]]&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Ide/Key_Bindings&amp;diff=4925</id>
		<title>Ide/Key Bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Ide/Key_Bindings&amp;diff=4925"/>
		<updated>2024-02-22T08:52:27Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: remove acc for new\open project&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{ideNavbar|Key Bindings}}&lt;br /&gt;
&lt;br /&gt;
The table below shows Visual Prolog accelerator keys by functions.&lt;br /&gt;
&lt;br /&gt;
:{| {{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Edit&lt;br /&gt;
|-&lt;br /&gt;
| Copy&lt;br /&gt;
| Ctrl-C or Ctrl-Ins&lt;br /&gt;
|-&lt;br /&gt;
| Copy  Position&lt;br /&gt;
| Ctrl-Alt-Shift-C&lt;br /&gt;
|-&lt;br /&gt;
| Cut&lt;br /&gt;
| Ctrl-X or Shift-Del&lt;br /&gt;
|-&lt;br /&gt;
| Paste&lt;br /&gt;
| Ctrl-V or Shift-Ins&lt;br /&gt;
|-&lt;br /&gt;
| Undo&lt;br /&gt;
| Ctrl-Z&lt;br /&gt;
|-&lt;br /&gt;
| Redo&lt;br /&gt;
| Ctrl-Y or Ctrl-Shift-Z&lt;br /&gt;
|-&lt;br /&gt;
| Select All&lt;br /&gt;
| Ctrl-A&lt;br /&gt;
|-&lt;br /&gt;
| Select Current Word&lt;br /&gt;
| Ctrl-W&lt;br /&gt;
|-&lt;br /&gt;
| Delete&lt;br /&gt;
| Del&lt;br /&gt;
|-&lt;br /&gt;
| Delete Line&lt;br /&gt;
| Ctrl-Shift-L&lt;br /&gt;
|-&lt;br /&gt;
| Delete to End of Line&lt;br /&gt;
| Ctrl-Shift-E&lt;br /&gt;
|-&lt;br /&gt;
| Delete to Start of Line&lt;br /&gt;
| Ctrl-Shift-H&lt;br /&gt;
|-&lt;br /&gt;
| Word Delete To End&lt;br /&gt;
| Ctrl-Del&lt;br /&gt;
|-&lt;br /&gt;
| Replace&lt;br /&gt;
| Ctrl-H&lt;br /&gt;
|-&lt;br /&gt;
| Lower Case&lt;br /&gt;
| Ctrl-U&lt;br /&gt;
|-&lt;br /&gt;
| Upper Case&lt;br /&gt;
| Ctrl-Shift-U&lt;br /&gt;
|-&lt;br /&gt;
| Toggle Case&lt;br /&gt;
| Ctrl-Alt-U&lt;br /&gt;
|-&lt;br /&gt;
| Zoom In&lt;br /&gt;
| Ctrl-[+] or Ctrl-Mouse wheel up&lt;br /&gt;
|-&lt;br /&gt;
| Zoom Out&lt;br /&gt;
| Ctrl-[-] or Ctrl-Mouse wheel down&lt;br /&gt;
|-&lt;br /&gt;
| Zoom to Normal&lt;br /&gt;
| Ctrl-0&lt;br /&gt;
|-&lt;br /&gt;
| Comment Line(s)&lt;br /&gt;
| Ctrl-Alt-5&lt;br /&gt;
|-&lt;br /&gt;
| Uncomment Line(s)&lt;br /&gt;
| Ctrl-Alt-Shift-5&lt;br /&gt;
|-&lt;br /&gt;
| Duplcate Line&lt;br /&gt;
| Ctrl-Alt-R&lt;br /&gt;
|-&lt;br /&gt;
| Add qualification&lt;br /&gt;
| Ctrl-Shift-S&lt;br /&gt;
|-&lt;br /&gt;
| Insert Date Stamp&lt;br /&gt;
| Ctrl-Shift-Y&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Navigation&lt;br /&gt;
|-&lt;br /&gt;
| Find&lt;br /&gt;
| Ctrl-F&lt;br /&gt;
|-&lt;br /&gt;
| Find in Files&lt;br /&gt;
| Ctrl-Shift-F&lt;br /&gt;
|-&lt;br /&gt;
| Find Next&lt;br /&gt;
| F3&lt;br /&gt;
|-&lt;br /&gt;
| Find Previous&lt;br /&gt;
| Shift-F3&lt;br /&gt;
|-&lt;br /&gt;
| Last Searchs Result Window&lt;br /&gt;
| Ctrl-Alt-S&lt;br /&gt;
|-&lt;br /&gt;
| Locate in Project Tree&lt;br /&gt;
| Ctrl-T&lt;br /&gt;
|-&lt;br /&gt;
| Go Back&lt;br /&gt;
| Ctrl-Shift-F8&lt;br /&gt;
|-&lt;br /&gt;
| Go to Address&lt;br /&gt;
| Ctrl-G&lt;br /&gt;
|-&lt;br /&gt;
| Go to Definition&lt;br /&gt;
| F12&lt;br /&gt;
Ctrl-Shift-C&lt;br /&gt;
|-&lt;br /&gt;
| Go To Declaration&lt;br /&gt;
| Ctrl-F12&lt;br /&gt;
Ctrl-Shift-D&lt;br /&gt;
|-&lt;br /&gt;
| Go to Related Files&lt;br /&gt;
| Ctrl-R&lt;br /&gt;
|-&lt;br /&gt;
| Go to Executing Predicate Source&lt;br /&gt;
| Ctrl-E&lt;br /&gt;
|-&lt;br /&gt;
| Go To Line&lt;br /&gt;
| Ctrl-F2&lt;br /&gt;
|-&lt;br /&gt;
| Go To Position on Clipboard&lt;br /&gt;
| Shift-F2&lt;br /&gt;
|-&lt;br /&gt;
| Go To Next Error&lt;br /&gt;
| F8&lt;br /&gt;
|-&lt;br /&gt;
| Go To Previous Error&lt;br /&gt;
| Shift-F8&lt;br /&gt;
|-&lt;br /&gt;
| Go To Next Bookmark&lt;br /&gt;
| F6&lt;br /&gt;
|-&lt;br /&gt;
| Go To Previous Bookmark&lt;br /&gt;
| Shift-F6&lt;br /&gt;
|-&lt;br /&gt;
| Window Navigation Dialog&lt;br /&gt;
| Ctrl-Tab or Ctrl-F6&lt;br /&gt;
|-&lt;br /&gt;
| Set/Remove bookmark&lt;br /&gt;
| Ctrl-K&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Compile&lt;br /&gt;
|-&lt;br /&gt;
| Build&lt;br /&gt;
| Ctrl-Shift-B&lt;br /&gt;
|-&lt;br /&gt;
| Stop Build&lt;br /&gt;
| Ctrl-Break&lt;br /&gt;
|-&lt;br /&gt;
| Build Resource Only&lt;br /&gt;
| Alt-F8&lt;br /&gt;
|-&lt;br /&gt;
| Compile&lt;br /&gt;
| Ctrl-F7&lt;br /&gt;
|-&lt;br /&gt;
| Rebuild Project&lt;br /&gt;
| Ctrl-Shift-Alt-B&lt;br /&gt;
|-&lt;br /&gt;
| Run&lt;br /&gt;
| Ctrl-F5&lt;br /&gt;
|-&lt;br /&gt;
| Run in Window&lt;br /&gt;
| Alt-F5&lt;br /&gt;
|-&lt;br /&gt;
| 32 bit Platform&lt;br /&gt;
| Ctrl-Alt-3&lt;br /&gt;
|-&lt;br /&gt;
| 64 bit Platform&lt;br /&gt;
| Ctrl-Alt-6&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Debug&lt;br /&gt;
|-&lt;br /&gt;
| Start Debugging &lt;br /&gt;
| F5&lt;br /&gt;
|-&lt;br /&gt;
| Run Debugging Skipping Soft Breakpoints&lt;br /&gt;
| Ctrl-Shift-F10&lt;br /&gt;
|-&lt;br /&gt;
| Stop Debugging&lt;br /&gt;
| Shift-F5&lt;br /&gt;
|-&lt;br /&gt;
| Restart Debugging&lt;br /&gt;
| Ctrl-Shift-F5&lt;br /&gt;
|-&lt;br /&gt;
| Refresh Debug Window&lt;br /&gt;
| Ctrl-R&lt;br /&gt;
|-&lt;br /&gt;
| CallStack Window&lt;br /&gt;
| Ctrl-Alt-C&lt;br /&gt;
|-&lt;br /&gt;
| Variable Window&lt;br /&gt;
| Ctrl-Alt-V&lt;br /&gt;
|-&lt;br /&gt;
| Watch Window&lt;br /&gt;
| Ctrl-Alt-W&lt;br /&gt;
|-&lt;br /&gt;
| Facts Window&lt;br /&gt;
| Ctrl-Alt-F&lt;br /&gt;
|-&lt;br /&gt;
| Delete Object from Facts Tree Retract Fact(s)&lt;br /&gt;
| Ctrl-Del&lt;br /&gt;
|-&lt;br /&gt;
| Threads Window&lt;br /&gt;
| Ctrl-Alt-H&lt;br /&gt;
|-&lt;br /&gt;
| Modules Window&lt;br /&gt;
| Ctrl-Alt-L&lt;br /&gt;
|-&lt;br /&gt;
| Exceptions Window&lt;br /&gt;
| Ctrl-Alt-X&lt;br /&gt;
|-&lt;br /&gt;
| Breakpoints Window&lt;br /&gt;
| Ctrl-Alt-B&lt;br /&gt;
|-&lt;br /&gt;
| Bookmarks Window&lt;br /&gt;
| Ctrl-Alt-K&lt;br /&gt;
|-&lt;br /&gt;
| Disassembly Window&lt;br /&gt;
| Ctrl-Alt-D&lt;br /&gt;
|-&lt;br /&gt;
| Disassembly Window from Current Line&lt;br /&gt;
| Ctrl-D&lt;br /&gt;
|-&lt;br /&gt;
| Registers window&lt;br /&gt;
| Ctrl-Alt-G&lt;br /&gt;
|-&lt;br /&gt;
| Memory Dump 1 Window&lt;br /&gt;
| Ctrl-Alt-M&lt;br /&gt;
|-&lt;br /&gt;
| Toggle Breakpoint&lt;br /&gt;
| F9&lt;br /&gt;
|-&lt;br /&gt;
| Toggle Hard/Soft Breakpoint&lt;br /&gt;
| Ctrl-F9&lt;br /&gt;
|-&lt;br /&gt;
| Breakpoint Properties&lt;br /&gt;
| Alt-F9&lt;br /&gt;
|-&lt;br /&gt;
| Breakpoint -&amp;gt; Bookmark&lt;br /&gt;
| Ctrl-Alt-F9&lt;br /&gt;
|-&lt;br /&gt;
| Bookmark -&amp;gt;  Breakpoint&lt;br /&gt;
| Ctrl-Alt-F9&lt;br /&gt;
|-&lt;br /&gt;
| Step Into&lt;br /&gt;
| F11&lt;br /&gt;
|-&lt;br /&gt;
| Step out of&lt;br /&gt;
| Shift-F11&lt;br /&gt;
|-&lt;br /&gt;
| Step Over&lt;br /&gt;
| F10&lt;br /&gt;
|-&lt;br /&gt;
| Run To Cursor&lt;br /&gt;
| Ctrl-F10&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Project&lt;br /&gt;
|-&lt;br /&gt;
| Add Module to Project&lt;br /&gt;
| Ctrl-Shift-A&lt;br /&gt;
|-&lt;br /&gt;
| Create Project Item&lt;br /&gt;
| Ctrl-N&lt;br /&gt;
|-&lt;br /&gt;
| Create Project Item in Existing Package&lt;br /&gt;
| Ctrl-Alt-N&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
IDE&lt;br /&gt;
|-&lt;br /&gt;
| Close all other editors&lt;br /&gt;
| Ctrl-Q&lt;br /&gt;
|-&lt;br /&gt;
| Prune open editors&lt;br /&gt;
| Ctrl-Shift-Q&lt;br /&gt;
|-&lt;br /&gt;
| Close the active window&lt;br /&gt;
| Ctrl-F4&lt;br /&gt;
|-&lt;br /&gt;
| Project window&lt;br /&gt;
| Ctrl-Alt-P&lt;br /&gt;
|-&lt;br /&gt;
| Project Settings&lt;br /&gt;
| Alt-F7&lt;br /&gt;
|-&lt;br /&gt;
| Open File&lt;br /&gt;
| Ctrl-O&lt;br /&gt;
|-&lt;br /&gt;
| Save File&lt;br /&gt;
| F2&lt;br /&gt;
|-&lt;br /&gt;
| Save Project&lt;br /&gt;
| Ctrl-S&lt;br /&gt;
|-&lt;br /&gt;
| Source Browser&lt;br /&gt;
| Ctrl-B&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Other&lt;br /&gt;
|-&lt;br /&gt;
| Help&lt;br /&gt;
| F1&lt;br /&gt;
|-&lt;br /&gt;
| Messages Window&lt;br /&gt;
| Ctrl-Alt-O&lt;br /&gt;
|-&lt;br /&gt;
| Error/Warnings Window&lt;br /&gt;
| Ctrl-Alt-E&lt;br /&gt;
|-&lt;br /&gt;
| Print&lt;br /&gt;
| Ctrl-P&lt;br /&gt;
|-&lt;br /&gt;
| Exit IDE&lt;br /&gt;
| Alt-F4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ru:IDE:Горячие Клавиши]]&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Domains&amp;diff=4864</id>
		<title>Language Reference/Built-in entities/Domains</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Domains&amp;diff=4864"/>
		<updated>2023-11-12T12:33:23Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: remove ()&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
|[[#any|any]]&lt;br /&gt;
|Universal term type.&lt;br /&gt;
|-&lt;br /&gt;
|[[#char|char]]&lt;br /&gt;
|Wide (two-bytes) character.&lt;br /&gt;
|-&lt;br /&gt;
|[[#string|string]]&lt;br /&gt;
|Wide zero-terminated sequence of wide characters.&lt;br /&gt;
|-&lt;br /&gt;
|[[#string8|string8]]&lt;br /&gt;
|Zero-terminated sequence of ASCII (one-byte) characters.&lt;br /&gt;
|-&lt;br /&gt;
|[[#symbol|symbol]]&lt;br /&gt;
|Wide zero-terminated sequence of wide characters.&lt;br /&gt;
|-&lt;br /&gt;
|[[#binary|binary]]&lt;br /&gt;
|Sequence of bytes.&lt;br /&gt;
|-&lt;br /&gt;
|[[#binaryNonAtomic|binaryNonAtomic]]&lt;br /&gt;
|Sequence of bytes.&lt;br /&gt;
|-&lt;br /&gt;
|[[#integer|integer]]&lt;br /&gt;
|32 bit signed integer.&lt;br /&gt;
|-&lt;br /&gt;
|[[#integer64|integer64]]&lt;br /&gt;
|64 bit signed integer.&lt;br /&gt;
|-&lt;br /&gt;
|[[#integerNative|integerNative]]&lt;br /&gt;
|Signed integer with platform size (32 bit in a 32 bit program; 64 bit in a 64 bit program).&lt;br /&gt;
|-&lt;br /&gt;
|[[#unsigned|unsigned]]&lt;br /&gt;
|32 bit unsigned integer.&lt;br /&gt;
|-&lt;br /&gt;
|[[#unsigned64|unsigned64]]&lt;br /&gt;
|64 bit unsigned integer.&lt;br /&gt;
|-&lt;br /&gt;
|[[#unsignedNative|unsignedNative]]&lt;br /&gt;
|Unsigned integer with platform size (32 bit in a 32 bit program; 64 bit in a 64 bit program).&lt;br /&gt;
|-&lt;br /&gt;
|[[#real|real]]&lt;br /&gt;
|Float-pointing number.&lt;br /&gt;
|-&lt;br /&gt;
|[[#real32|real32]]&lt;br /&gt;
|Float-pointing number.&lt;br /&gt;
|-&lt;br /&gt;
|[[#pointer|pointer]]&lt;br /&gt;
|pointer to a memory address.&lt;br /&gt;
|-&lt;br /&gt;
|[[#handle|handle]]&lt;br /&gt;
|a handle (e.g. native file and windows handles).&lt;br /&gt;
|-&lt;br /&gt;
|[[#boolean|boolean]]&lt;br /&gt;
|Boolean values.&lt;br /&gt;
|-&lt;br /&gt;
|[[#factDB|factDB]]&lt;br /&gt;
|Descriptors of named internal databases.&lt;br /&gt;
|-&lt;br /&gt;
|[[#compareResult|compareResult]]&lt;br /&gt;
|Values of comparison result.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== any ====&lt;br /&gt;
&lt;br /&gt;
Universal term type.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;any&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The values of this domain are any terms. Such a value contains the reference to the term type library and a term itself.&lt;br /&gt;
&lt;br /&gt;
==== char ====&lt;br /&gt;
&lt;br /&gt;
Wide character.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;char&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The values of this domain are UNICODE characters. Implemented as 2 unsigned bytes.&lt;br /&gt;
&lt;br /&gt;
Only assignment and comparison (in the lexicographical sense) operations are applied to the values of this domain. The image of a character has the following syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Char_image&amp;gt; :&lt;br /&gt;
      &amp;#039; Char_value &amp;#039;&lt;br /&gt;
&amp;lt;Char_value&amp;gt; :&lt;br /&gt;
      &amp;lt;Letter&amp;gt;&lt;br /&gt;
      &amp;lt;Digit&amp;gt;&lt;br /&gt;
      &amp;lt;Graphical_symbol&amp;gt;&lt;br /&gt;
      \ &amp;lt;Escape_seq&amp;gt;&lt;br /&gt;
&amp;lt;Escape_seq&amp;gt;:&lt;br /&gt;
      t&lt;br /&gt;
      n&lt;br /&gt;
      r&lt;br /&gt;
      \&lt;br /&gt;
      &amp;#039;&lt;br /&gt;
      &amp;quot;&lt;br /&gt;
      u &amp;lt;HHHH&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the syntax above &amp;lt;vpbnf&amp;gt;&amp;lt;HHHH&amp;gt;&amp;lt;/vpbnf&amp;gt; correspond to 4 hexadecimal digits. Also, the backslash symbol and the single quote can be represented by an escape-sequence only.&lt;br /&gt;
&lt;br /&gt;
==== compareResult ====&lt;br /&gt;
&lt;br /&gt;
The result of a comparison. For instance, the built-in procedure {{lang2|Built-in entities|compare|compare/2-&amp;gt;}} has &amp;quot;compareResult&amp;quot; as the domain of its result.&lt;br /&gt;
&amp;lt;vip&amp;gt;domains&lt;br /&gt;
   compareResult = less; equal; greater.&lt;br /&gt;
&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== string ====&lt;br /&gt;
&lt;br /&gt;
Utf-16 strings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;string&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A string represented as a pointer to a zero terminated sequence of characters in utf-16 encoding. Values in the sequence are 16 bits, but certain rare characters (code points) are encoded using two such values. Strings are immutable.&lt;br /&gt;
&lt;br /&gt;
In source code a string literal can be specified as a set of sequences of characters surrounded by the double quotes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;StringLiteral&amp;gt;:&lt;br /&gt;
   &amp;lt;StringLiteralPart&amp;gt;-list&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;StringLiteralPart&amp;gt; :&lt;br /&gt;
   @&amp;quot; AnyCharacter-list-opt &amp;quot;&lt;br /&gt;
   &amp;quot; CharacterValue-list-opt &amp;quot;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A string literal consists of one or more &amp;lt;vpbnf&amp;gt;&amp;lt;StringLiteralPart&amp;gt;&amp;lt;/vpbnf&amp;gt;&amp;#039;s, which are concatenated. &amp;lt;vpbnf&amp;gt;&amp;lt;StringLiteralPart&amp;gt;&amp;lt;/vpbnf&amp;gt;&amp;#039;s starting with &amp;lt;vp&amp;gt;@&amp;lt;/vp&amp;gt; does not use escape sequences, whereas &amp;lt;vpbnf&amp;gt;&amp;lt;StringLiteralPart&amp;gt;&amp;lt;/vpbnf&amp;gt;&amp;#039;s without &amp;lt;vp&amp;gt;@&amp;lt;/vp&amp;gt; uses the following escape sequences:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;vp&amp;gt;\\&amp;lt;/vp&amp;gt; representing &amp;lt;vp&amp;gt;\&amp;lt;/vp&amp;gt;&lt;br /&gt;
*&amp;lt;vp&amp;gt;\t&amp;lt;/vp&amp;gt; representing Tab-character&lt;br /&gt;
*&amp;lt;vp&amp;gt;\n&amp;lt;/vp&amp;gt; representing newline-character&lt;br /&gt;
*&amp;lt;vp&amp;gt;\r&amp;lt;/vp&amp;gt; representing carriage return&lt;br /&gt;
*&amp;lt;vp&amp;gt;\&amp;#039;&amp;lt;/vp&amp;gt; representing single quote&lt;br /&gt;
*&amp;lt;vp&amp;gt;\&amp;quot;&amp;lt;/vp&amp;gt; representing double quote&lt;br /&gt;
*&amp;lt;vp&amp;gt;\u&amp;lt;/vp&amp;gt; followed by exactly four &amp;lt;vpbnf&amp;gt;&amp;lt;HexadecimalDigit&amp;gt;&amp;lt;/vpbnf&amp;gt;&amp;#039;s representing the Unicode character corresponding to the digits.&lt;br /&gt;
&lt;br /&gt;
The double quotes in the string can be represented by the escape-sequence only (the single quote can be represented both with an escape-sequence and a graphical symbol).&lt;br /&gt;
&lt;br /&gt;
==== string8 ====&lt;br /&gt;
&lt;br /&gt;
A built-in domain who&amp;#039;s elements are sequences of (one-byte) ASCII-characters. It is implemented as a pointer to the zero terminated array of ASCII characters. Only assignment and comparison for equality (in the lexicographical sense) operations are applied to the values of this domain. Currently no literals are allowed for this domain.&lt;br /&gt;
&lt;br /&gt;
==== symbol ====&lt;br /&gt;
&lt;br /&gt;
Utf-16 strings with same representation as &amp;lt;vp&amp;gt;string&amp;lt;/vp&amp;gt;, but they are also stored in a global symbol table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;symbol&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;vp&amp;gt;symbol&amp;lt;/vp&amp;gt; is stored in a global symbol table, and that storage guarenties that the pointer value of symbols will be the same for the same symbol.  Once a &amp;lt;vp&amp;gt;symbol&amp;lt;/vp&amp;gt; is put into the symbol table it is never removed again, so &amp;lt;vp&amp;gt;symbol&amp;lt;/vp&amp;gt;s are never reclaimed.  Their storage will live untill the program terminates.  So the &amp;lt;vp&amp;gt;symbol&amp;lt;/vp&amp;gt; data type should not be used for large documents, etc.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;symbol&amp;lt;/vp&amp;gt; domain is a subtype of the &amp;lt;vp&amp;gt;string&amp;lt;/vp&amp;gt; domain, so a symbol can be used everywhere instead of a string.  The opposite is not the case because a &amp;lt;vp&amp;gt;string&amp;lt;/vp&amp;gt; will have to be found or inserted in the global symbol table to become a &amp;lt;vp&amp;gt;symbol&amp;lt;/vp&amp;gt;.  So to create a symbol from a string you will have to &amp;lt;vp&amp;gt;convert&amp;lt;/vp&amp;gt; the string to the symbol domain (or a subtype of the &amp;lt;vp&amp;gt;symbol&amp;lt;/vp&amp;gt; domain).&lt;br /&gt;
&lt;br /&gt;
The equality operation is very efficient for &amp;lt;vp&amp;gt;symbol&amp;lt;/vp&amp;gt;s since their pointer value will be the same if the &amp;lt;vp&amp;gt;symbol&amp;lt;/vp&amp;gt; is the same.  I.e. there is no need to compare the actual characters to determine equality.&lt;br /&gt;
&lt;br /&gt;
Other comparison operations (less than, case insensitive comparison, etc) are the same as for &amp;lt;vp&amp;gt;string&amp;lt;/vp&amp;gt; in fact all other operations on &amp;lt;vp&amp;gt;symbol&amp;lt;/vp&amp;gt; is simply carried out by the corresponding string operations.&lt;br /&gt;
&lt;br /&gt;
==== binary ====&lt;br /&gt;
&lt;br /&gt;
Sequence of bytes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;binary&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values of this domain are used for holding binary data. A binary value is implemented as a pointer to the sequence of bytes that represents the contents of a binary term.&lt;br /&gt;
&lt;br /&gt;
The length of a binary term is situated in the &amp;#039;&amp;#039;&amp;#039;4 bytes&amp;#039;&amp;#039;&amp;#039; immediately preceding this sequence of bytes. The 4 bytes contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;TotalNumberOfBytesOccupiedByBinary = ByteLen + 4 &amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;vp&amp;gt;ByteLen&amp;lt;/vp&amp;gt; - is the length of the binary term and 4 is number of bytes occupied by size field.&lt;br /&gt;
&lt;br /&gt;
Only assignment and comparison operations are applied to values of &amp;#039;&amp;#039;&amp;#039;binary domain&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Two binary terms are compared in the following way:&lt;br /&gt;
&lt;br /&gt;
*If they are of different sizes, the bigger is considered larger.&lt;br /&gt;
*Otherwise, they are compared byte by byte, as unsigned values. Comparison stops when two differing bytes are found and the result of their comparison is the result of the comparison of the binary terms. Two binary terms are equal if they have the same sizes and all bytes are equal.&lt;br /&gt;
&lt;br /&gt;
The text syntax for binary images is determined by the &amp;lt;vpbnf&amp;gt;&amp;lt;Binary&amp;gt;&amp;lt;/vpbnf&amp;gt; rules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Binary&amp;gt; :&lt;br /&gt;
       $ [ &amp;lt;Byte_value&amp;gt;-comma-sep-list-opt ]&lt;br /&gt;
&amp;lt;Byte_value&amp;gt; :&lt;br /&gt;
      &amp;lt;Expression&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each &amp;#039;&amp;#039;expression&amp;#039;&amp;#039; should be calculate on compiling time and its value should be in the range from &amp;lt;vp&amp;gt;0&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;255&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== binaryNonAtomic ====&lt;br /&gt;
&lt;br /&gt;
Sequence of bytes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;binaryNonAtomic&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same as [[#binary|binary]], but can contain pointers because it is scanned by the garbage collector.&lt;br /&gt;
&lt;br /&gt;
==== integer ====&lt;br /&gt;
&lt;br /&gt;
32 bit signed integer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;integer&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values of this domain occupy 4 bytes. Arithmetic operations (&amp;lt;vp&amp;gt;+&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;-&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;/&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;*&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;^&amp;lt;/vp&amp;gt;), comparison, assignment, {{lang2|Built-in entities|Operators|div/2-&amp;gt;}}, {{lang2|Built-in entities|Operators|mod/2-&amp;gt;}}, {{lang2|Built-in entities|Operators|quot/2-&amp;gt;}}, and {{lang2|Built-in entities|Operators|rem/2-&amp;gt;}} operations are applied to values of this domain.&lt;br /&gt;
&lt;br /&gt;
The permitted number range is from &amp;lt;vp&amp;gt;-2147483648&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;2147483647&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The syntax for the &amp;lt;vp&amp;gt;integer&amp;lt;/vp&amp;gt; literal is determined by the &amp;lt;vpbnf&amp;gt;&amp;lt;Integer&amp;gt;&amp;lt;/vpbnf&amp;gt; rule:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Integer&amp;gt; :&lt;br /&gt;
      &amp;lt;Add_operation&amp;gt;-opt 0o &amp;lt;Oct_number&amp;gt;&lt;br /&gt;
      &amp;lt;Add_operation&amp;gt;-opt &amp;lt;Dec_number&amp;gt;&lt;br /&gt;
      &amp;lt;Add_operation&amp;gt;-opt 0x &amp;lt;Hex_number&amp;gt;&lt;br /&gt;
&amp;lt;Add_operation&amp;gt; :&lt;br /&gt;
      +&lt;br /&gt;
      -&lt;br /&gt;
&amp;lt;Oct_number&amp;gt; :&lt;br /&gt;
      &amp;lt;Oct_digit&amp;gt;-list&lt;br /&gt;
&amp;lt;Oct_digit&amp;gt; : one of&lt;br /&gt;
      0 1 2 3 4 5 6 7&lt;br /&gt;
&amp;lt;Dec_number&amp;gt; :&lt;br /&gt;
      &amp;lt;Dec_digit&amp;gt;-list&lt;br /&gt;
&amp;lt;Dec_digit&amp;gt; : one of&lt;br /&gt;
      &amp;lt;Oct_digit&amp;gt; 8 9&lt;br /&gt;
&amp;lt;Hex_number&amp;gt; :&lt;br /&gt;
      &amp;lt;Hex_digit&amp;gt;-list&lt;br /&gt;
&amp;lt;Hex_digit&amp;gt; : one of&lt;br /&gt;
      &amp;lt;Dec_digit&amp;gt; a b c d e f A B C D E F&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== integer64 ====&lt;br /&gt;
&lt;br /&gt;
64 bit signed integers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;integer64&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values of this domain occupy 8 bytes.&lt;br /&gt;
&lt;br /&gt;
The permitted number range is from &amp;lt;vp&amp;gt;-2^63 = -9223372036854775808&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;2^63-1 = 9223372036854775807&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The syntax for &amp;lt;vp&amp;gt;integer64&amp;lt;/vp&amp;gt; literal is the same as &amp;lt;vpbnf&amp;gt;&amp;lt;Integer&amp;gt;&amp;lt;/vpbnf&amp;gt; rule.&lt;br /&gt;
&lt;br /&gt;
The set of operations for &amp;lt;vp&amp;gt;integer64&amp;lt;/vp&amp;gt; is similar to the one for &amp;lt;vpbnf&amp;gt;&amp;lt;Integer&amp;gt;&amp;lt;/vpbnf&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== integerNative ====&lt;br /&gt;
&lt;br /&gt;
Signed integer number with platform size (32 bit in a 32 bit program; 64 bit in a 64 bit program).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;integerNative&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== unsigned ====&lt;br /&gt;
&lt;br /&gt;
32 bit unsigned integer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;unsigned&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values of this domain occupy 4 bytes. Arithmetic operations (&amp;lt;vp&amp;gt;+&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;-&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;/&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;*&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;^&amp;lt;/vp&amp;gt;), comparison, assignment, {{lang2|Built-in entities|Operators|div/2-&amp;gt;}}, {{lang2|Built-in entities|Operators|mod/2-&amp;gt;}}, {{lang2|Built-in entities|Operators|rem/2-&amp;gt;}}, and {{lang2|Built-in entities|Operators|quot/2-&amp;gt;}} operations are applied to values of this domain.&lt;br /&gt;
&lt;br /&gt;
The permitted number range is from &amp;lt;vp&amp;gt;0&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;4294967295&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The syntax for &amp;lt;vp&amp;gt;unsigned&amp;lt;/vp&amp;gt; number images is the same as for &amp;lt;vp&amp;gt;integer&amp;lt;/vp&amp;gt; numbers. The usage of minus sign (&amp;lt;vpbnf&amp;gt;&amp;lt;UnaryMinus&amp;gt;&amp;lt;/vpbnf&amp;gt;) is not allowed for an image of an &amp;lt;vp&amp;gt;unsigned&amp;lt;/vp&amp;gt; number.&lt;br /&gt;
&lt;br /&gt;
==== unsigned64 ====&lt;br /&gt;
&lt;br /&gt;
64 bit unsigned integer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;unsigned64&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values of this domain occupy 8 bytes.&lt;br /&gt;
&lt;br /&gt;
The permitted number range is from &amp;lt;vp&amp;gt;0&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;2^64-1 = 18,446,744,073,709,551,615&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The syntax for &amp;lt;vp&amp;gt;unsigned64&amp;lt;/vp&amp;gt; number images is the same as for &amp;lt;vp&amp;gt;integer64&amp;lt;/vp&amp;gt; numbers. The usage of minus sign (&amp;lt;vpbnf&amp;gt;&amp;lt;UnaryMinus&amp;gt;&amp;lt;/vpbnf&amp;gt;) is not allowed for an image of an &amp;lt;vp&amp;gt;unsigned64&amp;lt;/vp&amp;gt; number.&lt;br /&gt;
&lt;br /&gt;
The set of operations for &amp;lt;vp&amp;gt;unsigned64&amp;lt;/vp&amp;gt; is similar to the one for &amp;lt;vpbnf&amp;gt;&amp;lt;Unsigned&amp;gt;&amp;lt;/vpbnf&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== unsignedNative ====&lt;br /&gt;
&lt;br /&gt;
Unsigned integer number with platform size (32 bit in a 32 bit program; 64 bit in a 64 bit program).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;unsignedNative&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== real ====&lt;br /&gt;
&lt;br /&gt;
Float-pointing number.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;real&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values of this domain occupy 8 bytes. This numerical real domain is introduced for the user&amp;#039;s convenience only. All arithmetic, comparison, and assignment operations are applied to values of &amp;lt;vp&amp;gt;real&amp;lt;/vp&amp;gt; domain.&lt;br /&gt;
&lt;br /&gt;
The permitted number range is &amp;lt;vp&amp;gt;-1.7e+308&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;1.7e+308&amp;lt;/vp&amp;gt;. Values from integral domains are automatically converted to real numbers when necessary.&lt;br /&gt;
&lt;br /&gt;
The syntax for the floating-point number literal is determined by the &amp;lt;vpbnf&amp;gt;&amp;lt;Real&amp;gt;&amp;lt;/vpbnf&amp;gt; rule:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Real&amp;gt; :&lt;br /&gt;
      &amp;lt;Add_operation&amp;gt;-opt &amp;lt;Fraction&amp;gt; &amp;lt;Exponent&amp;gt;-opt&lt;br /&gt;
&amp;lt;Fraction&amp;gt; :&lt;br /&gt;
      &amp;lt;Dec_number&amp;gt; &amp;lt;Fractional_part&amp;gt;-opt&lt;br /&gt;
&amp;lt;Fractional_part&amp;gt; :&lt;br /&gt;
      . &amp;lt;Dec_number&amp;gt;&lt;br /&gt;
&amp;lt;Exponent&amp;gt; :&lt;br /&gt;
      &amp;lt;Exp&amp;gt; &amp;lt;Add_operation&amp;gt;-opt &amp;lt;Dec_number&amp;gt;&lt;br /&gt;
&amp;lt;Exp&amp;gt; :&lt;br /&gt;
      e&lt;br /&gt;
      E&lt;br /&gt;
&amp;lt;Add_operation&amp;gt; :&lt;br /&gt;
      +&lt;br /&gt;
      -&lt;br /&gt;
&amp;lt;Dec_number&amp;gt; :&lt;br /&gt;
      &amp;lt;Dec_digit&amp;gt;-list&lt;br /&gt;
&amp;lt;Dec_digit&amp;gt; : one of&lt;br /&gt;
      0 1 2 3 4 5 6 7 8 9&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== real32 ====&lt;br /&gt;
&lt;br /&gt;
Float-pointing number.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;real32&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values of this domain occupy 4 bytes. This numerical &amp;lt;vp&amp;gt;real32&amp;lt;/vp&amp;gt; domain is introduced for the user&amp;#039;s convenience only. All arithmetic, comparison, and assignment operations can be applied to values of &amp;lt;vp&amp;gt;real32&amp;lt;/vp&amp;gt; domain.&lt;br /&gt;
&lt;br /&gt;
The permitted number range is &amp;lt;vp&amp;gt;-3.4e+38&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;3.4e+38&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The syntax of real32 literals is the same as &amp;lt;vp&amp;gt;real&amp;lt;/vp&amp;gt; lietrals.&lt;br /&gt;
&lt;br /&gt;
==== pointer ====&lt;br /&gt;
&lt;br /&gt;
A pointer to a memory address.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;pointer&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A pointer directly corresponds to memory addresses. Only the equality operation can be applied to the values of this domain. There is a built-in &amp;#039;&amp;#039;&amp;#039;null&amp;#039;&amp;#039;&amp;#039; constant for this type&lt;br /&gt;
&lt;br /&gt;
==== pointerTo ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;pointerTo{Type}&amp;lt;/vp&amp;gt; represents a pointer to a value of type &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt;.  It&amp;#039;s definition is like this (but it is built-in):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;domains&lt;br /&gt;
    pointerTo{Type} = pointerTo(Type Value).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== handle ====&lt;br /&gt;
&lt;br /&gt;
A handle is used for Windows API function call. Values of this domain has the same size as a pointer (i.e. 4 on 32bit platfor and 8 on 64bit platform).&lt;br /&gt;
&lt;br /&gt;
There are no operations for this domain and cannot be converted (except uncheckedConvert) to/from other domains.&lt;br /&gt;
&lt;br /&gt;
There is a built-in [[#nullHandle|nullHandle]] and [[#invalidHandle|invalidHandle]] constant  for this type&lt;br /&gt;
&lt;br /&gt;
==== boolean ====&lt;br /&gt;
&lt;br /&gt;
Boolean values.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;boolean&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This domain is introduced for the user convenience only. It is treated as usual compound domain with the following definition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;domains&lt;br /&gt;
   boolean = false; true.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== factDB ====&lt;br /&gt;
&lt;br /&gt;
Descriptors of named internal databases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;factDB&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This domain has the following hidden meta-declaration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;domains&lt;br /&gt;
   factDB = struct @factdb( named_internal_database_domain, object ).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All user-defined names of facts sections are the constants of this domain. The compiler automatically builds the corresponding compound terms from such constants whenever it&amp;#039;s in need. At the runtime the 1st field of this structure contains the address of the corresponding domain descriptor and the 2nd field contains either zero (for class facts sections) or pointer to an object (i.e. &amp;lt;vp&amp;gt;This&amp;lt;/vp&amp;gt;, for object facts sections).&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{LanguageReferenceSubarticle|Built-in entities/Domains}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Terms&amp;diff=4852</id>
		<title>Language Reference/Terms</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Terms&amp;diff=4852"/>
		<updated>2023-02-19T19:18:44Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: /* Object Expressions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{languageReferenceNavbar|Terms}}&lt;br /&gt;
&lt;br /&gt;
This section describes terms and how execution/evaluation of terms and clauses proceeds.&lt;br /&gt;
&lt;br /&gt;
Semantically, there are two kinds of terms: &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;formulas&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;expressions&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
*Expressions represent values, like the number 7.&lt;br /&gt;
*Formulas represent logical statements, like &amp;quot;the number 7 is greater than the number 3&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Syntactically the two kinds have a huge overlap and therefore the syntax unites the two kinds into &amp;#039;&amp;#039;terms&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The following definition of &amp;lt;vpbnf&amp;gt;&amp;lt;Term&amp;gt;&amp;lt;/vpbnf&amp;gt; is simplified, in the sense that it includes syntactic constructions that are not legal. For example, one cannot legally write &amp;lt;vp&amp;gt;! + !&amp;lt;/vp&amp;gt;. We do however believe that using this simple syntax description in combination with intuitive understanding of language concepts, the type system, and the operator hierarchy described below is better for most purposes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Term&amp;gt;:&lt;br /&gt;
    ( &amp;lt;Term&amp;gt; )&lt;br /&gt;
    &amp;lt;Literal&amp;gt;&lt;br /&gt;
    &amp;lt;Variable&amp;gt;&lt;br /&gt;
    &amp;lt;Identifier&amp;gt;&lt;br /&gt;
    &amp;lt;MemberAccess&amp;gt;&lt;br /&gt;
    &amp;lt;PredicateCall&amp;gt;&lt;br /&gt;
    &amp;lt;PredicateExpression&amp;gt;&lt;br /&gt;
    &amp;lt;UnaryOperator&amp;gt; &amp;lt;Term&amp;gt;&lt;br /&gt;
    &amp;lt;Term&amp;gt; &amp;lt;Operator&amp;gt; &amp;lt;Term&amp;gt;&lt;br /&gt;
    &amp;lt;Cut&amp;gt;&lt;br /&gt;
    &amp;lt;Ellipsis&amp;gt;&lt;br /&gt;
    &amp;lt;FactvariableAssignment&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Backtracking ===&lt;br /&gt;
&lt;br /&gt;
The evaluation of a Prolog program is a search for a &amp;quot;solution&amp;quot; to the goal. Each step in the search for a solution can either &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeed&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fail&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;. At certain points in the program execution there are more than one possible choices for finding a solution. When such a choice point is met a so called &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;backtrack point&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is created. A backtrack point is a recording of the program state plus a pointer to the choice that was not executed. If it turn out that the original choice could not provide the solution (i.e. if it &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fails&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;), then the program will &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;backtrack&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; to the recorded backtrack point. Thereby restoring the program state and pursuing the other choice. The mechanism will be described and exemplified in details in the following sections.&lt;br /&gt;
&lt;br /&gt;
=== Literals ===&lt;br /&gt;
&lt;br /&gt;
Literals have {{lang2|Domains|Universal_Types|universal type}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Literal&amp;gt;:&lt;br /&gt;
   &amp;lt;IntegerLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;RealLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;CharacterLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;StringLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;BinaryLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;ListLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;CompoundDomainLiteral&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also {{lang2|Lexical Elements|Literals|Literals (in Lexical Elements)}}&lt;br /&gt;
&lt;br /&gt;
=== Variables ===&lt;br /&gt;
&lt;br /&gt;
Variables in Visual Prolog are immutable: once they are bound to a value they retain that value, but backtracking can unbind the variable again during the process of restoring a previous program state.&lt;br /&gt;
&lt;br /&gt;
A variable can thus be bound (during unification and matching), if it is already bound then it evaluates to the value that it is bound to.&lt;br /&gt;
&lt;br /&gt;
Variables are names starting with an upper-case letter or with an underscore (_), followed by a sequence of letters (both uppercase and lowercase), digits, and underscore characters (all in all called an UppercaseIdentifier):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Variable&amp;gt;:&lt;br /&gt;
    &amp;lt;UppercaseIdentifer&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following are examples of valid variable names:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;My_first_correct_variable_name&lt;br /&gt;
_&lt;br /&gt;
_Sales_10_11_86&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
while the next two are invalid:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;1stattempt&lt;br /&gt;
second_attempt&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variable consisting of single underscore character (i.e. &amp;lt;vp&amp;gt;_&amp;lt;/vp&amp;gt;) is known as the &amp;#039;&amp;#039;anonymous variable&amp;#039;&amp;#039;. The anonymous variable is used in patterns and bindings where the corresponding value is of no interest and should be ignored.  Every occurrence of the anonymous variable is an independent anonymous variable, i.e. even though the anonymous variable is used several times in a single clause they have no relation to each other.&lt;br /&gt;
&lt;br /&gt;
If variables that starts with an underscore are not anonymous, but they are still intended for values of no interest that should be ignored.  The compiler will issue a warning if the value of such a warning is actually not ignored.&lt;br /&gt;
&lt;br /&gt;
Prolog variables are local to the clause in which it occurs. That is, if two clauses each contain a variable called &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt;, these &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt;-s are two distinct variables.&lt;br /&gt;
&lt;br /&gt;
A variable is said to be &amp;#039;&amp;#039;free&amp;#039;&amp;#039; when it is not yet associated with a term and to be &amp;#039;&amp;#039;bound&amp;#039;&amp;#039; or instantiated when it is unified with a term.&lt;br /&gt;
&lt;br /&gt;
The Visual Prolog compiler does not make a distinction between upper and lower case letters in names, except for the first letter. This means that the two variables &amp;lt;vp&amp;gt;SourceCode&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;SOURCECODE&amp;lt;/vp&amp;gt; are the same.&lt;br /&gt;
&lt;br /&gt;
=== Identifier ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Identifier&amp;gt;: one of&lt;br /&gt;
    &amp;lt;MemberName&amp;gt;&lt;br /&gt;
    &amp;lt;GlobalScopeMembername&amp;gt;&lt;br /&gt;
    &amp;lt;ScopeQualifiedMemberName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;MemberName&amp;gt;:&lt;br /&gt;
    &amp;lt;LowerCaseIdentifier&amp;gt;&lt;br /&gt;
&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Identifiers are used to refer to named entities (i.e. classes, interfaces, constants, domains, predicates, facts, ...).&lt;br /&gt;
&lt;br /&gt;
An identifier can just be a lower case identifier (i.e. a lowercase letter followed by a sequence of letters, numbers and underscore characters).&lt;br /&gt;
&lt;br /&gt;
Many entities can have the same name.  So it may be necessary or desirable to qualify the lowercase identifier the name of the particular scope of interest, or to state that the name is in the global namespace.&lt;br /&gt;
&lt;br /&gt;
{{Example| These are examples of unqualified identifiers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;integer&lt;br /&gt;
mainExe&lt;br /&gt;
myPredicate&amp;lt;/vip&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Global Entities Access ====&lt;br /&gt;
&lt;br /&gt;
The only global entities, which exist in Visual Prolog, are built-in domains, predicates, and constants. Global names are directly accessible in any scope. There might however exist situations where a global name is shadowed by a local or imported name. In that case the global entity can be qualified with a double colon &amp;#039;&amp;lt;vp&amp;gt;::&amp;lt;/vp&amp;gt;&amp;#039; (without a prefixed class/interface name). The double colon can be used everywhere, but the most important place is where an interface name is used as formal parameter type specifier.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;GlobalScopeMemberName&amp;gt;:&lt;br /&gt;
    :: &amp;lt;MemberName&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Example| The built-in domain &amp;lt;vp&amp;gt;integer&amp;lt;/vp&amp;gt; is defined in the global scope, to avoid ambiguity or stress that it is this particular domains you can use the global scope member name:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;::integer&amp;lt;/vip&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Class/Interface Member Access ====&lt;br /&gt;
&lt;br /&gt;
Static members of classes and interfaces are accessed by means of qualification with the class name (and optionally a namespace prefix):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;ScopeQualifiedMemberName&amp;gt;&lt;br /&gt;
    &amp;lt;NamespacePrefix&amp;gt;-opt &amp;lt;ScopeName&amp;gt; :: &amp;lt;MemberName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;NamespacePrefix&amp;gt;:&lt;br /&gt;
    &amp;lt;NamespaceIdentifier&amp;gt;-opt \&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ScopeName&amp;gt;:&lt;br /&gt;
    &amp;lt;LowercaseIdentifier&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ScopeName is the name of the class or interface that defines/declares the name.&lt;br /&gt;
&lt;br /&gt;
Namespace prefixing is explained in: {{lang2|Namespaces|Referencing names in namespaces|Referencing names in namespaces}}.&lt;br /&gt;
&lt;br /&gt;
Some names can be accessed without qualification, see {{lang2|Basic_Concepts|Scoping_&amp;amp;_Visibility|scoping &amp;amp; visibility}}.&lt;br /&gt;
&lt;br /&gt;
=== Predicate Call ===&lt;br /&gt;
&lt;br /&gt;
A predicate call have the form&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;PredicateCall&amp;gt;:&lt;br /&gt;
     &amp;lt;Term&amp;gt; ( &amp;lt;Term&amp;gt;-comma-sep-list-opt )&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first term must be an expression that evaluates to a value with predicate type.  Typically, it is either the name of a predicate in a class, or an expression that evaluates to a predicate member of an object.&lt;br /&gt;
&lt;br /&gt;
Notice that some predicates return values, whereas other predicates do not. A predicate that returns a value is an expression, and the predicate call is often referred to as a &amp;#039;&amp;#039;&amp;#039;function&amp;#039;&amp;#039;&amp;#039; call.  A predicate that does return a value is a formula.&lt;br /&gt;
&lt;br /&gt;
A predicate is invoked by applying arguments to the predicate. The predicate must have a flow-pattern that matches the free/bound state of the arguments.&lt;br /&gt;
&lt;br /&gt;
Most predicates are defined by a set of clauses, but some predicates are built into the language and some are defined externally in a DLL (perhaps in a foreign programming language).&lt;br /&gt;
&lt;br /&gt;
When a predicate is invoked by a predicate call, each clause is executed in turn until one of them &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeeds&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, or there are no more clauses left to execute. If no clause succeeds the predicate &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fails&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
If a clause succeeds and there are more relevant clauses left, a &amp;#039;&amp;#039;&amp;#039;backtrackpoint&amp;#039;&amp;#039;&amp;#039; is created to the next relevant clause.&lt;br /&gt;
&lt;br /&gt;
Thus, a predicate can &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fail&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeed&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, and even &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeed&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; multiple times.&lt;br /&gt;
&lt;br /&gt;
Each clause has a head and optionally a body.&lt;br /&gt;
&lt;br /&gt;
When a predicate is called the clauses are tried in turn (from top to bottom). For each clause the arguments in the head is unified with the arguments from the call. If this unification succeeds then the body of the clause (if present) is executed. The clause &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeeds,&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; if the match of the head &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeeds&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; and the body &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeeds&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;. Otherwise it &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fails&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp() :- qqq(X), write(X), fail.&lt;br /&gt;
&lt;br /&gt;
   qqq(1).&lt;br /&gt;
   qqq(2).&lt;br /&gt;
   qqq(3).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is called it in turn calls &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt;. When &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; is called, it first creates a backtrack point pointing to the second clause. Then the first clause is executed. Hereby the free variable &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; from &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is matched against the number &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;, whereby &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is bound to &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; (i.e. &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;) is written and then &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; cause backtracking to the backtrackpoint. Hereby program control is set to the second clause in &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; and the program state is set back to the state it was in when &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; was first entered, i.e. &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; in &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is unbound again.&lt;br /&gt;
&lt;br /&gt;
Before the actual execution of the second clause in &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; begins a backtrack point to the third clause is created.  The execution then proceeds as it did for &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Unification ===&lt;br /&gt;
&lt;br /&gt;
When a predicate is called the arguments from the call is &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;unified&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; with the terms in the head of each clause.&lt;br /&gt;
&lt;br /&gt;
Unification is the process of binding variables in such a way that two terms become equal, making as few bindings as possible (i.e. leaving as much as possible open for further binding).&lt;br /&gt;
&lt;br /&gt;
Variables can be bound to any kind of terms, including variables or terms containing variables.&lt;br /&gt;
&lt;br /&gt;
Unification is either possible or impossible, i.e. it can &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeed&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fail&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Variables and terms to which they are unified have types, a variable can only be bound to a term of the same type as the variable, or a subtype. When two variables are bound to each other they must therefore have exactly the same type.&lt;br /&gt;
&lt;br /&gt;
Unification takes place (as mentioned) between a predicate call and the clause head. It also takes place when two terms are compared for equality.&lt;br /&gt;
&lt;br /&gt;
{{Example| Consider two terms (of the same type):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;T1 = f1(g(), X, 17, Y, 17)&lt;br /&gt;
T2 = f1(Z, Z, V, U, 43)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will attempt to unify these two terms from left to right (i.e. a left-to-right pre-traversal).&lt;br /&gt;
&lt;br /&gt;
Both &amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt; are &amp;lt;vp&amp;gt;f1/5&amp;lt;/vp&amp;gt; terms, this match. Therefore we attempt to unify each of the arguments from &amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; with each correspondent argument of &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt;. First we must unify &amp;lt;vp&amp;gt;Z&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;, this can be unified if we bind &amp;lt;vp&amp;gt;Z&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;. So far everything is fine and we have the first binding in our unifier:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Z = g()&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next two arguments are &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;Z&amp;lt;/vp&amp;gt;, which already has been bound to &amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;. These two arguments can also be unified if we also bind &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;. So we now have the following contributions to our unifier:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;X = Z = g()&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we must bind &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;17&amp;lt;/vp&amp;gt; and then we must bind &amp;lt;vp&amp;gt;Y&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;U&amp;lt;/vp&amp;gt;. So far everything unifies with the following unifier:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;X = Z = g()&lt;br /&gt;
V = 17&lt;br /&gt;
Y = U&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two unified terms are now equivalent to these terms:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;T1 = f1(g(), g(), 17, Y, 17)&lt;br /&gt;
T2 = f1(g(), g(), 17, Y, 43)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But we have not yet unified the two last arguments, which are &amp;lt;vp&amp;gt;17&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;43&amp;lt;/vp&amp;gt;. No variable binding can make these terms equal, so all in all the unification &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fails&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt; cannot be unified.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
In the example above &amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; could have been a predicate call and &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt; a clause head. But they could also have been two terms that were compared with equal &amp;quot;&amp;lt;vp&amp;gt;=&amp;lt;/vp&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Matching ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Matching&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is the same as unification except that variables can only be bound to grounded terms. A &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;grounded&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; term is a term that does not contain any unbound variables.&lt;br /&gt;
&lt;br /&gt;
It is the flow-patterns that are stated for predicates, that make it possible to use matching rather than full-blown unification.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp(Z, Z, 17).&lt;br /&gt;
   qqq() :-&lt;br /&gt;
      ppp(g(), X, 17).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unification of the &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt;-call with the &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt;-clause is possible with the following unifier:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Z = X = g()&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; have the flow &amp;lt;vp&amp;gt;(i,o,i)&amp;lt;/vp&amp;gt; then the unification is just a match:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt; is input as the first argument, this is bound to &amp;lt;vp&amp;gt;Z&amp;lt;/vp&amp;gt;&lt;br /&gt;
*The second argument in the clause is therefore bound and can thus be output to &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt;, which therefore becomes bound to &amp;#039;&amp;#039;&amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
*finally the third argument is &amp;lt;vp&amp;gt;17&amp;lt;/vp&amp;gt; used as input this number is simply compared to the third argument in the clause.&lt;br /&gt;
&lt;br /&gt;
It is the flow-pattern that makes it possible to predict that the clause does not need real unification.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Nested Function Calls ===&lt;br /&gt;
&lt;br /&gt;
Terms that have to be unified or matched with each other are allowed to contain sub-terms that are actually expressions or function calls that have to be evaluated before the unification/matching can be completed.&lt;br /&gt;
&lt;br /&gt;
The evaluation of such sub-terms is done on a by-need basis.&lt;br /&gt;
&lt;br /&gt;
In a predicate call all input arguments are evaluated before the predicate is called, all output arguments are variables, which does not need evaluation.&lt;br /&gt;
&lt;br /&gt;
Clause heads can also contain terms that have to be evaluated, before matching/unification can be determined.&lt;br /&gt;
&lt;br /&gt;
*all matching/unification that does not require any evaluation is performed before any evaluation is performed;&lt;br /&gt;
*then evaluation corresponding to input arguments is performed one by one left-to-right. Comparing each value to the corresponding input after each evaluation;&lt;br /&gt;
*then the clause body is evaluated;&lt;br /&gt;
*then the output arguments are evaluated (left-to-right);&lt;br /&gt;
*then the return value (if the predicate is a function) is evaluated.&lt;br /&gt;
&lt;br /&gt;
If any of these &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fail&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; then the rest of the evaluation is not carried out.&lt;br /&gt;
&lt;br /&gt;
All in all the base principles are:&lt;br /&gt;
&lt;br /&gt;
*input after other match, before body evaluation&lt;br /&gt;
*output after body evaluation&lt;br /&gt;
*left-to-right&lt;br /&gt;
&lt;br /&gt;
=== Arguments ===&lt;br /&gt;
{{:Language Reference/Terms/Arguments}}&lt;br /&gt;
=== Fact Variable Assignment ===&lt;br /&gt;
&lt;br /&gt;
Assign operator &amp;lt;vp&amp;gt;:=&amp;lt;/vp&amp;gt; is used to assign a new value for a {{lang2|Facts|Fact_Variable_Declarations|fact variable}} &amp;lt;vpbnf&amp;gt;&amp;lt;FactVariable&amp;gt;&amp;lt;/vpbnf&amp;gt;. The &amp;lt;vpbnf&amp;gt;&amp;lt;Term&amp;gt;&amp;lt;/vpbnf&amp;gt; must be evaluated to a value of suitable type (i.e. the same type as the fact variable, or a subtype).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;FactVariableAssignment&amp;gt;:&lt;br /&gt;
    &amp;lt;FactVariable&amp;gt; := &amp;lt;Term&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Facts ===&lt;br /&gt;
&lt;br /&gt;
A fact database contains a number of fully instantiated (grounded) predicate heads corresponding to the facts from the facts section declaration. The facts can be accessed by a predicate call, using the fact name as the predicate name. The predicate call is matched against each fact in turn; succeeding with a possible backtrack point to the next fact each time the predicate call match the fact. When there are no more facts in the fact database then the predicate call fails.&lt;br /&gt;
&lt;br /&gt;
New facts can be &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;asserted&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; using the predicates {{lang2|Built-in_entities|assert|assert/1}}, {{lang2|Built-in_entities|asserta|asserta/1}}, and {{lang2|Built-in_entities|assertz|assertz/1}}. {{lang2|Built-in_entities|assert|assert/1}} is the same as {{lang2|Built-in_entities|assertz|assertz/1}} and it asserts a new fact to the end of the list of facts, whereas {{lang2|Built-in_entities|asserta|asserta/1}} asserts a new fact to the start of the list.&lt;br /&gt;
&lt;br /&gt;
Existing facts can be &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;retracted&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; with the predicate {{lang2|Built-in_entities|retract|retract/1}} and {{lang2|Built-in_entities|retractall|retractAll/1}}. {{lang2|Built-in_entities|retract|retract/1}} retracts the first fact that match the argument binding variables in the argument and leaving a backtrack point so that more facts will potentially be retracted when backtracking.&lt;br /&gt;
&lt;br /&gt;
{{lang2|Built-in_entities|retractall|retractAll/1}} retracts all facts that matches the arguments and succeeds without any binding.&lt;br /&gt;
&lt;br /&gt;
=== Operators ===&lt;br /&gt;
&lt;br /&gt;
Operators are organized in a precedence hierarchy. In the rule below operators in each group have same precedence, which is higher than those below. I.e. the power operator has higher precedence than unary minus and plus, which in turn has higher precedence than the multiplication operators, etc. Parenthesis can be used to circumvent the precedence (and for clarification).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Operator&amp;gt;: one of&lt;br /&gt;
    &amp;lt;PowerOperator&amp;gt;&lt;br /&gt;
    &amp;lt;UnaryOperator&amp;gt;&lt;br /&gt;
    &amp;lt;MultiplicationOperator&amp;gt;&lt;br /&gt;
    &amp;lt;AdditionOperator&amp;gt;&lt;br /&gt;
    &amp;lt;OtherwiseOperator&amp;gt;&lt;br /&gt;
    &amp;lt;RelationOperator&amp;gt;&lt;br /&gt;
    &amp;lt;MustUnifyOperator&amp;gt;&lt;br /&gt;
    &amp;lt;InOperator&amp;gt;&lt;br /&gt;
    &amp;lt;AndOperator&amp;gt;&lt;br /&gt;
    &amp;lt;OrOperator&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;UnaryOperator&amp;gt;: one of&lt;br /&gt;
    - +&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All operators except the &amp;lt;vpbnf&amp;gt;&amp;lt;UnaryOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;&amp;#039;s are binary.  The power operator is right associative, all other operators are left associative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vpbnf&amp;gt;&amp;lt;RelationOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;, &amp;lt;vpbnf&amp;gt;&amp;lt;MustUnifyOperator&amp;gt;&amp;lt;/vpbnf&amp;gt; and &amp;lt;vpbnf&amp;gt;&amp;lt;InOperator&amp;gt;&amp;lt;/vpbnf&amp;gt; have same precedence.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Notice&amp;#039;&amp;#039;&amp;#039; that the placement &amp;lt;vpbnf&amp;gt;&amp;lt;UnaryOperator&amp;gt;&amp;lt;/vpbnf&amp;gt; is not consistent with mathematics, where these operators are at the same level as the &amp;lt;vpbnf&amp;gt;&amp;lt;AdditionalOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;&amp;#039;s.  The difference has no influence of the calculated value, but it allows writing &amp;lt;vp&amp;gt;2*-2&amp;lt;/vp&amp;gt;, where mathematics would require a parenthesis around the second operator &amp;lt;vp&amp;gt;2*(-2)&amp;lt;/vp&amp;gt;.  It also means that &amp;lt;vp&amp;gt;-2*2&amp;lt;/vp&amp;gt; is mmeans (-2)*2 where it would be &amp;lt;vp&amp;gt;-(2*2)&amp;lt;/vp&amp;gt; in mathematics (the resulting value is the same).&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vp&amp;gt;-2^2&amp;lt;/vp&amp;gt; is the same as &amp;lt;vp&amp;gt;-(2^2)&amp;lt;/vp&amp;gt; because ^ has higher precedence than unary minus.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vp&amp;gt;3^2^2&amp;lt;/vp&amp;gt; is the same as &amp;lt;vp&amp;gt;3^(2^2)&amp;lt;/vp&amp;gt; because ^ is right associative.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vp&amp;gt;-2*-3^-4+5&amp;lt;/vp&amp;gt; is the same as &amp;lt;vp&amp;gt;((-2) * (-(3 ^ (-4)))) + 5&amp;lt;/vp&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example| The following term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;7 + 3 * 5 * 13 + 4 + 3 = X / 6 ; A &amp;lt; 7,  p(X)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
has the same meaning as this term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;((((7 + ((3 * 5) * 13)) + 4) + 3) = (X / 6)) ; ((A &amp;lt; 7) , p(X))&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I.e. at outermost level the term is an &amp;quot;&amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;&amp;quot; of two terms, the first of these is a relational (&amp;lt;vp&amp;gt;=&amp;lt;/vp&amp;gt;) term, the second is an &amp;quot;&amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt;&amp;quot; term, etc.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
&lt;br /&gt;
The arithmetic operators are used for arithmetic operations on numbers. They are expressions, which takes expressions as arguments. They have root types as arguments and return universal types as result. (See {{lang2|Domains|Universal_and_Root_Types|Universal and Root types}}.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;PowerOperator&amp;gt;:&lt;br /&gt;
    ^&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;MultiplicationOperator&amp;gt;: one of&lt;br /&gt;
    * / div mod quot rem&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;AdditionOperator&amp;gt;: one of&lt;br /&gt;
    +  -&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Relational Operators ===&lt;br /&gt;
&lt;br /&gt;
The relational operators are formulas, which takes expressions as arguments. Given this nature they are non-associative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;RelationOperator&amp;gt;: one of&lt;br /&gt;
  =   &amp;gt;   &amp;lt;   &amp;gt;=   &amp;lt;=   &amp;lt;&amp;gt;   &amp;gt;&amp;lt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the left term is evaluated, then the right term is evaluated and then the results are compared.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Notice&amp;#039;&amp;#039;&amp;#039; that &amp;lt;vp&amp;gt;&amp;lt;&amp;gt;&amp;lt;/vp&amp;gt; (different) is not the dual operation of = (equal). &amp;lt;vp&amp;gt;&amp;lt;&amp;gt;&amp;lt;/vp&amp;gt; compares two values, whereas &amp;lt;vp&amp;gt;=&amp;lt;/vp&amp;gt; tries to unify two terms (in the general case at least).&lt;br /&gt;
&lt;br /&gt;
The dual to expression &amp;lt;vp&amp;gt;A = B&amp;lt;/vp&amp;gt; is &amp;lt;vp&amp;gt;not (A = B)&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Must Unify Operator ====&lt;br /&gt;
&lt;br /&gt;
The must unify operator is a procedure, which takes expressions as arguments. It is non-associative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;MustUnifyOperator&amp;gt;:&lt;br /&gt;
  ==&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vpbnf&amp;gt;A == B&amp;lt;/vpbnf&amp;gt; unifies &amp;lt;vpbnf&amp;gt;A&amp;lt;/vpbnf&amp;gt; and &amp;lt;vpbnf&amp;gt;B&amp;lt;/vpbnf&amp;gt;; if the unification fails an exception is raised, otherwise the predicate succeeds.  Therefore &amp;lt;vpbnf&amp;gt;A == B&amp;lt;/vpbnf&amp;gt; always succeeds.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    p(L) :-&lt;br /&gt;
        [H|T] == L,&lt;br /&gt;
        ...&amp;lt;/vip&amp;gt;&lt;br /&gt;
&amp;lt;vp&amp;gt;p&amp;lt;/vp&amp;gt; is a procedure. An exception will be raised if it is called with an empty list, because &amp;lt;vp&amp;gt;[H|T]&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt; cannot unify.}}&lt;br /&gt;
&lt;br /&gt;
=== Bitwise and boolean operators ===&lt;br /&gt;
&lt;br /&gt;
The following operators for bitwise operations on &amp;lt;vp&amp;gt;unsigned&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;unsigned64&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;unsignedNative&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;&lt;br /&gt;
A ** B % A and B&lt;br /&gt;
A ++ B % A or B&lt;br /&gt;
A -- B % A and not B&lt;br /&gt;
A ^^ B % A exclusive or B&lt;br /&gt;
~~ A % not A&lt;br /&gt;
A &amp;lt;&amp;lt; N % Shifts the bits in A N times to the left.&lt;br /&gt;
A &amp;gt;&amp;gt; N % Shifts the bits in A N times to the right.&lt;br /&gt;
&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The logical operations (&amp;lt;vp&amp;gt;**&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;++&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;^^&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;~~&amp;lt;/vp&amp;gt;) can also be used on &amp;lt;vp&amp;gt;boolean&amp;lt;/vp&amp;gt; values.&lt;br /&gt;
&lt;br /&gt;
The shift operations discard bits that is shifted out of the number, and shift-in zero bits in the opposite end.&lt;br /&gt;
&lt;br /&gt;
=== Logical Operators ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vpbnf&amp;gt;&amp;lt;AndOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;(s) and &amp;lt;vpbnf&amp;gt;&amp;lt;OrOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;(s) are formulas, which takes formulas as arguments. They are all left associative. The &amp;lt;vp&amp;gt;,&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;and &amp;lt;/vp&amp;gt; are synonyms and so are &amp;lt;vp&amp;gt;; &amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;AndOperator&amp;gt;: one of&lt;br /&gt;
 ,   and&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;OrOperator&amp;gt;: one of&lt;br /&gt;
  ;  or orelse&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== and (,) ====&lt;br /&gt;
&lt;br /&gt;
The evaluation of an &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term &amp;lt;vp&amp;gt;A, B&amp;lt;/vp&amp;gt; proceeds as follows. First the left sub-term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is evaluated. If this evaluation fails, the whole &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term fails. If &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds then the right sub-term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is evaluated. If this evaluation fails, the whole &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term fails, otherwise the &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term succeeds.&lt;br /&gt;
&lt;br /&gt;
Thus the second sub-term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is only evaluated, if the first sub-term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp() :-&lt;br /&gt;
       qqq(), rrr().&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is called it will first call &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; and if &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; succeeds, then it will call &amp;lt;vp&amp;gt;rrr&amp;lt;/vp&amp;gt;. If &amp;lt;vp&amp;gt;rrr&amp;lt;/vp&amp;gt; succeeds, then the &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term and subsequently the whole clause succeeds.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== or (;) ====&lt;br /&gt;
&lt;br /&gt;
The evaluation of an &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt;; &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; proceeds as follows. First a backtrack point to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is created and then the first term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is evaluated. If the evaluation of the first term succeeds, then the whole &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; term succeeds and is left with a backtrack to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt;. If the evaluation of the first term fails, the backtrack point to the second term is activated.&lt;br /&gt;
&lt;br /&gt;
If the backtrack point to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is activated (either because the first term fails, or because something later in the execution invokes the backtrack point), then the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is evaluated and the whole &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; term will succeed if &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
Thus an &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; term can succeed with a backtrack point and the second sub-term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is only evaluated on backtrack.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp() :-&lt;br /&gt;
       (V = 3 or V = 7), write(V), fail.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we have used the keyword &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;, but you can also use semi-colon &amp;lt;vp&amp;gt;;&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is called we first create a backtrack point to the term &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; and then we evaluate &amp;lt;vp&amp;gt;V = 3&amp;lt;/vp&amp;gt;. Thereby &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; will be bound to &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt; we then continue to the &amp;lt;vp&amp;gt;write(V)&amp;lt;/vp&amp;gt; after &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt; has been written &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; is met. &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; always fails so we effectuate the backtrack point leading us to the term &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Backtracking also undo all bindings made since the backtrack point was created. In this case it means that &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; is unbound.&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; is evaluated and &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; becomes bound to &amp;lt;vp&amp;gt;7&amp;lt;/vp&amp;gt; and er continue to the term &amp;lt;vp&amp;gt;write(V)&amp;lt;/vp&amp;gt;, and then &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; is met again, this time there are no more backtrack points &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; fails.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Using parentheses &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; can be nested deeply in clauses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   p(X) = Y :-&lt;br /&gt;
       (X = 1, !, Z = 3 or Z = 7), Y = 2*Z.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We recommend careful usage of &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;. It is mainly intended for usage in test-conditions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   isOutside(X) :-&lt;br /&gt;
       (X &amp;lt; 10 or X &amp;gt; 90), !.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; is a nondeterministic construction, but &amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; can be used as a deterministic pendant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   isOutside(X) :-&lt;br /&gt;
       X &amp;lt; 10 orelse X &amp;gt; 90.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== orelse ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; is a deterministic pendant to the nondeterministic &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;.  &amp;lt;vp&amp;gt;A orelse B&amp;lt;/vp&amp;gt; will succeed if &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds or if &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; succeeds, but it will &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; leave a backtrack point to &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; if &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
The evaluation of an &amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; term &amp;lt;vp&amp;gt;A orelse B&amp;lt;/vp&amp;gt; proceeds as follows: First a backtrack point to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is created and then the first term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is evaluated. If the evaluation of the first term succeeds then the backtrack to the second term (and any backtrack point within it) &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; are removed again and the whole &amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; term succeeds. If the evaluation of the first term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; fails, the backtrack point to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is evaluated.&lt;br /&gt;
&lt;br /&gt;
So an &amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; term does not leave a backtrack point.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp(V) :-&lt;br /&gt;
       (V = 3 orelse V = 7), write(V).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is called we first create a backtrack point to the term &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; and then we evaluate the term &amp;lt;vp&amp;gt;V = 3&amp;lt;/vp&amp;gt;, if &amp;lt;vp&amp;gt;V = 3&amp;lt;/vp&amp;gt; succeeds we remove the backtrack point to &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; again and then continue to &amp;lt;vp&amp;gt;write(V)&amp;lt;/vp&amp;gt;.  If &amp;lt;vp&amp;gt;V = 3&amp;lt;/vp&amp;gt; fails the backtrack point to &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; is effectuated.  If &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; succeeds we continue to &amp;lt;vp&amp;gt;write(V)&amp;lt;/vp&amp;gt;, if &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; fails the entire &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; predicate will fail.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== otherwise ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;otherwise&amp;lt;/vp&amp;gt; is an expression operator; though it has control flow that makes it resemble the logical operators. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;A otherwise B&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an expression (&amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; must be expressions).  If the evaluation of &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds by evaluating to the value VA then &amp;lt;vp&amp;gt;A otherwise B&amp;lt;/vp&amp;gt; evaluates to VA, otherwise (i.e. if the evaluation of &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; fails) then &amp;lt;vp&amp;gt;A otherwise B&amp;lt;/vp&amp;gt; will be the result of evaluating &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;otherwise&amp;lt;/vp&amp;gt; is right associative:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;A otherwise B otherwise C&lt;br /&gt;
=&amp;gt;&lt;br /&gt;
A otherwise (B otherwise C)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It has lower precedence than all other expression operators, but higher than relational operators:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;V &amp;lt; A + tryGet() otherwise 9&lt;br /&gt;
=&amp;gt;&lt;br /&gt;
V &amp;lt; ((A + tryGet()) otherwise 9)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;core&amp;lt;/vp&amp;gt; have been enriched with a predicate &amp;lt;vp&amp;gt;isSome&amp;lt;/vp&amp;gt; for providing default values for &amp;lt;vp&amp;gt;core::optional&amp;lt;/vp&amp;gt; matching:&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;V = isSome(Optional) otherwise 0&amp;lt;/vip&amp;gt;&lt;br /&gt;
If &amp;lt;vp&amp;gt;Optional&amp;lt;/vp&amp;gt; have the form &amp;lt;vp&amp;gt;some(X)&amp;lt;/vp&amp;gt; then &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; will get the value &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; otherwise &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; will get the value &amp;lt;vp&amp;gt;0&amp;lt;/vp&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
==== not ====&lt;br /&gt;
&lt;br /&gt;
The {{lang2|Built-in_entities|not|not/1}} takes a term as the argument. The evaluation of &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; first evaluates &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt;. If &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds, then &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; fails, if &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; fails, then &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
Notice that &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; will never bind any variables, because if &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; succeeds then &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; has failed, and a failed term does not bind anything. If &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; on the other hand fails, it cannot bind any variables either, because then the term itself failed.&lt;br /&gt;
&lt;br /&gt;
Also notice that &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; can never succeed with backtrack points, because if &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; succeeds then &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; have failed, and a failed term cannot contain any backtrack points. This in turn means that all possibilities of success in &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; have been exhausted.&lt;br /&gt;
&lt;br /&gt;
==== cut (!) ====&lt;br /&gt;
&lt;br /&gt;
Cut &amp;quot;&amp;lt;vp&amp;gt;!&amp;lt;/vp&amp;gt;&amp;quot; removes all backtrack points created since the entrance to the current predicate, this means all backtrack points to subsequent clauses, plus backtrack points in predicate calls made in the current clause before the &amp;quot;&amp;lt;vp&amp;gt;!&amp;lt;/vp&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Cut&amp;gt;:&lt;br /&gt;
    !&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp(X) :-&lt;br /&gt;
       X &amp;gt; 7,&lt;br /&gt;
       !,&lt;br /&gt;
       write(&amp;quot;Greater than seven&amp;quot;).&lt;br /&gt;
   ppp(_X) :-&lt;br /&gt;
       write(&amp;quot;Not greater than seven&amp;quot;).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is executed, there is first created a backtrack point to the second clause, and then the first clause is executed. If the test &amp;quot;&amp;lt;vp&amp;gt;X &amp;gt; 7&amp;lt;/vp&amp;gt;&amp;quot; succeeds then the cut &amp;quot;&amp;lt;vp&amp;gt;!&amp;lt;/vp&amp;gt;&amp;quot; is reached. This cut &amp;quot;&amp;lt;vp&amp;gt;!&amp;lt;/vp&amp;gt;&amp;quot; will remove the backtrack point to the second clause.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp() :-&lt;br /&gt;
       qqq(X),&lt;br /&gt;
       X &amp;gt; 7,&lt;br /&gt;
       !,&lt;br /&gt;
       write(&amp;quot;Found one&amp;quot;).&lt;br /&gt;
   ppp() :-&lt;br /&gt;
       write(&amp;quot;Did not find one&amp;quot;).&lt;br /&gt;
clauses&lt;br /&gt;
   qqq(3).&lt;br /&gt;
   qqq(12).&lt;br /&gt;
   qqq(13).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is executed it first creates a backtrack point to the second &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; clause and then &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; is called. The &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; will create a backtrack point to the second &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; clause and execute the first clause, thereby returning the value &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt;. In &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; variable &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is bound to this value and then compared to &amp;lt;vp&amp;gt;7&amp;lt;/vp&amp;gt;. This test fails and, therefore, the control backtracks to the second clause of &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before executing the second clause a new backtrack point to the third clause of &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; is created and then the second clause returns &amp;lt;vp&amp;gt;12&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This time the test against &amp;lt;vp&amp;gt;7&amp;lt;/vp&amp;gt; succeeds and, therefore, the cut is executed. This cut will remove both the backtrack point left in &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; as well as the backtrack point to the second clause of &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== cut Scopes =====&lt;br /&gt;
&lt;br /&gt;
A cut scope is a scope to which the effect of a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is limited. Meaning that if a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is met within a cut scope then only backtrack points within that scope are discarded, while backtrack points outside (i.e. prior to) the cut scope remains.&lt;br /&gt;
&lt;br /&gt;
The clauses of a predicate is a cut scope. Meeting a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; will (at most) discard the backtrack points that was created after entrance to the predicate.  Backtrack points created before entrance to the predicate will remain.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   aaa() :- p1_nd(), qqq().&lt;br /&gt;
   qqq() :- p2_nd(), !.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;aaa&amp;lt;/vp&amp;gt; calls &amp;lt;vp&amp;gt;p1_nd&amp;lt;/vp&amp;gt;, which leaves a backtrack point, and then it calls &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt;. &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; calls &amp;lt;vp&amp;gt;p2_nd&amp;lt;/vp&amp;gt;, which also leaves a backtrack point. Then we meet a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt;. This &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is in the &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt;-scope of the &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; predicate, so it is only the backtrack point in &amp;lt;vp&amp;gt;p2_nd&amp;lt;/vp&amp;gt; which is discarded, the one in &amp;lt;vp&amp;gt;p1_nd&amp;lt;/vp&amp;gt; remains.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Several terms introduce cut scopes (see the respective terms: {{lang2|Terms|List_Comprehension|list comprehension}}, {{lang2|Terms|if-then-else|if-then-else}}, {{lang2|Terms|foreach|foreach}}). Here we will use &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; to illustrate the effect of cut scopes.  Consider the schematic &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;if Cond then T1 else T2 end if&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The condition &amp;lt;vp&amp;gt;Cond&amp;lt;/vp&amp;gt; is a cut-scope, meaning that a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; inside &amp;lt;vp&amp;gt;Cond&amp;lt;/vp&amp;gt; will only have effect inside &amp;lt;vp&amp;gt;Cond&amp;lt;/vp&amp;gt;. &amp;lt;vp&amp;gt;Cut&amp;lt;/vp&amp;gt;s inside &amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt;, on the other hand, have effect outside the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; statement.&lt;br /&gt;
&lt;br /&gt;
Consider this code fragment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;X = getMember_nd([3,1,2]),&lt;br /&gt;
if X = getMember_nd([3,3]), ! then&lt;br /&gt;
   write(X)&lt;br /&gt;
else&lt;br /&gt;
   !&lt;br /&gt;
end if,&lt;br /&gt;
fail&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt; is a nondeterministic predicate. The evaluation of this code will go as follows. First &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is bound to &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt; leaves a backtrack point (so that &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; can later become &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt; and then even &amp;lt;vp&amp;gt;2&amp;lt;/vp&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Then we evaluate the condition in the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term. The first part of this condition succeeds as &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt; is a member of &amp;lt;vp&amp;gt;[3,3]&amp;lt;/vp&amp;gt;. The first part also leaves a backtrack point, so that it can be examined whether &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is a member several times.&lt;br /&gt;
&lt;br /&gt;
Now we meet a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt;. This &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is inside the condition part of an &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; statement, so it only has local effect, meaning that it only discards the backtrack point in the second &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt;, but leaves the backtrack point in the first &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt; predicate.&lt;br /&gt;
&lt;br /&gt;
The whole condition succeeds and we enter the then-part and write out &amp;quot;&amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
After the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; we meet &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt;, which backtracks us to the first &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt; then binds &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;, and leaves a backtrack point (so that &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; can later become &amp;lt;vp&amp;gt;2&amp;lt;/vp&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Then we evaluate the condition in the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term. The first part of this condition fails as &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt; is not a member of &amp;lt;vp&amp;gt;[3,3]&amp;lt;/vp&amp;gt;. So we enter the &amp;lt;vp&amp;gt;else&amp;lt;/vp&amp;gt;-part.&lt;br /&gt;
&lt;br /&gt;
Here we meet a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt;. This &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is in the &amp;lt;vp&amp;gt;else&amp;lt;/vp&amp;gt;-part of a conditional term so it has effect outside the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term and subsequently it discards the backtrack point in the first &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When we meet the &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; after the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term there are no more backtrack points in the code and it will fail. So all in all &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; never becomes &amp;lt;vp&amp;gt;2&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== fail/0 and succeed/0 ====&lt;br /&gt;
&lt;br /&gt;
{{lang2|Built-in_entities|fail|fail/0}} and {{lang2|Built-in_entities|succeed|succeed/0}} are two built-in nullary predicates. {{lang2|Built-in_entities|fail|fail/0}} always fails and {{lang2|Built-in_entities|succeed|succeed/0}} always succeeds, besides this the predicates have no effect.&lt;br /&gt;
&lt;br /&gt;
=== in ===&lt;br /&gt;
{{:Language Reference/Terms/in}}&lt;br /&gt;
=== List Comprehension ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;ListComprehensionTerm&amp;gt; :&lt;br /&gt;
    [ &amp;lt;Term&amp;gt; || &amp;lt;Term&amp;gt; ]&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list comprehension term is a list expression. Consider this schematic term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;[ Exp || Gen ]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt; is (typically) a &amp;lt;vp&amp;gt;nondeterm&amp;lt;/vp&amp;gt; term. &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt; is evaluated for each solution of &amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt;, and the resulting &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt;&amp;#039;s are collected in a list. The &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt; corresponding to the first solution of &amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt; is the first element in the list, etc. This list is the result of the list comprehension term. &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt; must be procedure (or erroneous). Both &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt; are {{lang2|Terms|Cut_Scopes|cut scopes}}.&lt;br /&gt;
&lt;br /&gt;
The list comprehension (normally) reads: The list of &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt;&amp;#039;s such that &amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;[ X || X = getMember_nd(L), X mod 2 = 0 ]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This reads the list of &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt;&amp;#039;s such that &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is in &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is even. So this expression is the even numbers of &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;[ X + 1 || X = getMember_nd(L), X mod 2 = 0 ]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the collected expression is more complex. This makes say the term more awkward:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;the list of (X+1)&amp;#039;s such that ...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This expression again finds the even elements in &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt;, but the resulting list contains all these values incremented.&lt;br /&gt;
&lt;br /&gt;
This term is completely equivalent to this term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;[ Y || X = getMember_nd(L), X mod 2 = 0 , Y = X+1 ]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This term is easier to say:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;The list of Y&amp;#039;s such that (there exists an) X which is member of L, and which is even, and Y is X+1.&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Anonymous Predicates ===&lt;br /&gt;
{{:Language Reference/Terms/Anonymous Predicates}}&lt;br /&gt;
=== Object Member Access ===&lt;br /&gt;
Whenever we have a reference to an object, we can access the object member predicates of that object.&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;MemberAccess&amp;gt;:&lt;br /&gt;
    &amp;lt;Term&amp;gt; : &amp;lt;Identifier&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Currently, the {{lang|Terms|term}} must be a variable or a fact variable).&lt;br /&gt;
&lt;br /&gt;
The {{lang2|Lexical_Elements|Identifiers|identifier}} must have the type of the {{lang|Terms|term}}.&lt;br /&gt;
&lt;br /&gt;
Inside an implementation object member predicates can be invoked without reference to an object, because &amp;quot;&amp;lt;vp&amp;gt;This&amp;lt;/vp&amp;gt;&amp;quot; is subsumed, see {{lang2|Basic_Concepts|Scoping_&amp;amp;_Visibility|Scoping}}.&lt;br /&gt;
&lt;br /&gt;
=== Object Expressions ===&lt;br /&gt;
&lt;br /&gt;
An object expressions is an expressions that evaluates to an object.  Like anonymous predicates it can capture values from and access facts in the context it appears in.&lt;br /&gt;
&lt;br /&gt;
The syntax is like a regular class implementation without a name, but with a construction interface:&lt;br /&gt;
&lt;br /&gt;
{{Example|&amp;lt;vip&amp;gt;Object = &lt;br /&gt;
    implement : observer&lt;br /&gt;
      clauses&lt;br /&gt;
        onNext(A) :- F(toString(A)).&lt;br /&gt;
        onCompletion() :- F(&amp;quot;\n&amp;quot;).&lt;br /&gt;
    end implement&amp;lt;/vip&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
the &amp;lt;vp&amp;gt;implement ... end implement&amp;lt;/vp&amp;gt; part is an object expression.&lt;br /&gt;
To make object expressions a lightweight construction the keyword &amp;lt;vp&amp;gt;clauses&amp;lt;/vp&amp;gt; is implicit/optional at the beginning of the scope (unless the scope has &amp;lt;vp&amp;gt;open&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;supports&amp;lt;/vp&amp;gt; or &amp;lt;vp&amp;gt;inherits&amp;lt;/vp&amp;gt; qualifications).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;ObjectExpression&amp;gt;: one of&lt;br /&gt;
    &amp;lt;FullObjectExpression&amp;gt;&lt;br /&gt;
    &amp;lt;SimpleObjectExpression&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;FullObjectExpression&amp;gt;:&lt;br /&gt;
    implement : &amp;lt;ConstructionType&amp;gt;&lt;br /&gt;
        &amp;lt;ScopeQualifications&amp;gt;&lt;br /&gt;
        &amp;lt;Sections&amp;gt;&lt;br /&gt;
    end implement&lt;br /&gt;
&lt;br /&gt;
&amp;lt;SimpleObjectExpression&amp;gt;:&lt;br /&gt;
    implement : &amp;lt;ConstructionType&amp;gt;&lt;br /&gt;
        &amp;lt;Clause&amp;gt;-dot-term-list-opt&lt;br /&gt;
        &amp;lt;Sections&amp;gt;&lt;br /&gt;
    end implement&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There will be exactly one constructor &amp;lt;vp&amp;gt;new\0&amp;lt;/vp&amp;gt;. Like for other objects you don&amp;#039;t need to supply an implementation if the constructor is &amp;#039;trivial&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;inherits&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;supports&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;open&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;delegate&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;resolve&amp;lt;/vp&amp;gt; works in the same way as in regular implementations.&lt;br /&gt;
&lt;br /&gt;
=== Scoping ===&lt;br /&gt;
&lt;br /&gt;
The predicates can refer to the context like anonymous predicates but can also refer to facts and inherited classes inside the object.&lt;br /&gt;
&lt;br /&gt;
Object expressions are nested within other scopes, these scopes are all visible from the object expression.  If a name is defined in more than one surrounding scope then the reference is to the closest level.  Names from named scopes can be resolved with the scope name, but names from surrounding object expressions must be resolved by means of a variable as described in the &amp;quot;This&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
=== This ===&lt;br /&gt;
&lt;br /&gt;
In a predicate in an object expression the variable &amp;lt;vp&amp;gt;This&amp;lt;/vp&amp;gt; represent the object of the object expression.  There are no predefined names for surrounding &amp;lt;vp&amp;gt;This&amp;lt;/vp&amp;gt; variables.  So if you want to refer to an outer &amp;lt;vp&amp;gt;This&amp;lt;/vp&amp;gt; you will have to put it in another variable e.g. &amp;lt;vp&amp;gt;Outer = This&amp;lt;/vp&amp;gt; and then use that variable inside the object expression.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;...&lt;br /&gt;
    Outer = This,&lt;br /&gt;
    Object = &lt;br /&gt;
        implement : observer&lt;br /&gt;
            onNext(A) :- F(Outer, toString(A))).&lt;br /&gt;
            onCompletion() :- F(Outer, &amp;quot;\n&amp;quot;)).&lt;br /&gt;
        end implement&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Polymorphism (limitation) ===&lt;br /&gt;
&lt;br /&gt;
Occasionally there will be situations where we will need a type variable.  An example would be a predicate &amp;lt;vp&amp;gt;p : () -&amp;gt; observer{A}&amp;lt;/vp&amp;gt; implemented using an object expression. Unfortunately, this is not possible until we get access to the type variables of polymorphic constructions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;&lt;br /&gt;
clauses&lt;br /&gt;
    p(Value) = &lt;br /&gt;
        implement : observer{A} % A is unknown/unbound&lt;br /&gt;
        facts&lt;br /&gt;
            v : A = Value. % A is unknown/unbound&lt;br /&gt;
        clauses&lt;br /&gt;
            onNext(V) :- v := V.&lt;br /&gt;
            onCompleted():- write(v).&lt;br /&gt;
        end implement.&lt;br /&gt;
&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The examples below will be based on &amp;lt;vp&amp;gt;iterator&amp;lt;/vp&amp;gt; objets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface iterator&lt;br /&gt;
predicates&lt;br /&gt;
   hasNext : () determ.&lt;br /&gt;
   next : () -&amp;gt; integer.&lt;br /&gt;
end interface iterator&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which we will write using this predicate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    writeAll : (iterator It).&lt;br /&gt;
clauses&lt;br /&gt;
    writeAll(It) :-&lt;br /&gt;
        if It:hasNext() then&lt;br /&gt;
            writef(&amp;quot;%\n&amp;quot;, It:next()),&lt;br /&gt;
            writeAll(It)&lt;br /&gt;
        else&lt;br /&gt;
            write(&amp;quot;&amp;lt;&amp;lt;&amp;lt;end&amp;gt;&amp;gt;&amp;gt;\n&amp;quot;)&lt;br /&gt;
        end if.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Simple  object ====&lt;br /&gt;
&lt;br /&gt;
{{Example|We can write a simple &amp;quot;null&amp;quot; &amp;lt;vp&amp;gt;iterator&amp;lt;/vp&amp;gt; that is finished immediately.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    test1 : ().&lt;br /&gt;
clauses&lt;br /&gt;
    test1() :-&lt;br /&gt;
        It =&lt;br /&gt;
            implement : iterator&lt;br /&gt;
                hasNext() :-&lt;br /&gt;
                    fail.&lt;br /&gt;
                next() = _ :-&lt;br /&gt;
                    exception::raise_error().&lt;br /&gt;
            end implement,&lt;br /&gt;
        writeAll(It).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calling &amp;lt;vp&amp;gt;test1&amp;lt;/vp&amp;gt; will produce&lt;br /&gt;
 &amp;lt;&amp;lt;&amp;lt;end&amp;gt;&amp;gt;&amp;gt;&lt;br /&gt;
 }}&lt;br /&gt;
&lt;br /&gt;
==== Own state====&lt;br /&gt;
&lt;br /&gt;
{{Example|In this example we create an iterator object that har its own fact &amp;lt;vp&amp;gt;n&amp;lt;/vp&amp;gt; which is used to count down from &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    test2 : ().&lt;br /&gt;
clauses&lt;br /&gt;
    test2() :-&lt;br /&gt;
        It =&lt;br /&gt;
            implement : iterator&lt;br /&gt;
                hasNext() :-&lt;br /&gt;
                    n &amp;gt; 0.&lt;br /&gt;
                next() = N :-&lt;br /&gt;
                    N = n,&lt;br /&gt;
                    n := n - 1.&lt;br /&gt;
            facts&lt;br /&gt;
                n : integer := 3.&lt;br /&gt;
            end implement,&lt;br /&gt;
        writeAll(It).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calling &amp;lt;vp&amp;gt;test2&amp;lt;/vp&amp;gt; will produce&lt;br /&gt;
  3&lt;br /&gt;
  2&lt;br /&gt;
  1&lt;br /&gt;
 &amp;lt;&amp;lt;&amp;lt;end&amp;gt;&amp;gt;&amp;gt;&lt;br /&gt;
 }}&lt;br /&gt;
&lt;br /&gt;
==== Capturing values ====&lt;br /&gt;
&lt;br /&gt;
{{Example|The count down object from above can be placed in its own predicate, and we can capture the value to count down &amp;lt;vp&amp;gt;From&amp;lt;/vp&amp;gt; in the context:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    countDown : (integer From) -&amp;gt; iterator It.&lt;br /&gt;
clauses&lt;br /&gt;
    countDown(From) =&lt;br /&gt;
        implement : iterator&lt;br /&gt;
            hasNext() :-&lt;br /&gt;
                n &amp;gt; 0.&lt;br /&gt;
            next() = N :-&lt;br /&gt;
                N = n,&lt;br /&gt;
                n := n - 1.&lt;br /&gt;
        facts&lt;br /&gt;
            n : integer := From.&lt;br /&gt;
        end implement.&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    test3 : ().&lt;br /&gt;
clauses&lt;br /&gt;
    test3() :-&lt;br /&gt;
        It = countDown(2),&lt;br /&gt;
        writeAll(It).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calling &amp;lt;vp&amp;gt;test3&amp;lt;/vp&amp;gt; will produce&lt;br /&gt;
  2&lt;br /&gt;
  1&lt;br /&gt;
 &amp;lt;&amp;lt;&amp;lt;end&amp;gt;&amp;gt;&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Example|Here &amp;lt;vp&amp;gt;map&amp;lt;/vp&amp;gt; create an iterator that maps the values returned  &amp;lt;vp&amp;gt;iterator&amp;lt;/vp&amp;gt; just like it would have modified the values of a list.  Notice how the object expression captures the variables &amp;lt;vp&amp;gt;F&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;It&amp;lt;/vp&amp;gt; and accesses them in its member predicates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    map : (function{integer, integer} Function, iterator It) -&amp;gt; iterator Mapped.&lt;br /&gt;
clauses&lt;br /&gt;
    map(F, It) =&lt;br /&gt;
        implement : iterator&lt;br /&gt;
            hasNext() :-&lt;br /&gt;
                It:hasNext().&lt;br /&gt;
            next() = F(It:next()).&lt;br /&gt;
        end implement.&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    test4 : ().&lt;br /&gt;
clauses&lt;br /&gt;
    test4() :-&lt;br /&gt;
        It1 = countDown(2),&lt;br /&gt;
        It2 = map({ (V) = V + 7 }, It1),&lt;br /&gt;
        writeAll(It2).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calling &amp;lt;vp&amp;gt;test4&amp;lt;/vp&amp;gt; will produce&lt;br /&gt;
  9&lt;br /&gt;
  8&lt;br /&gt;
 &amp;lt;&amp;lt;&amp;lt;end&amp;gt;&amp;gt;&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Capturing a fact ====&lt;br /&gt;
&lt;br /&gt;
{{Example|Here the fact &amp;lt;vp&amp;gt;count&amp;lt;/vp&amp;gt; from the context is captured and manipulated from within the object expression.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class facts&lt;br /&gt;
    count : integer := 3.&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    test5 : ().&lt;br /&gt;
clauses&lt;br /&gt;
    test5() :-&lt;br /&gt;
        It =&lt;br /&gt;
            implement : iterator&lt;br /&gt;
                hasNext() :-&lt;br /&gt;
                    count &amp;gt; 0.&lt;br /&gt;
                next() = N :-&lt;br /&gt;
                    N = count,&lt;br /&gt;
                    count := count - 1.&lt;br /&gt;
            end implement,&lt;br /&gt;
        writeAll(It).&lt;br /&gt;
&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calling &amp;lt;vp&amp;gt;test5&amp;lt;/vp&amp;gt; will produce&lt;br /&gt;
  3&lt;br /&gt;
  2&lt;br /&gt;
  1&lt;br /&gt;
 &amp;lt;&amp;lt;&amp;lt;end&amp;gt;&amp;gt;&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== inherits ====&lt;br /&gt;
&lt;br /&gt;
{{Example|Suppose we have a class &amp;lt;vp&amp;gt;randomIterator&amp;lt;/vp&amp;gt; which generates random numbers and supports the &amp;lt;vp&amp;gt;iterator&amp;lt;/vp&amp;gt; iterator.&lt;br /&gt;
We can inherit from this iterator to create a iterator that &amp;quot;throws a dice&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    test6 : ().&lt;br /&gt;
clauses&lt;br /&gt;
    test6() :-&lt;br /&gt;
        Dice =&lt;br /&gt;
            implement : iterator inherits randomIterator&lt;br /&gt;
            clauses&lt;br /&gt;
                next() = randomIterator::next() mod 6 + 1.&lt;br /&gt;
            end implement,&lt;br /&gt;
        foreach _ = std::cIterate(5) do&lt;br /&gt;
            writef(&amp;quot;Dice : %\n&amp;quot;, Dice:next())&lt;br /&gt;
        end foreach.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By inheriting &amp;lt;vp&amp;gt;randomIterator&amp;lt;/vp&amp;gt; we get the implementation of &amp;lt;vp&amp;gt;hasNext&amp;lt;/vp&amp;gt; and only need to implement &amp;lt;vp&amp;gt;next&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Notice that it is necessary to use the &amp;lt;vp&amp;gt;clauses&amp;lt;/vp&amp;gt; keyword in this case because the class has an &amp;lt;vp&amp;gt;inherits&amp;lt;/vp&amp;gt; qualification.&lt;br /&gt;
&lt;br /&gt;
Assuming that &amp;lt;vp&amp;gt;randomIterator&amp;lt;/vp&amp;gt; will never end, we just iterate &amp;lt;vp&amp;gt;5&amp;lt;/vp&amp;gt; times.&lt;br /&gt;
&lt;br /&gt;
Calling &amp;lt;vp&amp;gt;test5&amp;lt;/vp&amp;gt; will produce (something like):&lt;br /&gt;
 Dice : 1&lt;br /&gt;
 Dice : 2&lt;br /&gt;
 Dice : 4&lt;br /&gt;
 Dice : 2&lt;br /&gt;
 Dice : 3&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Domain, Functor, and Constant Access ===&lt;br /&gt;
&lt;br /&gt;
Domains, functors, and constants are all accessed as if they are class members. Even if they are declared in an interface. This means that when they are qualified, then they are always qualified with class/interface name and a double colon.&lt;br /&gt;
&lt;br /&gt;
=== foreach ===&lt;br /&gt;
{{:Language Reference/Terms/Foreach}}&lt;br /&gt;
=== if-then-else ===&lt;br /&gt;
{{:Language Reference/Terms/If-then-else}}&lt;br /&gt;
=== try-catch-finally ===&lt;br /&gt;
{{:Language Reference/Terms/Try-catch-finally}}&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Predicates&amp;diff=4815</id>
		<title>Language Reference/Built-in entities/Predicates</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Predicates&amp;diff=4815"/>
		<updated>2021-06-07T16:51:04Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;__NOTOC__&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#and_.28.2C.29|and/2]] &amp;lt;br&amp;gt; [[Language_Reference/Terms#and_.28.2C.29|,/2]]&lt;br /&gt;
|Term &amp;quot;and&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[#assert|assert/1]]&lt;br /&gt;
|Insert the specified fact at the end of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#asserta|asserta/1]]&lt;br /&gt;
|Insert a fact at the beginning of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#assertz|assertz/1]]&lt;br /&gt;
|Insert a fact at the end of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#bound|bound/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Test whether the specified variable is bound to a value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#class_name|class_name/0-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;ClassName&amp;#039;&amp;#039; that represents the name of the current interface or class.&lt;br /&gt;
|-&lt;br /&gt;
|[[#compare|compare/2-&amp;gt;]]&lt;br /&gt;
|Returns the result of the variables&amp;#039; comparison.&lt;br /&gt;
|-&lt;br /&gt;
|[[#constant_name|constant_name/0-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;ConstantName&amp;#039;&amp;#039; that represents the name of the current constant.  Typically used in execepion definitions.&lt;br /&gt;
|-&lt;br /&gt;
|[[#convert|convert/2-&amp;gt;]]&lt;br /&gt;
|Checked term conversion.&lt;br /&gt;
|-&lt;br /&gt;
|[[#digitsOf|digitsOf/1-&amp;gt;]]&lt;br /&gt;
|Returns precision of the specified floating-point domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#errorExit|errorExit/1]] &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Performs a run-time error with the specified return code &amp;#039;&amp;#039;ErrorNumber&amp;#039;&amp;#039; and sets the internal error information.&lt;br /&gt;
|-&lt;br /&gt;
|[[#fact_address|fact_address/1-&amp;gt;]]&lt;br /&gt;
|Returns the address of a fact variable.&lt;br /&gt;
|-&lt;br /&gt;
|[[#fail|fail/0]] &amp;lt;vp&amp;gt;failure&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Invoke backtracking.&lt;br /&gt;
|-&lt;br /&gt;
|[[#free|free/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Check whether a variable is free.&lt;br /&gt;
|-&lt;br /&gt;
|[[#fromEllipsis|fromEllipsis/1-&amp;gt;]]&lt;br /&gt;
|Creates the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; from the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#hasDomain|hasDomain/2]] &amp;lt;br&amp;gt; [[#hasDomain|hasDomain/2-&amp;gt;]]&lt;br /&gt;
|Declares/restricts the type of a variable or value.&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#in|in/2]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt; &amp;lt;br&amp;gt; [[Language_Reference/Terms#in|in/2]] &amp;lt;vp&amp;gt;nondeterm&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Infix operator &amp;quot;in&amp;quot; (in-test and in-iterator).&lt;br /&gt;
|-&lt;br /&gt;
|[[#isErroneous|isErroneous/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Returns the lower bound value of the specified numeric domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#lowerBound|lowerBound/1-&amp;gt;]]&lt;br /&gt;
|Returns the lower bound value of the specified numeric domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#maxDigits|maxDigits/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the value of digits (precision) of the basic domain corresponding to the specified floating-point domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#not|not/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Negate the result (success/fail) of subgoal.&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#otherwise|otherwise/2]]&lt;br /&gt;
|Infix expression operator providing a value when a determ expression fails&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#or_.28.3B.29|or/2]] &amp;lt;br&amp;gt; [[Language_Reference/Terms#and_.28.3B.29|;/2]]&lt;br /&gt;
|Nondeterministic term &amp;quot;or&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#orelse|orelse]]&lt;br /&gt;
|Deterministic term &amp;quot;or&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[#predicate_fullname|predicate_fullname/1-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;PredicateFullName&amp;#039;&amp;#039; that represent the name of the predicate in which clause body &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; is called. The returned predicate name is qualified with a scope name.&lt;br /&gt;
|-&lt;br /&gt;
|[[#predicate_name|predicate_name/1-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;PredicateName&amp;#039;&amp;#039; that represent the name of the predicate in which clause body &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; is called. The returned predicate name is not qualified with a scope name.&lt;br /&gt;
|-&lt;br /&gt;
|[[#programPoint|programPoint/0-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the &amp;lt;vp&amp;gt;programPoint&amp;lt;/vp&amp;gt; corresponding to the place where it is called.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retract|retract/1]] &amp;lt;vp&amp;gt;nondeterm&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Remove a matched fact from the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retractall|retractall/1]]&lt;br /&gt;
|Remove all matching facts from the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retractFactDb|retractFactDb/1]]&lt;br /&gt;
|Remove all facts from the specified named internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeBitsOf|sizeBitsOf/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bits occupied in memory by an entity of the specified domain &amp;#039;&amp;#039;DomainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeOf|sizeOf/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bytes occupied in memory by the specified term.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeOfDomain|sizeOfDomain/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bytes occupied in memory by the entity of the specified domain &amp;#039;&amp;#039;DomainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_lineno|sourcefile_lineno/0-&amp;gt;]]&lt;br /&gt;
|Returns the current line number in the source file processed by the compiler .&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_name|sourcefile_name/0-&amp;gt;]]&lt;br /&gt;
|Returns the name of the source file processed by the compiler.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_timestamp|sourcefile_timestamp/0-&amp;gt;]]&lt;br /&gt;
|Returns the string representing the date and time of the source file processed by the compiler.&lt;br /&gt;
|-&lt;br /&gt;
|[[#succeed|succeed/0]]&lt;br /&gt;
|The predicate &amp;lt;vp&amp;gt;succeed/0&amp;lt;/vp&amp;gt; will always succeed.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toAny|toAny/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; to the value of the universal term type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toBinary|toBinary/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified Term to the binary representation.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toBoolean|toBoolean/1-&amp;gt;]]&lt;br /&gt;
|The purpose of this meta-predicate is to convert the deterministic call (to a predicate or fact) to the procedure that returns the value of &amp;lt;vp&amp;gt;boolean&amp;lt;/vp&amp;gt; domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toEllipsis|toEllipsis/1-&amp;gt;]]&lt;br /&gt;
|Creates the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; from the list of &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; type values.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toString|toString/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; to the string representation.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toTerm|toTerm/1-&amp;gt;]] &amp;lt;br&amp;gt; [[#toTerm|toTerm/2-&amp;gt;]]&lt;br /&gt;
|Converts the string/binary representation of the specified term &amp;#039;&amp;#039;SrcTerm&amp;#039;&amp;#039; into representation corresponding to the domain of &amp;#039;&amp;#039;PrologTerm&amp;#039;&amp;#039; variable of the return value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#tryToTerm|tryToTerm/1-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt; &amp;lt;br&amp;gt; [[#tryToTerm|tryToTerm/2-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Converts the string/binary representation of the specified term &amp;#039;&amp;#039;SrcTerm&amp;#039;&amp;#039; into representation corresponding to the domain of &amp;#039;&amp;#039;PrologTerm&amp;#039;&amp;#039; variable of the return value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#tryConvert|tryConvert/2-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Checks whether the input term &amp;#039;&amp;#039;InputTerm&amp;#039;&amp;#039; can be strictly converted into the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; and returns the converted term &amp;#039;&amp;#039;ReturnTerm&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#typeDescriptorOf|typeDescriptorOf/1-&amp;gt;]]&lt;br /&gt;
|Returns the &amp;lt;vp&amp;gt;typeDescriptor&amp;lt;/vp&amp;gt; of a value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#typeLibraryOf|typeLibraryOf/1-&amp;gt;]]&lt;br /&gt;
|Returns the &amp;lt;vp&amp;gt;typeLibrary&amp;lt;/vp&amp;gt; of a value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]]&lt;br /&gt;
|Unchecked conversion of domains.&lt;br /&gt;
|-&lt;br /&gt;
|[[#upperBound|upperBound/1-&amp;gt;]]&lt;br /&gt;
|Returns the upper bound value of the specified numeric domain.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following predicates are deprecated:&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
| finally/2&lt;br /&gt;
| Use [[Language_Reference/Terms#try-finally| &amp;lt;vp&amp;gt;try-finally&amp;lt;/vp&amp;gt;]] constuction instead.&lt;br /&gt;
|-&lt;br /&gt;
| findall/3&lt;br /&gt;
| Use list comprehension [[Language_Reference/Terms#List_Comprehension| &amp;lt;vp&amp;gt;[ ... || ...  ]&amp;lt;/vp&amp;gt;]] instead&lt;br /&gt;
|-&lt;br /&gt;
| trap/3 &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
| Use [[Language_Reference/Terms#try-catch| &amp;lt;vp&amp;gt;try-catch&amp;lt;/vp&amp;gt;]] constuction instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== and ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#and_.28.2C.29|and (,)]].&lt;br /&gt;
&lt;br /&gt;
==== assert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;assert : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert the specified fact at the end of the matched internal facts database&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;assert(Fact)&amp;lt;/vp&amp;gt; inserts &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; in the matched internal facts database after any other stored facts for the corresponding database predicate. &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; must be a term belonging to the domain of an internal facts database. &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; applied to a single fact changes the existing instance of a fact to the specified one. &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; has the same effect as [[#assertz|assertz/1]]. See also [[#asserta|asserta/1]].&lt;br /&gt;
&lt;br /&gt;
Notice that the combination of [[#retract|retract/1]] and &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; like the following can lead to endless loop:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;loop() :-&lt;br /&gt;
  retract(fct(X)),&lt;br /&gt;
     ...           % creating Y from X&lt;br /&gt;
     assert(fct(Y)),&lt;br /&gt;
  fail.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem is that the retract in first line will eventually retract the fact asserted in the last line, because that fact is inserted &amp;#039;&amp;#039;last&amp;#039;&amp;#039; in the fact chain.&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Attempt to assert a second instance to a fact declared as determ.&lt;br /&gt;
&lt;br /&gt;
==== asserta ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;asserta : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert a fact at the beginning of the matched internal facts database.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;asserta(Fact)&amp;lt;/vp&amp;gt; predicate inserts a &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; in the matched internal facts database before any other stored facts for the corresponding predicate. The &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; must be a term belonging to the domain of an internal facts database. The &amp;lt;vp&amp;gt;asserta/1&amp;lt;/vp&amp;gt; applied to a single fact changes the existing instance of a fact to the specified one. See also [[#assert|assert/1]] and [[#assertz|assertz/1]].&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Attempt to a fact declared as determ, but the fact instance already exists.&lt;br /&gt;
&lt;br /&gt;
==== assertz ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;assertz : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;assertz&amp;lt;/vp&amp;gt; does exactly the same as the [[#assert|assert/1]] predicate.&lt;br /&gt;
&lt;br /&gt;
==== bound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;bound : (&amp;lt;variable&amp;gt; Variable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test whether the specified variable is bound to a value.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;bound(Variable)&amp;lt;/vp&amp;gt; succeeds if &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is bound and fails if it is free. The &amp;lt;vp&amp;gt;bound&amp;lt;/vp&amp;gt; predicate is used to control flow patterns and to check the binding of reference variables. The &amp;lt;vp&amp;gt;bound&amp;lt;/vp&amp;gt; predicate treats the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; as bound if any of it&amp;#039;s part is instantiated.&lt;br /&gt;
&lt;br /&gt;
See also [[#free|free/1]].&lt;br /&gt;
&lt;br /&gt;
==== class_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class_Name : () -&amp;gt; string ClassName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compile time predicate returns the string &amp;lt;vp&amp;gt;ClassName&amp;lt;/vp&amp;gt; that represents the name of the current interface or class.&lt;br /&gt;
&lt;br /&gt;
==== compare ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;compare : (A Left, A Right) -&amp;gt; compareResult CompareResult.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comparison of two terms of the same domain, resturns the value of [[#compareResult|compareResult]] domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;CompareResult&amp;lt;/vp&amp;gt; = compare(&amp;quot;&amp;lt;vp&amp;gt;bar&amp;lt;/vp&amp;gt;&amp;quot;, &amp;quot;&amp;lt;vp&amp;gt;foo&amp;lt;/vp&amp;gt;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== constant_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;constant_name : () -&amp;gt; string ConstantName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compile time predicate returns the string &amp;lt;vp&amp;gt;ConstantName&amp;lt;/vp&amp;gt; that represents the name of the current constant. It is typically used in exception definitions.&lt;br /&gt;
&lt;br /&gt;
==== convert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;convert : (&amp;lt;type&amp;gt; Type, Term) -&amp;gt; &amp;lt;type&amp;gt; Converted.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checked term conversion.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; = convert(returnDomain, &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;returnDomain&amp;lt;/vpbnf&amp;gt;: Specifies a domain to which function &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; converts &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be a name of built-in Visual Prolog domain, an interface domain, a name of such user defined domain that is synonym to one of built-in Visual Prolog domains, a numeric domain, binary and pointer domains. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the value that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; is an expression, then it will be evaluated before the conversion.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned parameter &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; type.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;convert&amp;lt;/vp&amp;gt; predicate performs a clean and genuine conversion of the given &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;, returning a new term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; of the specified new domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;. If &amp;lt;vp&amp;gt;convert&amp;lt;/vp&amp;gt; cannot perform the required conversion, it rises errors. The similar functionality is provided by the [[#tryConvert|tryConvert/2-&amp;gt;]] predicate, but &amp;lt;vp&amp;gt;tryConvert-&amp;gt;&amp;lt;/vp&amp;gt; fails and does not produce any runtime errors if it cannot perform the conversion.&lt;br /&gt;
&lt;br /&gt;
===== Allowed conversions =====&lt;br /&gt;
&lt;br /&gt;
* Between numerical domains.&lt;br /&gt;
* Between interface types.&lt;br /&gt;
* Between [[#string|string]] and [[#symbol|symbol]] domains.&lt;br /&gt;
* From [[#binary|binary]] to [[#pointer|pointer]].&lt;br /&gt;
* For synonyms of mentioned domains.&lt;br /&gt;
* Between [http://wiki.visual-prolog.com/index.php?title=How_To_Remove_Reference_Domains_from_a_Project reference] domains and corresponding non-reference domains.&lt;br /&gt;
&lt;br /&gt;
The contrast to these is [[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]] predicate, which performs an unchecked conversion between terms from any domains, which have the same bit-size.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; (or [[#tryConvert|tryConvert/2-&amp;gt;]]) predicate accomplishes a checked explicit conversion, when the source and target domains are statically known during the compilation. The result of an explicit conversion can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ok&amp;#039;&amp;#039;&amp;#039; the successful conversion to the target domain;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;run-time-check&amp;#039;&amp;#039;&amp;#039; the conversion to the target domain with generation of run-time checking for compatibility;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;error&amp;#039;&amp;#039;&amp;#039; the conversion is impossible, error output.&lt;br /&gt;
&lt;br /&gt;
===== Rules of Checked Explicit Conversions =====&lt;br /&gt;
&lt;br /&gt;
* Synonyms of domains are converted using the same rules that are applied to the domains themselves.&lt;br /&gt;
* Numerical domains can be converted to the numerical domains only.&lt;br /&gt;
* Integral constants are the representatives of the anonymous integral domain: &amp;lt;vp&amp;gt;[const .. const]&amp;lt;/vp&amp;gt;.&lt;br /&gt;
* Real constants are the representatives of the anonymous real domain: &amp;lt;vp&amp;gt;digits&amp;lt;/vp&amp;gt; &amp;lt;vp&amp;gt;dig [const .. const]&amp;lt;/vp&amp;gt;, where &amp;lt;vp&amp;gt;dig&amp;lt;/vp&amp;gt; is the number of the digits in mantissa without insignificant zeroes.&lt;br /&gt;
* A value of the symbol domain can be converted to the string domain and vice versa.&lt;br /&gt;
* A value of binary domain can be converted to the pointer domain.&lt;br /&gt;
* The domains that are implicitly introduced for interfaces can be converted only to the interface domains according to the rules specified below.&lt;br /&gt;
* All other domains cannot be converted.&lt;br /&gt;
&lt;br /&gt;
===== Conversions of Numerical Domains =====&lt;br /&gt;
&lt;br /&gt;
* The range is considered first during such conversion. If the ranges of source and target do not intersect, then an error is produced. If the ranges of source and target only partially intersect, then run-time checking is generated. Also, if one of domains is real and another is an integral one, then the integer range is converted to the real range before the comparison.&lt;br /&gt;
* When input term in real and output is integer, then &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; and [[#tryConvert|tryConvert/2-&amp;gt;]] predicates truncate the input value to the nearest integer value, which is nearer to zero.&lt;br /&gt;
&lt;br /&gt;
===== Conversions of Interface Types =====&lt;br /&gt;
&lt;br /&gt;
Predicate &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; allow to convert any object to any interface type. The actual correctness of such conversion is checked at runtime. When object is created, its type is internally stored, therefore when the object is passed as argument it still remember about its original type. This original type is used for checking allowed conversions. The example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface x&lt;br /&gt;
      supports a, b&lt;br /&gt;
end interface x&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If object is created by class, which implements &amp;lt;vp&amp;gt;x&amp;lt;/vp&amp;gt; interface, and then object is passed as parameter of type &amp;lt;vp&amp;gt;a&amp;lt;/vp&amp;gt; to some predicate, then it is allowed to convert the object to &amp;lt;vp&amp;gt;b&amp;lt;/vp&amp;gt; type.&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Check range error.&lt;br /&gt;
* Unsupported interface type.&lt;br /&gt;
&lt;br /&gt;
==== digitsOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;digitsOf : (&amp;lt;real-domain&amp;gt; Domain) -&amp;gt; unsigned.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns precision of the specified floating-point domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Precision = digitsof(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input parameter &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; of this compiling-time predicate is a floating-point domain, it should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable). The predicate returns the number &amp;lt;vpbnf&amp;gt;&amp;lt;Precision&amp;gt;&amp;lt;/vpbnf&amp;gt; that was determined by the &amp;lt;vp&amp;gt;digits&amp;lt;/vp&amp;gt; attribute in the domain declaration.&lt;br /&gt;
&lt;br /&gt;
The compiler guarantees that values of the domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; will have at least &amp;lt;vpbnf&amp;gt;&amp;lt;Precision&amp;gt;&amp;lt;/vpbnf&amp;gt; number of significant decimal digits.&lt;br /&gt;
&lt;br /&gt;
==== errorExit ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;errorExit : (unsigned ErrorNumber) erroneous.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs a run-time error with the specified return code &amp;lt;vp&amp;gt;ErrorNumber&amp;lt;/vp&amp;gt;, which can be used in the [[#try-catch-finally|try-catch-finally]].&lt;br /&gt;
&lt;br /&gt;
==== fact_address ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;fact_address : (FactType FactVariable) -&amp;gt; memory::pointerTo{FactType} PointerToFactVariable.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;fact_address&amp;lt;/vp&amp;gt; predicate returns the address (as a &amp;lt;vp&amp;gt;memory::pointerTo{FactType}&amp;lt;/vp&amp;gt;) of a fact variable &amp;lt;vp&amp;gt;FactVariable&amp;lt;/vp&amp;gt; of type &amp;lt;vp&amp;gt;FactType&amp;lt;/vp&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;FactVariable&amp;lt;/vp&amp;gt; &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;must&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; be a fact variable.&lt;br /&gt;
&lt;br /&gt;
==== fail ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;fail : () failure.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; predicate forces failure and, hence, always causes backtracking. A clause that fails (with &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; or for some other reason) cannot bind output arguments.&lt;br /&gt;
&lt;br /&gt;
==== free ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;free : (&amp;lt;variableName&amp;gt; Variable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check whether a variable is free.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;free(Variable)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;free&amp;lt;/vp&amp;gt; predicate succeeds if the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is free and fails if &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is bound. The &amp;lt;vp&amp;gt;free&amp;lt;/vp&amp;gt; predicate treats the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; as bound if any of it&amp;#039;s part are instantiated.&lt;br /&gt;
&lt;br /&gt;
See also [[#bound|bound/1]].&lt;br /&gt;
&lt;br /&gt;
==== fromEllipsis ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;fromEllipsis : (...) -&amp;gt; any* AnyTermList.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate creates the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; from the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039; (i.e. from the special varying parameters block).&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;AnyTermList = fromEllipsis(EllipsisBlock )&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#toEllipsis|toEllipsis/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== hasDomain ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;hasDomain&amp;lt;/vp&amp;gt; is not really a predicate, but more a type declaration/restriction.  It has two forms a non-function for declaring/restricting the type of a variable and a function form for declaring/restricting the type of a value.&lt;br /&gt;
&lt;br /&gt;
The non-function form is called with a type as first parmeter and a variable as second parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;hasDomain : (&amp;lt;type&amp;gt; Type, Type Variable).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only effect of the call is that the &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; will be restricted to the type &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The variable can be free, bound or of some mixed flow and the binding of the variable will not change in any way.&lt;br /&gt;
&lt;br /&gt;
The function form is called with a type as first argument and a value as second argument, and it returns the same value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;hasDomain : (&amp;lt;type&amp;gt; Type, Type Value) -&amp;gt; Type Value.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only effect of the call is to ensure that the &amp;lt;vp&amp;gt;Value&amp;lt;/vp&amp;gt; will be restricted to the type &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== lowerBound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;lowerBound : (&amp;lt;numeric-domain&amp;gt; NumericDomain) -&amp;gt; &amp;lt;numeric-domain&amp;gt; LowerBound.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the lower bound of the specified &amp;lt;vp&amp;gt;NumericDomain&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;LowerBoundValue = lowerBound(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;lowerBound&amp;lt;/vp&amp;gt; is a compiling-time predicate. The &amp;lt;vp&amp;gt;lowerBound&amp;lt;/vp&amp;gt; returns the lower bound value &amp;lt;vp&amp;gt;LowerBoundValue&amp;lt;/vp&amp;gt; of the specified numeric domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The return value &amp;lt;vp&amp;gt;LowerBoundValue&amp;lt;/vp&amp;gt; belongs to the same domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter should be the name of any numerical domain; this domain name should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable). See also [[#upperBound|upperBound/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
It will give a compile time error if the specified domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; is not numeric domain.&lt;br /&gt;
&lt;br /&gt;
==== in ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#in|in/2]].&lt;br /&gt;
&lt;br /&gt;
==== isErroneous ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;isErroneous : (&amp;lt;fact-variable&amp;gt; FactVariable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate succeeds if the specified fact variable is &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;isErroneous(factVariableName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate succeeds if the specified fact variable &amp;lt;vp&amp;gt;factVariableName&amp;lt;/vp&amp;gt; has the &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt; value, otherwise it fails.&lt;br /&gt;
&lt;br /&gt;
See also [[#notErroneous|notErroneous]].&lt;br /&gt;
&lt;br /&gt;
==== maxDigits ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;maxDigits : (&amp;lt;real-domain&amp;gt; RealDomain) -&amp;gt; unsigned MaxDigits&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the value of digits (precision) of the basic domain corresponding to the specified floating-point domain &amp;lt;vp&amp;gt;RealDomain&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;MaxDigitsNumber = maxdigits(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The return maximal number of digits &amp;lt;vp&amp;gt;MaxDigitsNumber&amp;lt;/vp&amp;gt; for the &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter, which should be the name of a &amp;lt;vp&amp;gt;real&amp;lt;/vp&amp;gt; domain.&lt;br /&gt;
&lt;br /&gt;
==== not ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#not|not]].&lt;br /&gt;
&lt;br /&gt;
==== notErroneous ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;notErroneous/1-&amp;gt;&amp;lt;/vp&amp;gt; predicate will succeed with the value of a fact if the fact is not erroneous.  The main purpose of the predicate is to get an atomic view of the fact in a multi-threaded application.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;&lt;br /&gt;
facts&lt;br /&gt;
    theFact : integer := erroneous.&lt;br /&gt;
clauses&lt;br /&gt;
    ppp() :-&lt;br /&gt;
        if F = notErroneous(theFact) then&lt;br /&gt;
            % theFact was not erroneous, its value was F&lt;br /&gt;
        end if.&lt;br /&gt;
&amp;lt;/vip&amp;gt;&lt;br /&gt;
The related code using &amp;lt;vp&amp;gt;isErroneous/1&amp;lt;/vp&amp;gt; is not threadsafe:&lt;br /&gt;
&amp;lt;vip&amp;gt;&lt;br /&gt;
clauses&lt;br /&gt;
    ppp() :-&lt;br /&gt;
        if not(isErroneous(theFact)) then&lt;br /&gt;
            % theFact was not erroneous, but it can be in the next line&lt;br /&gt;
            F = theFact              &lt;br /&gt;
        end if.&lt;br /&gt;
&amp;lt;/vip&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
See also [[#isErroneous|isErroneous]].&lt;br /&gt;
&lt;br /&gt;
==== otherwise ====&lt;br /&gt;
&lt;br /&gt;
See {{Lang2|Terms|otherwise|otherwise}}.&lt;br /&gt;
&lt;br /&gt;
==== or ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#or_.28.3B.29|or (;)]].&lt;br /&gt;
&lt;br /&gt;
==== orelse ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#orelse|orelse]].&lt;br /&gt;
&lt;br /&gt;
==== predicate_fullname ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicate_fullname : () -&amp;gt; string PredicateFullName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;PredicateFullName&amp;lt;/vp&amp;gt; of the predicate in which it is invoked. The returned predicate name is qualified with a scope name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;predicate_fullname&amp;lt;/vp&amp;gt; can only be used inside a clause. Use of &amp;lt;vp&amp;gt;predicate_fullname&amp;lt;/vp&amp;gt; in other places causes a compile time error. See also [[#predicate_name|predicate_name]].&lt;br /&gt;
&lt;br /&gt;
==== predicate_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicate_name : () -&amp;gt; string PredicateName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;PredicateName&amp;lt;/vp&amp;gt; of the predicate in which it is invoked.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; can only be used inside a clause. Use of &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; in other places causes a compile time error. See also [[#predicate_fullname|predicate_fullname]]&lt;br /&gt;
&lt;br /&gt;
==== programPoint ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;programPoint : () -&amp;gt; core::programPoint ProgramPoint.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;programPoint&amp;lt;/vp&amp;gt; corresponding to the place where it is invoked.&lt;br /&gt;
&lt;br /&gt;
==== retract ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract : (&amp;lt;fact-term&amp;gt; FactTerm) nondeterm anyflow.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Successively removes the first matching fact from the facts database.  Fails when no more facts match.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract(FactTemplate)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; should be a fact term. The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate deletes the first fact that matches the &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; in the appropriated facts database. During backtracking, the rest of the matching facts will be deleted.&lt;br /&gt;
&lt;br /&gt;
Notice that &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can have any level of instantiation. The &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; is matched with the facts in the facts database, which means that any free variables will be bound in the call to &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can contain any anonymous variables. That is, variables with names consisting from the single underscore &amp;lt;vp&amp;gt;_&amp;lt;/vp&amp;gt; or a variable with a name starting with an underscore &amp;lt;vp&amp;gt;_AnyValue&amp;lt;/vp&amp;gt; if the variable occurs only once in the clause. For example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract(person(&amp;quot;Hans&amp;quot;, _Age)),&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will retract the first matched person fact that has &amp;quot;&amp;lt;vp&amp;gt;Hans&amp;lt;/vp&amp;gt;&amp;quot; as the first argument and anything as the second argument.&lt;br /&gt;
&lt;br /&gt;
When retracting a fact, which is declared to be determ, the call to &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; will be deterministic.&lt;br /&gt;
&lt;br /&gt;
See also [[#retractall|retractall/1]] and [[#retractFactDb|retractFactDb]].&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate cannot be applied to single facts or fact variables.&lt;br /&gt;
&lt;br /&gt;
Be careful calling &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; with free &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; variable if any single fact is declared in the project current scope. If you retract a single fact, then the run-time error is generated. The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate fails when there are no more matches.&lt;br /&gt;
&lt;br /&gt;
==== retractall ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractall : (&amp;lt;fact-term&amp;gt; FactTerm) .&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove all matching facts from the facts database.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractall(FactTemplate)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; should be a fact term.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt; retracts all facts which match the given &amp;#039;&amp;#039;FactTemplate&amp;#039;&amp;#039;. It always succeeds, even if no facts were retracted.&lt;br /&gt;
&lt;br /&gt;
Attempting to retract a &amp;lt;vp&amp;gt;single&amp;lt;/vp&amp;gt; fact will cause a compile time error.&lt;br /&gt;
&lt;br /&gt;
It is not possible to obtain any output values from &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt;. For this reason, the variables in the call must be bound or be a single underscores (anonymous). Notice that  &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can have any level of instantiation, but free variables must be single underscores (&amp;quot;unconditionally anonymous&amp;quot;). In difference to [[#retract|retract/1]] &amp;quot;conditionally&amp;quot; anonymous variables with names starting from the underscore (like &amp;lt;vp&amp;gt;_AnyValue&amp;lt;/vp&amp;gt;) cannot be used in &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
See also [[#retract|retract/1]] and [[#retractFactDb|retractFactDb/1]].&lt;br /&gt;
&lt;br /&gt;
==== retractFactDb ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractFactDb : (factDB FactDB).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove all facts from the named internal facts database &amp;lt;vp&amp;gt;FactDB&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractFactDb(FactDB)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retractFactDb/1&amp;lt;/vp&amp;gt; removes all facts from the named facts database &amp;lt;vp&amp;gt;FactDB&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Notice, it is impossible to retract &amp;lt;vp&amp;gt;single&amp;lt;/vp&amp;gt; facts and fact variables, so the predicate leaves such ones as they are.&lt;br /&gt;
&lt;br /&gt;
See also [[#retractall|retractall/1]] and [[#retract|retract/1]].&lt;br /&gt;
&lt;br /&gt;
==== retractAll/2 ====&lt;br /&gt;
&lt;br /&gt;
Obsolete predicate! Use [[#retractFactDb|retractFactDb/1]] instead.&lt;br /&gt;
&lt;br /&gt;
==== sizeBitsOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeBitsOf : (&amp;lt;domain&amp;gt; DomainName) -&amp;gt; unsigned BitSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bits occupied in memory by an entity of the specified domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;BitSize = sizeBitsOf(DomainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compiling-time predicate receives the domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt; as input parameter and return the size of memory that is occupied by the entity of the given domain. The result is measured in bits. For the integer domains &amp;lt;vp&amp;gt;sizeBitsOf/1-&amp;gt;&amp;lt;/vp&amp;gt; predicate returns the value that was defined for the size-field in a domain&amp;#039;s declaration.&lt;br /&gt;
&lt;br /&gt;
The following is always true for the integral domains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOfDomain(domain)*8 - 7 &amp;lt;= sizeBitsOf(domain) &amp;lt;= sizeOfDomain(domain)*8&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#sizeOfDomain|sizeOfDomain]]/1-&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== sizeOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOf : (Type Term) -&amp;gt; integer ByteSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bytes occupied in memory by the specified term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ByteSize = sizeOf(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;sizeOf/1-&amp;gt;&amp;lt;/vp&amp;gt; function receives a term as input parameter and returns value &amp;lt;vp&amp;gt;ByteSize&amp;lt;/vp&amp;gt; that specifies the number of bytes occupied in memory by this term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== sizeOfDomain ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOfDomain : (&amp;lt;domain&amp;gt; Domain) -&amp;gt; integer ByteSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bytes occupied in memory by the entity of the specified domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ByteSize = sizeOfDomain(DomainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compiling-time predicate receives the domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt; as input parameter and return the size of memory that is occupied by the entity of the given domain. The result is measured in bytes. The returned value &amp;lt;vp&amp;gt;ByteSize&amp;lt;/vp&amp;gt; belongs to the integer domain. Compare with [[#sizeBitsOf|sizeBitsOf/1-&amp;gt;]], which returns size of a domain measured in bits.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_lineno ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_lineno : () -&amp;gt; unsigned LineNumber.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current line number in the source file processed by the compiler.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_name : () -&amp;gt; string FileName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the name of the source file processed by the compiler.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_timestamp ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_timestamp : () -&amp;gt; string TimeStamp..&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a string that represents the date and time of the currently compiled source file in format &amp;lt;b&amp;gt;YYYY-MM-DD HH:mm:ss&amp;lt;/b&amp;gt;. Where:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;YYYY&amp;lt;/b&amp;gt; - Year.&lt;br /&gt;
* &amp;lt;b&amp;gt;MM&amp;lt;/b&amp;gt; - Month.&lt;br /&gt;
* &amp;lt;b&amp;gt;DD&amp;lt;/b&amp;gt; - Day.&lt;br /&gt;
* &amp;lt;b&amp;gt;HH&amp;lt;/b&amp;gt; - Hour.&lt;br /&gt;
* &amp;lt;b&amp;gt;mm&amp;lt;/b&amp;gt; - Minute.&lt;br /&gt;
* &amp;lt;b&amp;gt;ss&amp;lt;/b&amp;gt; - Second.&lt;br /&gt;
&lt;br /&gt;
==== succeed ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;succeed : ().&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate &amp;lt;vp&amp;gt;succeed/0&amp;lt;/vp&amp;gt; will always succeed.&lt;br /&gt;
&lt;br /&gt;
==== toAny ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toAny : (Term) -&amp;gt; any UniversalTypeValue.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to the value of universal term type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;UniversalTypeValue = toAny(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A term of the &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; domain can be converted back to its original type using the &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicates (see {{lang2|Built-in entities/Predicates|toTerm|toTerm}}).&lt;br /&gt;
&lt;br /&gt;
==== toBinary ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toBinary : (Term) -&amp;gt; binary Serialized.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to [[#binary|binary]] representation.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Serialized = toBinary(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a binary, it can safely be stored in a file or sent over a network to another program. Later the obtained binary value &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; can be converted back to a Visual Prolog term, using [[#toTerm|toTerm/1-&amp;gt;]] function (the domain for the reversed term should be adequate to &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) for the reverse conversion.&lt;br /&gt;
&lt;br /&gt;
==== toBoolean ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toBoolean : (&amp;lt;deterministic_expression&amp;gt; SubGoal) -&amp;gt; boolean Succeed.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of this meta-predicate is to convert an expression to the value of boolean domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this meta-predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;True_or_False = toBoolean(deterministic_expression)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this is equivalent to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;True_or_False = if deterministic_expression then true else false end if&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;toBoolean/1-&amp;gt;&amp;lt;/vp&amp;gt; meta-predicate returns [[#boolean|boolean]] value. The result is &amp;lt;vp&amp;gt;true&amp;lt;/vp&amp;gt; if &amp;#039;&amp;#039;deterministic_call&amp;#039;&amp;#039; succeeds. The result is &amp;lt;vp&amp;gt;false&amp;lt;/vp&amp;gt; if &amp;#039;&amp;#039;deterministic_call&amp;#039;&amp;#039; fails.&lt;br /&gt;
&lt;br /&gt;
==== toEllipsis ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toEllipsis : (any* AnyTermList) -&amp;gt; ....&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate creates &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039; (i.e. the special varying parameters block) from the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;. Such &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; can be later passed to a predicate which expects the varying number of arguments (i.e. is declared with the ellipsis (&amp;#039;&amp;#039;...&amp;#039;&amp;#039;)), like &amp;lt;vp&amp;gt;write/...&amp;lt;/vp&amp;gt;, at the position of the ellipsis (&amp;#039;&amp;#039;...&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;EllipsisBlock = toEllipsis(&amp;lt;any_term_list&amp;gt;), write(EllipsisBlock)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#fromEllipsis|fromEllipsis/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== toString ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toString : (Term) -&amp;gt; string Serialized.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to string representation.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Serialized = toString(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a string, it can safely be stored in a file or sent over a network to another program. Later the obtained string value can be converted back to a Visual Prolog term, using [[#toTerm|toTerm/1-&amp;gt;]] function (the domain of the return value should be adequate to &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) for the reverse conversion.&lt;br /&gt;
&lt;br /&gt;
==== toTerm ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toTerm : (string Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (binary Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (any Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, string Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, binary Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, any Serialized) -&amp;gt; Term.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the string/binary/any representation of the specified term &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; into representation corresponding to the domain of &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; variable of the return value. The domain can be stated explicitly or it can be left to the compiler to determine a suitable domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Term = toTerm(Serialized) % with implicit domain&lt;br /&gt;
Term = toTerm(domainName, Serialized) % with explicit domain, domainName&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the domain is not specified the compiler must be able to determine the domain for the returned value &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; at compile-time. Notice that binary version of &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicate performs almost byte to byte conversion and only checking general compatibility of &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; data with the domain required to the return value &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;. The programmer is wholly responsible for providing binary data of &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; that can be correctly converted to the term of the desired domain. The &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicates are counterparts to predicates [[#toBinary|toBinary/1-&amp;gt;]] and [[#toString|toString/1-&amp;gt;]]. When a &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a binary or string representation &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; (by [[#toBinary|toBinary/1-&amp;gt;]] or [[#toString|toString/1-&amp;gt;]] or [[#toAny|toAny/1-&amp;gt;]] correspondingly), it can safely be stored in a file or sent over a network to another program. Later the corresponding &amp;lt;vp&amp;gt;toTerm/1&amp;lt;/vp&amp;gt;-&amp;gt; function can convert the obtained string/binary value &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; back to a Visual Prolog term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;. For correctness of the reverse conversion the domain of the clause variable &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; should be adequate to the initial domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
See also [[#tryToTerm|tryToTerm]].&lt;br /&gt;
&lt;br /&gt;
It gives a compile time error if the compiler cannot determine the return domain.&lt;br /&gt;
&lt;br /&gt;
Exceptions&lt;br /&gt;
&lt;br /&gt;
* Run time errors are generated when the &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicate cannot convert the string or binary into a term of the specified domain.&lt;br /&gt;
&lt;br /&gt;
==== tryToTerm ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;tryToTerm : (string Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (binary Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (any Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, string Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, binary Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, any Serialized) -&amp;gt; Term.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Converts the string/binary/any representation &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; into a term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;  like [[#toTerm|toTerm]]. The only difference between the predicates is that &amp;lt;vp&amp;gt;tryToTerm&amp;lt;/vp&amp;gt; fails if it cannot convert the string or binary or any into a term of the specified domain whereas toTerm raises an exception.&lt;br /&gt;
&lt;br /&gt;
See also [[#toTerm|toTerm]].&lt;br /&gt;
&lt;br /&gt;
==== tryConvert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;tryConvert : (&amp;lt;type&amp;gt; Type, Value) -&amp;gt; &amp;lt;type&amp;gt; Converted determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the input term &amp;lt;vp&amp;gt;Value&amp;lt;/vp&amp;gt; can be strictly converted into the specified domain &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt; and returns the converted term &amp;lt;vp&amp;gt;Converted&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ReturnTerm = tryConvert(returnDomain, InputTerm)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vp&amp;gt;returnDomain&amp;lt;/vp&amp;gt;: Specifies a domain to which &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate tries to convert the specified &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; can be any domain accessible in the current scope. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the term that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; is an expression, then it will be evaluated before conversion.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; domain.&lt;br /&gt;
&lt;br /&gt;
The conversion rules are the same as of the embedded predicate [[#convert|convert/2-&amp;gt;]], but &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; fails when [[#convert|convert/2-&amp;gt;]] generates conversion errors.&lt;br /&gt;
&lt;br /&gt;
This predicate succeeds if the corresponding conversion succeeds. Otherwise it fails. The &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate tries to perform a clean and genuine conversion of the given &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; into a value of the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;. The &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate will fail if the required conversion cannot be performed. When &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate succeeds, it returns the term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; converted to the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
For allowed conversions and rules of checked explicit conversions see [[#convert|convert/2-&amp;gt;]] predicate.&lt;br /&gt;
&lt;br /&gt;
See also [[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== typeDescriptorOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;typeDescriptorOf : (&amp;lt;type&amp;gt; Type) -&amp;gt; typeDescriptor TypeDescriptor.&lt;br /&gt;
typeDescriptorOf : (Type Value) -&amp;gt; typeDescriptor TypeDescriptor.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reflection predicate that returns the &amp;lt;vp&amp;gt;typeDescriptor&amp;lt;/vp&amp;gt; of a type or a value.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;vp&amp;gt;typeDescriptor&amp;lt;/vp&amp;gt; is the reflection descriptor of an uninstantiated type/domain.&lt;br /&gt;
&lt;br /&gt;
==== typeLibraryOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;typeLibraryOf : (&amp;lt;type&amp;gt; Type) -&amp;gt; typeLibrary TypeLibrary.&lt;br /&gt;
typeLibraryOf : (Type Value) -&amp;gt; typeLibrary TypeLibrary.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reflection predicate that returns the &amp;lt;vp&amp;gt;typeLibrary&amp;lt;/vp&amp;gt; of a type or a value.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;vp&amp;gt;typeLibrary&amp;lt;/vp&amp;gt; is the reflection descriptor of an instantiated type/domain.&lt;br /&gt;
&lt;br /&gt;
==== uncheckedConvert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;uncheckedConvert : (&amp;lt;type&amp;gt; Type, Value) -&amp;gt; &amp;lt;type&amp;gt; Converted.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unchecked conversion of a value to another type.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ReturnTerm = uncheckedConvert(returnDomain, InputTerm)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vp&amp;gt;returnDomain&amp;lt;/vp&amp;gt;: Specifies a domain to which &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; predicate unsafely converts the specified &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; can be any domain accessible in the current scope, the &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; should has the same bit-size as the &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the value that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;#039;&amp;#039;InputTerm&amp;#039;&amp;#039; is an expression, then it will be evaluated before conversion.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned parameter &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; type.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; evaluates &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;, change the type to &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; without any modification of the memory pattern and unifies with &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt;. The &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; predicate performs no runtime checks. It makes only compile time checking of bit-size equality of the converted domains. So almost any term may be quite recklessly converted to any other term. So quite disastrous results may occur if you try to use variables incorrectly converted by &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;. Be extremely careful implementing &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;; we strongly recommend you always, when it is possible, using of [[#convert|convert/2-&amp;gt;]] and [[#tryConvert|tryConvert/2-&amp;gt;]]. But notice that, when an object is returned by COM system it is necessary to convert it by &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;, as Prolog program does not have information about its actual type.&lt;br /&gt;
&lt;br /&gt;
==== upperBound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;upperBound : (&amp;lt;numeric-domain&amp;gt; NumericDomain) -&amp;gt; &amp;lt;numeric-domain&amp;gt; UpperBound.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the upper bound value of the specified numeric domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;UpperBound = upperBound(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;upperBound&amp;lt;/vp&amp;gt; is a compiling-time predicate. The &amp;lt;vp&amp;gt;upperBound&amp;lt;/vp&amp;gt; returns the upper bound value of the specified numeric domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The return value &amp;lt;vp&amp;gt;UpperBound&amp;lt;/vp&amp;gt; belongs to the same domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter should be the name of any numerical domain; this domain name should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable).&lt;br /&gt;
&lt;br /&gt;
See also [[#lowerBound|lowerBound/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
Will cause a compile time error if the specified domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; is not numeric domain.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{LanguageReferenceSubarticle|Built-in entities/Predicates}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Predicates&amp;diff=4814</id>
		<title>Language Reference/Built-in entities/Predicates</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Predicates&amp;diff=4814"/>
		<updated>2021-06-07T16:41:46Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: misspelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;__NOTOC__&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#and_.28.2C.29|and/2]] &amp;lt;br&amp;gt; [[Language_Reference/Terms#and_.28.2C.29|,/2]]&lt;br /&gt;
|Term &amp;quot;and&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[#assert|assert/1]]&lt;br /&gt;
|Insert the specified fact at the end of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#asserta|asserta/1]]&lt;br /&gt;
|Insert a fact at the beginning of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#assertz|assertz/1]]&lt;br /&gt;
|Insert a fact at the end of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#bound|bound/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Test whether the specified variable is bound to a value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#class_name|class_name/0-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;ClassName&amp;#039;&amp;#039; that represents the name of the current interface or class.&lt;br /&gt;
|-&lt;br /&gt;
|[[#compare|compare/2-&amp;gt;]]&lt;br /&gt;
|Returns the result of the variables&amp;#039; comparison.&lt;br /&gt;
|-&lt;br /&gt;
|[[#constant_name|constant_name/0-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;ConstantName&amp;#039;&amp;#039; that represents the name of the current constant.  Typically used in execepion definitions.&lt;br /&gt;
|-&lt;br /&gt;
|[[#convert|convert/2-&amp;gt;]]&lt;br /&gt;
|Checked term conversion.&lt;br /&gt;
|-&lt;br /&gt;
|[[#digitsOf|digitsOf/1-&amp;gt;]]&lt;br /&gt;
|Returns precision of the specified floating-point domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#errorExit|errorExit/1]] &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Performs a run-time error with the specified return code &amp;#039;&amp;#039;ErrorNumber&amp;#039;&amp;#039; and sets the internal error information.&lt;br /&gt;
|-&lt;br /&gt;
|[[#fact_address|fact_address/1-&amp;gt;]]&lt;br /&gt;
|Returns the address of a fact variable.&lt;br /&gt;
|-&lt;br /&gt;
|[[#fail|fail/0]] &amp;lt;vp&amp;gt;failure&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Invoke backtracking.&lt;br /&gt;
|-&lt;br /&gt;
|[[#free|free/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Check whether a variable is free.&lt;br /&gt;
|-&lt;br /&gt;
|[[#fromEllipsis|fromEllipsis/1-&amp;gt;]]&lt;br /&gt;
|Creates the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; from the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#hasDomain|hasDomain/2]] &amp;lt;br&amp;gt; [[#hasDomain|hasDomain/2-&amp;gt;]]&lt;br /&gt;
|Declares/restricts the type of a variable or value.&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#in|in/2]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt; &amp;lt;br&amp;gt; [[Language_Reference/Terms#in|in/2]] &amp;lt;vp&amp;gt;nondeterm&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Infix operator &amp;quot;in&amp;quot; (in-test and in-iterator).&lt;br /&gt;
|-&lt;br /&gt;
|[[#isErroneous|isErroneous/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Returns the lower bound value of the specified numeric domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#lowerBound|lowerBound/1-&amp;gt;]]&lt;br /&gt;
|Returns the lower bound value of the specified numeric domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#maxDigits|maxDigits/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the value of digits (precision) of the basic domain corresponding to the specified floating-point domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#not|not/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Negate the result (success/fail) of subgoal.&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#otherwise|otherwise/2]]&lt;br /&gt;
|Infix expression operator providing a value when a determ expression fails&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#or_.28.3B.29|or/2]] &amp;lt;br&amp;gt; [[Language_Reference/Terms#and_.28.3B.29|;/2]]&lt;br /&gt;
|Nondeterministic term &amp;quot;or&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#orelse|orelse]]&lt;br /&gt;
|Deterministic term &amp;quot;or&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[#predicate_fullname|predicate_fullname/1-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;PredicateFullName&amp;#039;&amp;#039; that represent the name of the predicate in which clause body &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; is called. The returned predicate name is qualified with a scope name.&lt;br /&gt;
|-&lt;br /&gt;
|[[#predicate_name|predicate_name/1-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;PredicateName&amp;#039;&amp;#039; that represent the name of the predicate in which clause body &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; is called. The returned predicate name is not qualified with a scope name.&lt;br /&gt;
|-&lt;br /&gt;
|[[#programPoint|programPoint/0-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the &amp;lt;vp&amp;gt;programPoint&amp;lt;/vp&amp;gt; corresponding to the place where it is called.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retract|retract/1]] &amp;lt;vp&amp;gt;nondeterm&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Remove a matched fact from the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retractall|retractall/1]]&lt;br /&gt;
|Remove all matching facts from the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retractFactDb|retractFactDb/1]]&lt;br /&gt;
|Remove all facts from the specified named internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeBitsOf|sizeBitsOf/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bits occupied in memory by an entity of the specified domain &amp;#039;&amp;#039;DomainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeOf|sizeOf/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bytes occupied in memory by the specified term.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeOfDomain|sizeOfDomain/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bytes occupied in memory by the entity of the specified domain &amp;#039;&amp;#039;DomainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_lineno|sourcefile_lineno/0-&amp;gt;]]&lt;br /&gt;
|Returns the current line number in the source file processed by the compiler .&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_name|sourcefile_name/0-&amp;gt;]]&lt;br /&gt;
|Returns the name of the source file processed by the compiler.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_timestamp|sourcefile_timestamp/0-&amp;gt;]]&lt;br /&gt;
|Returns the string representing the date and time of the source file processed by the compiler.&lt;br /&gt;
|-&lt;br /&gt;
|[[#succeed|succeed/0]]&lt;br /&gt;
|The predicate &amp;lt;vp&amp;gt;succeed/0&amp;lt;/vp&amp;gt; will always succeed.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toAny|toAny/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; to the value of the universal term type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toBinary|toBinary/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified Term to the binary representation.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toBoolean|toBoolean/1-&amp;gt;]]&lt;br /&gt;
|The purpose of this meta-predicate is to convert the deterministic call (to a predicate or fact) to the procedure that returns the value of &amp;lt;vp&amp;gt;boolean&amp;lt;/vp&amp;gt; domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toEllipsis|toEllipsis/1-&amp;gt;]]&lt;br /&gt;
|Creates the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; from the list of &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; type values.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toString|toString/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; to the string representation.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toTerm|toTerm/1-&amp;gt;]] &amp;lt;br&amp;gt; [[#toTerm|toTerm/2-&amp;gt;]]&lt;br /&gt;
|Converts the string/binary representation of the specified term &amp;#039;&amp;#039;SrcTerm&amp;#039;&amp;#039; into representation corresponding to the domain of &amp;#039;&amp;#039;PrologTerm&amp;#039;&amp;#039; variable of the return value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#tryToTerm|tryToTerm/1-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt; &amp;lt;br&amp;gt; [[#tryToTerm|tryToTerm/2-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Converts the string/binary representation of the specified term &amp;#039;&amp;#039;SrcTerm&amp;#039;&amp;#039; into representation corresponding to the domain of &amp;#039;&amp;#039;PrologTerm&amp;#039;&amp;#039; variable of the return value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#tryConvert|tryConvert/2-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Checks whether the input term &amp;#039;&amp;#039;InputTerm&amp;#039;&amp;#039; can be strictly converted into the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; and returns the converted term &amp;#039;&amp;#039;ReturnTerm&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#typeDescriptorOf|typeDescriptorOf/1-&amp;gt;]]&lt;br /&gt;
|Returns the &amp;lt;vp&amp;gt;typeDescriptor&amp;lt;/vp&amp;gt; of a value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#typeLibraryOf|typeLibraryOf/1-&amp;gt;]]&lt;br /&gt;
|Returns the &amp;lt;vp&amp;gt;typeLibrary&amp;lt;/vp&amp;gt; of a value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]]&lt;br /&gt;
|Unchecked conversion of domains.&lt;br /&gt;
|-&lt;br /&gt;
|[[#upperBound|upperBound/1-&amp;gt;]]&lt;br /&gt;
|Returns the upper bound value of the specified numeric domain.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following predicates are deprecated:&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
| finally/2&lt;br /&gt;
| Use [[Language_Reference/Terms#try-finally| &amp;lt;vp&amp;gt;try-finally&amp;lt;/vp&amp;gt;]] constuction instead.&lt;br /&gt;
|-&lt;br /&gt;
| findall/3&lt;br /&gt;
| Use list comprehension [[Language_Reference/Terms#List_Comprehension| &amp;lt;vp&amp;gt;[ ... || ...  ]&amp;lt;/vp&amp;gt;]] instead&lt;br /&gt;
|-&lt;br /&gt;
| trap/3 &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
| Use [[Language_Reference/Terms#try-catch| &amp;lt;vp&amp;gt;try-catch&amp;lt;/vp&amp;gt;]] constuction instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== and ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#and_.28.2C.29|and (,)]].&lt;br /&gt;
&lt;br /&gt;
==== assert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;assert : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert the specified fact at the end of the matched internal facts database&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;assert(Fact)&amp;lt;/vp&amp;gt; inserts &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; in the matched internal facts database after any other stored facts for the corresponding database predicate. &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; must be a term belonging to the domain of an internal facts database. &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; applied to a single fact changes the existing instance of a fact to the specified one. &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; has the same effect as [[#assertz|assertz/1]]. See also [[#asserta|asserta/1]].&lt;br /&gt;
&lt;br /&gt;
Notice that the combination of [[#retract|retract/1]] and &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; like the following can lead to endless loop:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;loop() :-&lt;br /&gt;
  retract(fct(X)),&lt;br /&gt;
     ...           % creating Y from X&lt;br /&gt;
     assert(fct(Y)),&lt;br /&gt;
  fail.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem is that the retract in first line will eventually retract the fact asserted in the last line, because that fact is inserted &amp;#039;&amp;#039;last&amp;#039;&amp;#039; in the fact chain.&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Attempt to assert a second instance to a fact declared as determ.&lt;br /&gt;
&lt;br /&gt;
==== asserta ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;asserta : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert a fact at the beginning of the matched internal facts database.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;asserta(Fact)&amp;lt;/vp&amp;gt; predicate inserts a &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; in the matched internal facts database before any other stored facts for the corresponding predicate. The &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; must be a term belonging to the domain of an internal facts database. The &amp;lt;vp&amp;gt;asserta/1&amp;lt;/vp&amp;gt; applied to a single fact changes the existing instance of a fact to the specified one. See also [[#assert|assert/1]] and [[#assertz|assertz/1]].&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Attempt to a fact declared as determ, but the fact instance already exists.&lt;br /&gt;
&lt;br /&gt;
==== assertz ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;assertz : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;assertz&amp;lt;/vp&amp;gt; does exactly the same as the [[#assert|assert/1]] predicate.&lt;br /&gt;
&lt;br /&gt;
==== bound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;bound : (&amp;lt;variable&amp;gt; Variable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test whether the specified variable is bound to a value.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;bound(Variable)&amp;lt;/vp&amp;gt; succeeds if &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is bound and fails if it is free. The &amp;lt;vp&amp;gt;bound&amp;lt;/vp&amp;gt; predicate is used to control flow patterns and to check the binding of reference variables. The &amp;lt;vp&amp;gt;bound&amp;lt;/vp&amp;gt; predicate treats the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; as bound if any of it&amp;#039;s part is instantiated.&lt;br /&gt;
&lt;br /&gt;
See also [[#free|free/1]].&lt;br /&gt;
&lt;br /&gt;
==== class_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class_Name : () -&amp;gt; string ClassName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compile time predicate returns the string &amp;lt;vp&amp;gt;ClassName&amp;lt;/vp&amp;gt; that represents the name of the current interface or class.&lt;br /&gt;
&lt;br /&gt;
==== compare ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;compare : (A Left, A Right) -&amp;gt; compareResult CompareResult.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comparison of two terms of the same domain, resturns the value of [[#compareResult|compareResult]] domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;CompareResult&amp;lt;/vp&amp;gt; = compare(&amp;quot;&amp;lt;vp&amp;gt;bar&amp;lt;/vp&amp;gt;&amp;quot;, &amp;quot;&amp;lt;vp&amp;gt;foo&amp;lt;/vp&amp;gt;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== constant_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;constant_name : () -&amp;gt; string ConstantName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compile time predicate returns the string &amp;lt;vp&amp;gt;ConstantName&amp;lt;/vp&amp;gt; that represents the name of the current constant. It is typically used in exception definitions.&lt;br /&gt;
&lt;br /&gt;
==== convert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;convert : (&amp;lt;type&amp;gt; Type, Term) -&amp;gt; &amp;lt;type&amp;gt; Converted.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checked term conversion.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; = convert(returnDomain, &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;returnDomain&amp;lt;/vpbnf&amp;gt;: Specifies a domain to which function &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; converts &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be a name of built-in Visual Prolog domain, an interface domain, a name of such user defined domain that is synonym to one of built-in Visual Prolog domains, a numeric domain, binary and pointer domains. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the value that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; is an expression, then it will be evaluated before the conversion.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned parameter &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; type.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;convert&amp;lt;/vp&amp;gt; predicate performs a clean and genuine conversion of the given &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;, returning a new term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; of the specified new domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;. If &amp;lt;vp&amp;gt;convert&amp;lt;/vp&amp;gt; cannot perform the required conversion, it rises errors. The similar functionality is provided by the [[#tryConvert|tryConvert/2-&amp;gt;]] predicate, but &amp;lt;vp&amp;gt;tryConvert-&amp;gt;&amp;lt;/vp&amp;gt; fails and does not produce any runtime errors if it cannot perform the conversion.&lt;br /&gt;
&lt;br /&gt;
===== Allowed conversions =====&lt;br /&gt;
&lt;br /&gt;
* Between numerical domains.&lt;br /&gt;
* Between interface types.&lt;br /&gt;
* Between [[#string|string]] and [[#symbol|symbol]] domains.&lt;br /&gt;
* From [[#binary|binary]] to [[#pointer|pointer]].&lt;br /&gt;
* For synonyms of mentioned domains.&lt;br /&gt;
* Between [http://wiki.visual-prolog.com/index.php?title=How_To_Remove_Reference_Domains_from_a_Project reference] domains and corresponding non-reference domains.&lt;br /&gt;
&lt;br /&gt;
The contrast to these is [[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]] predicate, which performs an unchecked conversion between terms from any domains, which have the same bit-size.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; (or [[#tryConvert|tryConvert/2-&amp;gt;]]) predicate accomplishes a checked explicit conversion, when the source and target domains are statically known during the compilation. The result of an explicit conversion can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ok&amp;#039;&amp;#039;&amp;#039; the successful conversion to the target domain;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;run-time-check&amp;#039;&amp;#039;&amp;#039; the conversion to the target domain with generation of run-time checking for compatibility;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;error&amp;#039;&amp;#039;&amp;#039; the conversion is impossible, error output.&lt;br /&gt;
&lt;br /&gt;
===== Rules of Checked Explicit Conversions =====&lt;br /&gt;
&lt;br /&gt;
* Synonyms of domains are converted using the same rules that are applied to the domains themselves.&lt;br /&gt;
* Numerical domains can be converted to the numerical domains only.&lt;br /&gt;
* Integral constants are the representatives of the anonymous integral domain: &amp;lt;vp&amp;gt;[const .. const]&amp;lt;/vp&amp;gt;.&lt;br /&gt;
* Real constants are the representatives of the anonymous real domain: &amp;lt;vp&amp;gt;digits&amp;lt;/vp&amp;gt; &amp;lt;vp&amp;gt;dig [const .. const]&amp;lt;/vp&amp;gt;, where &amp;lt;vp&amp;gt;dig&amp;lt;/vp&amp;gt; is the number of the digits in mantissa without insignificant zeroes.&lt;br /&gt;
* A value of the symbol domain can be converted to the string domain and vice versa.&lt;br /&gt;
* A value of binary domain can be converted to the pointer domain.&lt;br /&gt;
* The domains that are implicitly introduced for interfaces can be converted only to the interface domains according to the rules specified below.&lt;br /&gt;
* All other domains cannot be converted.&lt;br /&gt;
&lt;br /&gt;
===== Conversions of Numerical Domains =====&lt;br /&gt;
&lt;br /&gt;
* The range is considered first during such conversion. If the ranges of source and target do not intersect, then an error is produced. If the ranges of source and target only partially intersect, then run-time checking is generated. Also, if one of domains is real and another is an integral one, then the integer range is converted to the real range before the comparison.&lt;br /&gt;
* When input term in real and output is integer, then &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; and [[#tryConvert|tryConvert/2-&amp;gt;]] predicates truncate the input value to the nearest integer value, which is nearer to zero.&lt;br /&gt;
&lt;br /&gt;
===== Conversions of Interface Types =====&lt;br /&gt;
&lt;br /&gt;
Predicate &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; allow to convert any object to any interface type. The actual correctness of such conversion is checked at runtime. When object is created, its type is internally stored, therefore when the object is passed as argument it still remember about its original type. This original type is used for checking allowed conversions. The example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface x&lt;br /&gt;
      supports a, b&lt;br /&gt;
end interface x&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If object is created by class, which implements &amp;lt;vp&amp;gt;x&amp;lt;/vp&amp;gt; interface, and then object is passed as parameter of type &amp;lt;vp&amp;gt;a&amp;lt;/vp&amp;gt; to some predicate, then it is allowed to convert the object to &amp;lt;vp&amp;gt;b&amp;lt;/vp&amp;gt; type.&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Check range error.&lt;br /&gt;
* Unsupported interface type.&lt;br /&gt;
&lt;br /&gt;
==== digitsOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;digitsOf : (&amp;lt;real-domain&amp;gt; Domain) -&amp;gt; unsigned.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns precision of the specified floating-point domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Precision = digitsof(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input parameter &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; of this compiling-time predicate is a floating-point domain, it should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable). The predicate returns the number &amp;lt;vpbnf&amp;gt;&amp;lt;Precision&amp;gt;&amp;lt;/vpbnf&amp;gt; that was determined by the &amp;lt;vp&amp;gt;digits&amp;lt;/vp&amp;gt; attribute in the domain declaration.&lt;br /&gt;
&lt;br /&gt;
The compiler guarantees that values of the domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; will have at least &amp;lt;vpbnf&amp;gt;&amp;lt;Precision&amp;gt;&amp;lt;/vpbnf&amp;gt; number of significant decimal digits.&lt;br /&gt;
&lt;br /&gt;
==== errorExit ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;errorExit : (unsigned ErrorNumber) erroneous.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs a run-time error with the specified return code &amp;lt;vp&amp;gt;ErrorNumber&amp;lt;/vp&amp;gt;, which can be used in the [[#try-catch-finally|try-catch-finally]].&lt;br /&gt;
&lt;br /&gt;
==== fact_address ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;fact_address : (FactType FactVariable) -&amp;gt; memory::pointerTo{FactType} PointerToFactVariable.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;fact_address&amp;lt;/vp&amp;gt; predicate returns the address (as a &amp;lt;vp&amp;gt;memory::pointerTo{FactType}&amp;lt;/vp&amp;gt;) of a fact variable &amp;lt;vp&amp;gt;FactVariable&amp;lt;/vp&amp;gt; of type &amp;lt;vp&amp;gt;FactType&amp;lt;/vp&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;FactVariable&amp;lt;/vp&amp;gt; &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;must&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; be a fact variable.&lt;br /&gt;
&lt;br /&gt;
==== fail ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;fail : () failure.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; predicate forces failure and, hence, always causes backtracking. A clause that fails (with &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; or for some other reason) cannot bind output arguments.&lt;br /&gt;
&lt;br /&gt;
==== free ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;free : (&amp;lt;variableName&amp;gt; Variable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check whether a variable is free.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;free(Variable)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;free&amp;lt;/vp&amp;gt; predicate succeeds if the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is free and fails if &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is bound. The &amp;lt;vp&amp;gt;free&amp;lt;/vp&amp;gt; predicate treats the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; as bound if any of it&amp;#039;s part are instantiated.&lt;br /&gt;
&lt;br /&gt;
See also [[#bound|bound/1]].&lt;br /&gt;
&lt;br /&gt;
==== fromEllipsis ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;fromEllipsis : (...) -&amp;gt; any* AnyTermList.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate creates the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; from the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039; (i.e. from the special varying parameters block).&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;AnyTermList = fromEllipsis(EllipsisBlock )&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#toEllipsis|toEllipsis/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== hasDomain ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;hasDomain&amp;lt;/vp&amp;gt; is not really a predicate, but more a type declaration/restriction.  It has two forms a non-function for declaring/restricting the type of a variable and a function form for declaring/restricting the type of a value.&lt;br /&gt;
&lt;br /&gt;
The non-function form is called with a type as first parmeter and a variable as second parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;hasDomain : (&amp;lt;type&amp;gt; Type, Type Variable).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only effect of the call is that the &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; will be restricted to the type &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The variable can be free, bound or of some mixed flow and the binding of the variable will not change in any way.&lt;br /&gt;
&lt;br /&gt;
The function form is called with a type as first argument and a value as second argument, and it returns the same value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;hasDomain : (&amp;lt;type&amp;gt; Type, Type Value) -&amp;gt; Type Value.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only effect of the call is to ensure that the &amp;lt;vp&amp;gt;Value&amp;lt;/vp&amp;gt; will be restricted to the type &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== lowerBound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;lowerBound : (&amp;lt;numeric-domain&amp;gt; NumericDomain) -&amp;gt; &amp;lt;numeric-domain&amp;gt; LowerBound.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the lower bound of the specified &amp;lt;vp&amp;gt;NumericDomain&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;LowerBoundValue = lowerBound(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;lowerBound&amp;lt;/vp&amp;gt; is a compiling-time predicate. The &amp;lt;vp&amp;gt;lowerBound&amp;lt;/vp&amp;gt; returns the lower bound value &amp;lt;vp&amp;gt;LowerBoundValue&amp;lt;/vp&amp;gt; of the specified numeric domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The return value &amp;lt;vp&amp;gt;LowerBoundValue&amp;lt;/vp&amp;gt; belongs to the same domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter should be the name of any numerical domain; this domain name should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable). See also [[#upperBound|upperBound/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
It will give a compile time error if the specified domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; is not numeric domain.&lt;br /&gt;
&lt;br /&gt;
==== in ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#in|in/2]].&lt;br /&gt;
&lt;br /&gt;
==== isErroneous ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;isErroneous : (&amp;lt;fact-variable&amp;gt; FactVariable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate succeeds if the specified fact variable is &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;isErroneous(factVariableName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate succeeds if the specified fact variable &amp;lt;vp&amp;gt;factVariableName&amp;lt;/vp&amp;gt; has the &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt; value, otherwise it fails.&lt;br /&gt;
&lt;br /&gt;
See also [[#notErroneous|notErroneous]].&lt;br /&gt;
&lt;br /&gt;
==== maxDigits ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;maxDigits : (&amp;lt;real-domain&amp;gt; RealDomain) -&amp;gt; unsigned MaxDigits&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the value of digits (precision) of the basic domain corresponding to the specified floating-point domain &amp;lt;vp&amp;gt;RealDomain&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;MaxDigitsNumber = maxdigits(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The return maximal number of digits &amp;lt;vp&amp;gt;MaxDigitsNumber&amp;lt;/vp&amp;gt; for the &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter, which should be the name of a &amp;lt;vp&amp;gt;real&amp;lt;/vp&amp;gt; domain.&lt;br /&gt;
&lt;br /&gt;
==== not ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#not|not]].&lt;br /&gt;
&lt;br /&gt;
==== notErroneous ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;notErroneous/1-&amp;gt;&amp;lt;/vp&amp;gt; predicate will succeed with the value of a fact if the fact is not erroneous.  The main purpose of the predicate is to get an atomic view of the fact in a multi-threaded application.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;&lt;br /&gt;
facts&lt;br /&gt;
    theFact : integer := erroneous.&lt;br /&gt;
clauses&lt;br /&gt;
    ppp() :-&lt;br /&gt;
        if F = notErroneous(theFact) then&lt;br /&gt;
            % theFact was not erroneous, its value was F&lt;br /&gt;
        end if.&lt;br /&gt;
&amp;lt;/vip&amp;gt;&lt;br /&gt;
The related code using &amp;lt;vp&amp;gt;isErroneous/1&amp;lt;/vp&amp;gt; is not threadsafe:&lt;br /&gt;
&amp;lt;vip&amp;gt;&lt;br /&gt;
clauses&lt;br /&gt;
    ppp() :-&lt;br /&gt;
        if not(isErroneous(theFact)) then&lt;br /&gt;
            % theFact was not erroneous, but it can be in the next line&lt;br /&gt;
            F = theFact              &lt;br /&gt;
        end if.&lt;br /&gt;
&amp;lt;/vip&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
See also [[#isErroneous|isErroneous]].&lt;br /&gt;
&lt;br /&gt;
==== otherwise ====&lt;br /&gt;
&lt;br /&gt;
See {{Lang2|Terms|otherwise|otherwise}}.&lt;br /&gt;
&lt;br /&gt;
==== or ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#or_.28.3B.29|or (;)]].&lt;br /&gt;
&lt;br /&gt;
==== orelse ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#orelse|orelse]].&lt;br /&gt;
&lt;br /&gt;
==== predicate_fullname ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicate_fullname : () -&amp;gt; string PredicateFullName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;PredicateFullName&amp;lt;/vp&amp;gt; of the predicate in which it is invoked. The returned predicate name is qualified with a scope name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;predicate_fullname&amp;lt;/vp&amp;gt; can only be used inside a clause. Use of &amp;lt;vp&amp;gt;predicate_fullname&amp;lt;/vp&amp;gt; in other places causes a compile time error. See also [[#predicate_name|predicate_name]].&lt;br /&gt;
&lt;br /&gt;
==== predicate_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicate_name : () -&amp;gt; string PredicateName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;PredicateName&amp;lt;/vp&amp;gt; of the predicate in which it is invoked.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; can only be used inside a clause. Use of &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; in other places causes a compile time error. See also [[#predicate_fullname|predicate_fullname]]&lt;br /&gt;
&lt;br /&gt;
==== programPoint ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;programPoint : () -&amp;gt; core::programPoint ProgramPoint.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;programPoint&amp;lt;/vp&amp;gt; corresponding to the place where it is invoked.&lt;br /&gt;
&lt;br /&gt;
==== retract ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract : (&amp;lt;fact-term&amp;gt; FactTerm) nondeterm anyflow.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Successively removes the first matching fact from the facts database.  Fails when no more facts match.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract(FactTemplate)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; should be a fact term. The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate deletes the first fact that matches the &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; in the appropriated facts database. During backtracking, the rest of the matching facts will be deleted.&lt;br /&gt;
&lt;br /&gt;
Notice that &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can have any level of instantiation. The &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; is matched with the facts in the facts database, which means that any free variables will be bound in the call to &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can contain any anonymous variables. That is, variables with names consisting from the single underscore &amp;lt;vp&amp;gt;_&amp;lt;/vp&amp;gt; or a variable with a name starting with an underscore &amp;lt;vp&amp;gt;_AnyValue&amp;lt;/vp&amp;gt; if the variable occurs only once in the clause. For example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract(person(&amp;quot;Hans&amp;quot;, _Age)),&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will retract the first matched person fact that has &amp;quot;&amp;lt;vp&amp;gt;Hans&amp;lt;/vp&amp;gt;&amp;quot; as the first argument and anything as the second argument.&lt;br /&gt;
&lt;br /&gt;
When retracting a fact, which is declared to be determ, the call to &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; will be deterministic.&lt;br /&gt;
&lt;br /&gt;
See also [[#retractall|retractall/1]] and [[#retractFactDb|retractFactDb]].&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate cannot be applied to single facts or fact variables.&lt;br /&gt;
&lt;br /&gt;
Be careful calling &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; with free &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; variable if any single fact is declared in the project current scope. If you retract a single fact, then the run-time error is generated. The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate fails when there are no more matches.&lt;br /&gt;
&lt;br /&gt;
==== retractall ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractall : (&amp;lt;fact-term&amp;gt; FactTerm) .&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove all matching facts from the facts database.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractall(FactTemplate)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; should be a fact term.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt; retracts all facts which match the given &amp;#039;&amp;#039;FactTemplate&amp;#039;&amp;#039;. It always succeeds, even if no facts were retracted.&lt;br /&gt;
&lt;br /&gt;
Attempting to retract a &amp;lt;vp&amp;gt;single&amp;lt;/vp&amp;gt; fact will cause a compile time error.&lt;br /&gt;
&lt;br /&gt;
It is not possible to obtain any output values from &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt;. For this reason, the variables in the call must be bound or be a single underscores (anonymous). Notice that  &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can have any level of instantiation, but free variables must be single underscores (&amp;quot;unconditionally anonymous&amp;quot;). In difference to [[#retract|retract/1]] &amp;quot;conditionally&amp;quot; anonymous variables with names starting from the underscore (like &amp;lt;vp&amp;gt;_AnyValue&amp;lt;/vp&amp;gt;) cannot be used in &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
See also [[#retract|retract/1]] and [[#retractFactDb|retractFactDb/1]].&lt;br /&gt;
&lt;br /&gt;
==== retractFactDb ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractFactDb : (factDB FactDB).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove all facts from the named internal facts database &amp;lt;vp&amp;gt;FactDB&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractFactDb(FactDB)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retractFactDb/1&amp;lt;/vp&amp;gt; removes all facts from the named facts database &amp;lt;vp&amp;gt;FactDB&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Notice, it is impossible to retract &amp;lt;vp&amp;gt;single&amp;lt;/vp&amp;gt; facts and fact variables, so the predicate leaves such ones as they are.&lt;br /&gt;
&lt;br /&gt;
See also [[#retractall|retractall/1]] and [[#retract|retract/1]].&lt;br /&gt;
&lt;br /&gt;
==== retractAll/2 ====&lt;br /&gt;
&lt;br /&gt;
Obsolete predicate! Use [[#retractFactDb|retractFactDb/1]] instead.&lt;br /&gt;
&lt;br /&gt;
==== sizeBitsOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeBitsOf : (&amp;lt;domain&amp;gt; DomainName) -&amp;gt; unsigned BitSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bits occupied in memory by an entity of the specified domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;BitSize = sizeBitsOf(DomainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compiling-time predicate receives the domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt; as input parameter and return the size of memory that is occupied by the entity of the given domain. The result is measured in bits. For the integer domains &amp;lt;vp&amp;gt;sizeBitsOf/1-&amp;gt;&amp;lt;/vp&amp;gt; predicate returns the value that was defined for the size-field in a domain&amp;#039;s declaration.&lt;br /&gt;
&lt;br /&gt;
The following is always true for the integral domains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOfDomain(domain)*8 - 7 &amp;lt;= sizeBitsOf(domain) &amp;lt;= sizeOfDomain(domain)*8&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#sizeOfDomain|sizeOfDomain]]/1-&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== sizeOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOf : (Type Term) -&amp;gt; integer ByteSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bytes occupied in memory by the specified term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ByteSize = sizeOf(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;sizeOf/1-&amp;gt;&amp;lt;/vp&amp;gt; function receives a term as input parameter and returns value &amp;lt;vp&amp;gt;ByteSize&amp;lt;/vp&amp;gt; that specifies the number of bytes occupied in memory by this term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== sizeOfDomain ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOfDomain : (&amp;lt;domain&amp;gt; Domain) -&amp;gt; integer ByteSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bytes occupied in memory by the entity of the specified domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ByteSize = sizeOfDomain(DomainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compiling-time predicate receives the domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt; as input parameter and return the size of memory that is occupied by the entity of the given domain. The result is measured in bytes. The returned value &amp;lt;vp&amp;gt;ByteSize&amp;lt;/vp&amp;gt; belongs to the integer domain. Compare with [[#sizeBitsOf|sizeBitsOf/1-&amp;gt;]], which returns size of a domain measured in bits.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_lineno ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_lineno : () -&amp;gt; unsigned LineNumber.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current line number in the source file processed by the compiler.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_name : () -&amp;gt; string FileName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the name of the source file processed by the compiler.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_timestamp ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_timestamp : () -&amp;gt; string TimeStamp..&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a string that represents the date and time of the currently compiled source file in format &amp;lt;b&amp;gt;YYYY-MM-DD HH:mm:ss&amp;lt;/b&amp;gt;. Where:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;YYYY&amp;lt;/b&amp;gt; - Year.&lt;br /&gt;
* &amp;lt;b&amp;gt;MM&amp;lt;/b&amp;gt; - Month.&lt;br /&gt;
* &amp;lt;b&amp;gt;DD&amp;lt;/b&amp;gt; - Day.&lt;br /&gt;
* &amp;lt;b&amp;gt;HH&amp;lt;/b&amp;gt; - Hour.&lt;br /&gt;
* &amp;lt;b&amp;gt;mm&amp;lt;/b&amp;gt; - Minute.&lt;br /&gt;
* &amp;lt;b&amp;gt;ss&amp;lt;/b&amp;gt; - Second.&lt;br /&gt;
&lt;br /&gt;
==== succeed ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;succeed : ().&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate &amp;lt;vp&amp;gt;succeed/0&amp;lt;/vp&amp;gt; will always succeed.&lt;br /&gt;
&lt;br /&gt;
==== toAny ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toAny : (Term) -&amp;gt; any UniversalTypeValue.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to the value of universal term type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;UniversalTypeValue = toAny(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A term of the &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; domain can be converted back to its original type using the &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicates (see {{lang2|Built-in entities/Predicates|toTerm|toTerm}}).&lt;br /&gt;
&lt;br /&gt;
==== toBinary ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toBinary : (Term) -&amp;gt; binary Serialized.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to [[#binary|binary]] representation.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Serialized = toBinary(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a binary, it can safely be stored in a file or sent over a network to another program. Later the obtained binary value &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; can be converted back to a Visual Prolog term, using [[#toTerm|toTerm/1-&amp;gt;]] function (the domain for the reversed term should be adequate to &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) for the reverse conversion.&lt;br /&gt;
&lt;br /&gt;
==== toBoolean ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toBoolean : (&amp;lt;deterministic_expression&amp;gt; SubGoal) -&amp;gt; boolean Succeed.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of this meta-predicate is to convert an expression to the value of boolean domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this meta-predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;True_or_False = toBoolean(deterministic_expression)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this is equivalent to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;True_or_False = if deterministic_expression then true else false end if&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;toBoolean/1-&amp;gt;&amp;lt;/vp&amp;gt; meta-predicate returns [[#boolean|boolean]] value. The result is &amp;lt;vp&amp;gt;true&amp;lt;/vp&amp;gt; if &amp;#039;&amp;#039;deterministic_call&amp;#039;&amp;#039; succeeds. The result is &amp;lt;vp&amp;gt;false&amp;lt;/vp&amp;gt; if &amp;#039;&amp;#039;deterministic_call&amp;#039;&amp;#039; fails.&lt;br /&gt;
&lt;br /&gt;
==== toEllipsis ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toEllipsis : (any* AnyTermList) -&amp;gt; ....&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate creates &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039; (i.e. the special varying parameters block) from the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;. Such &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; can be later passed to a predicate which expects the varying number of arguments (i.e. is declared with the ellipsis (&amp;#039;&amp;#039;...&amp;#039;&amp;#039;)), like &amp;lt;vp&amp;gt;write/...&amp;lt;/vp&amp;gt;, at the position of the ellipsis (&amp;#039;&amp;#039;...&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;EllipsisBlock = toEllipsis(&amp;lt;any_term_list&amp;gt;), write(EllipsisBlock)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#fromEllipsis|fromEllipsis/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== toString ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toString : (Term) -&amp;gt; string Serialized.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to string representation.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Serialized = toString(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a string, it can safely be stored in a file or sent over a network to another program. Later the obtained string value can be converted back to a Visual Prolog term, using [[#toTerm|toTerm/1-&amp;gt;]] function (the domain of the return value should be adequate to &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) for the reverse conversion.&lt;br /&gt;
&lt;br /&gt;
==== toTerm ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toTerm : (string Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (binary Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (any Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, string Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, binary Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, any Serialized) -&amp;gt; Term.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the string/binary/any representation of the specified term &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; into representation corresponding to the domain of &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; variable of the return value. The domain can be stated explicitly or it can be left to the compiler to determine a suitable domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Term = toTerm(Serialized) % with implicit domain&lt;br /&gt;
Term = toTerm(domainName, Serialized) % with explicit domain, domainName&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the domain is not specified the compiler must be able to determine the domain for the returned value &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; at compile-time. Notice that binary version of &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicate performs almost byte to byte conversion and only checking general compatibility of &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; data with the domain required to the return value &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;. The programmer is wholly responsible for providing binary data of &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; that can be correctly converted to the term of the desired domain. The &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicates are counterparts to predicates [[#toBinary|toBinary/1-&amp;gt;]] and [[#toString|toString/1-&amp;gt;]]. When a &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a binary or string representation &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; (by [[#toBinary|toBinary/1-&amp;gt;]] or [[#toString|toString/1-&amp;gt;]] or [[#toAny|toAny/1-&amp;gt;]] correspondingly), it can safely be stored in a file or sent over a network to another program. Later the corresponding &amp;lt;vp&amp;gt;toTerm/1&amp;lt;/vp&amp;gt;-&amp;gt; function can convert the obtained string/binary value &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; back to a Visual Prolog term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;. For correctness of the reverse conversion the domain of the clause variable &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; should be adequate to the initial domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
See also [[#tryToTerm|tryToTerm]].&lt;br /&gt;
&lt;br /&gt;
It gives a compile time error if the compiler cannot determine the return domain.&lt;br /&gt;
&lt;br /&gt;
Exceptions&lt;br /&gt;
&lt;br /&gt;
* Run time errors are generated when the &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicate cannot convert the string or binary into a term of the specified domain.&lt;br /&gt;
&lt;br /&gt;
==== tryToTerm ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;tryToTerm : (string Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (binary Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (any Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, string Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, binary Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, any Serialized) -&amp;gt; Term.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Converts the string/binary/any representation &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; into a term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;  like [[#toTerm|toTerm]]. The only difference between the predicates is that &amp;lt;vp&amp;gt;tryToTerm&amp;lt;/vp&amp;gt; fails if it cannot convert the string or binary or any into a term of the specified domain whereas toTerm raises an exception.&lt;br /&gt;
&lt;br /&gt;
See also [[#toTerm|toTerm]].&lt;br /&gt;
&lt;br /&gt;
==== tryConvert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;tryConvert : (&amp;lt;type&amp;gt; Type, Value) -&amp;gt; &amp;lt;type&amp;gt; Converted determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the input term &amp;lt;vp&amp;gt;Value&amp;lt;/vp&amp;gt; can be strictly converted into the specified domain &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt; and returns the converted term &amp;lt;vp&amp;gt;Converted&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ReturnTerm = tryConvert(returnDomain, InputTerm)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vp&amp;gt;returnDomain&amp;lt;/vp&amp;gt;: Specifies a domain to which &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate tries to convert the specified &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; can be any domain accessible in the current scope. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the term that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; is an expression, then it will be evaluated before conversion.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; domain.&lt;br /&gt;
&lt;br /&gt;
The conversion rules are the same as of the embedded predicate [[#convert|convert/2-&amp;gt;]], but &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; fails when [[#convert|convert/2-&amp;gt;]] generates conversion errors.&lt;br /&gt;
&lt;br /&gt;
This predicate succeeds if the corresponding conversion succeeds. Otherwise it fails. The &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate tries to perform a clean and genuine conversion of the given &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; into a value of the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;. The &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate will fail if the required conversion cannot be performed. When &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate succeeds, it returns the term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; converted to the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
For allowed conversions and rules of checked explicit conversions see [[#convert|convert/2-&amp;gt;]] predicate.&lt;br /&gt;
&lt;br /&gt;
See also [[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== typeDescriptorOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;typeDescriptorOf : (&amp;lt;type&amp;gt; Type) -&amp;gt; typeDescriptor TypeDescriptor.&lt;br /&gt;
typeDescriptorOf : (Type Value) -&amp;gt; typeDescriptor TypeDescriptor.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reflection predicate that returns the &amp;lt;vp&amp;gt;typeDescriptor&amp;lt;/vp&amp;gt; of a type or a value.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;vp&amp;gt;typeDescriptor&amp;lt;/vp&amp;gt; is the reflection descriptor of an uninstantiated type/domain.&lt;br /&gt;
&lt;br /&gt;
==== typeLibraryOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;typeLibraryOf : (&amp;lt;type&amp;gt; Type) -&amp;gt; typeLibrary TypeLibrary.&lt;br /&gt;
typeLibraryOf : (Type Value) -&amp;gt; typeLibrary TypeLibrary.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reflection predicate that returns the &amp;lt;vp&amp;gt;typeLibrary&amp;lt;/vp&amp;gt; of a type or a value.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;vp&amp;gt;typeLibrary&amp;lt;/vp&amp;gt; is the reflection descriptor of an instantiated type/domain.&lt;br /&gt;
&lt;br /&gt;
==== uncheckedConvert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;uncheckedConvert : (&amp;lt;type&amp;gt; Type, Value) -&amp;gt; &amp;lt;type&amp;gt; Converted.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unchecked conversion of a value to another type.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ReturnTerm = uncheckedConvert(returnDomain, InputTerm)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vp&amp;gt;returnDomain&amp;lt;/vp&amp;gt;: Specifies a domain to which &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; predicate unsafely converts the specified &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; can be any domain accessible in the current scope, the &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; should has the same bit-size as the &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the value that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;#039;&amp;#039;InputTerm&amp;#039;&amp;#039; is an expression, then it will be evaluated before conversion.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned parameter &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; type.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; evaluates &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;, change the type to &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; without any modification of the memory pattern and unifies with &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt;. The &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; predicate performs no runtime checks. It makes only compile time checking of bit-size equality of the converted domains. So almost any term may be quite recklessly converted to any other term. So quite disastrous results may occur if you try to use variables incorrectly converted by &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;. Be extremely careful implementing &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;; we strongly recommend you always, when it is possible, using of [[#convert|convert/2-&amp;gt;]] and [[#tryConvert|tryConvert/2-&amp;gt;]]. But notice that, when an object is returned by COM system it is necessary to convert it by &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;, as Prolog program does not have information about its actual type.&lt;br /&gt;
&lt;br /&gt;
==== upperBound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;upperBound : (&amp;lt;numeric-domain&amp;gt; NumericDomain) -&amp;gt; &amp;lt;number-domain&amp;gt; UpperBound.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the upper bound value of the specified numeric domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;UpperBound = upperBound(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;upperBound&amp;lt;/vp&amp;gt; is a compiling-time predicate. The &amp;lt;vp&amp;gt;upperBound&amp;lt;/vp&amp;gt; returns the upper bound value of the specified numeric domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The return value &amp;lt;vp&amp;gt;UpperBound&amp;lt;/vp&amp;gt; belongs to the same domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter should be the name of any numerical domain; this domain name should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable).&lt;br /&gt;
&lt;br /&gt;
See also [[#lowerBound|lowerBound/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
Will cause a compile time error if the specified domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; is not numeric domain.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{LanguageReferenceSubarticle|Built-in entities/Predicates}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Visual_Prolog_7.5_Upgrade_Notes&amp;diff=4737</id>
		<title>Visual Prolog 7.5 Upgrade Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Visual_Prolog_7.5_Upgrade_Notes&amp;diff=4737"/>
		<updated>2020-09-25T13:46:18Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: formaing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document describes how to upgrade Visual Prolog 7.4 projects to Visual Prolog 7.5, for older projects you should also read [[Visual Prolog 7.4 Upgrade Notes]].&lt;br /&gt;
&lt;br /&gt;
If you have problems with upgrading your projects and need additional information, you are welcome to ask questions in [http://discuss.visual-prolog.com/viewforum.php?f=2 Visual Prolog Discussion Forum].&lt;br /&gt;
&lt;br /&gt;
By default, the installation of Visual Prolog 7.5 will not replace any previously installed versions. It is possible to work with several versions on a single computer.&lt;br /&gt;
* The Commercial Edition will by default be installed in &amp;#039;&amp;#039;&amp;#039;C:\Program Files (x86)\Visual Prolog 7.5&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;C:\Program Files\Visual Prolog 7.5&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* The Personal Edition will by default be installed to &amp;#039;&amp;#039;&amp;#039;C:\Program Files (x86)\Visual Prolog 7.5PE&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;C:\Program Files\Visual Prolog 7.5PE&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Visual Prolog 7.5 projects are backward-compatible with Visual Prolog 7.4 projects.&lt;br /&gt;
If you are going to use different versions of Visual Prolog installed at one computer, avoid opening projects by double-clicking on prj6 and vipprj files.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Notice&amp;#039;&amp;#039;&amp;#039; it is highly advisable to have a backup of a project before updating.&lt;br /&gt;
&lt;br /&gt;
When your open a project in the Visual Prolog 7.5 IDE, it will automatically create a new .vipprj project file in XML format instead of the .prj6 files used by previous versions. The .prj6 file will still exist but it will not be updated by Visual Prolog 7.5, so the two files will come out of sync and therefore it is safest to delete the .prj6 file after the update.&lt;br /&gt;
After loading the project you should rebuild the entire project with the help of the &amp;#039;&amp;#039;&amp;#039;Build | Rebuild All command&amp;#039;&amp;#039;&amp;#039; and answer &amp;quot;Yes to All&amp;quot; to the messages suggesting adding or removing packages and include statements.  You may have to build again several times to complete the build process.&lt;br /&gt;
&lt;br /&gt;
Notice that you should simply delete include directives to PFC files which cannot be found: proper include directives will (normally) be inserted automatically.&lt;br /&gt;
&lt;br /&gt;
Many projects will only require:&lt;br /&gt;
* Accept to remove all unexisting packages&lt;br /&gt;
* Accept to add required packages&lt;br /&gt;
* Delete all include directives for files that does not exist&lt;br /&gt;
* Accept to add include directives&lt;br /&gt;
&lt;br /&gt;
== Manual updates ==&lt;br /&gt;
&lt;br /&gt;
This section describes things that may need manual and semi-manual updates.&lt;br /&gt;
&lt;br /&gt;
=== findall, trap and finally ===&lt;br /&gt;
&lt;br /&gt;
The predicates &amp;lt;vp&amp;gt;findall/3&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;trap/3&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;finally/2&amp;lt;/vp&amp;gt; have been deprecated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;findall/3&amp;lt;/vp&amp;gt; should be replaced by using list comprehension:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;findall(X, B, L) ==&amp;gt; L = [ X || B ]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;trap/3&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;finally/2&amp;lt;/vp&amp;gt; should be replaced by the try construct:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;trap(P, E, H) ==&amp;gt; try P catch E do H end try&lt;br /&gt;
finally(P, F) ==&amp;gt; try P finally F end try&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In all three cases the IDE will provide a &amp;quot;Fix&amp;quot; button in the error window than can make the rewrite, notice however that it may be necessary to make these in the opposite direction (last error first) to avoid that one fix will make the next fail.&lt;br /&gt;
&lt;br /&gt;
=== Must unity ===&lt;br /&gt;
&lt;br /&gt;
Must unify &amp;quot;==&amp;quot; can no longer be used on terms that will always unify, you should use &amp;quot;=&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[New Features in Visual Prolog 7.5]]&lt;br /&gt;
* [[Visual Prolog 7.4 Upgrade Notes]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Release Notes|7.5 Upgrade Notes]]&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Visual_Prolog_7.5_Upgrade_Notes&amp;diff=4736</id>
		<title>Visual Prolog 7.5 Upgrade Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Visual_Prolog_7.5_Upgrade_Notes&amp;diff=4736"/>
		<updated>2020-09-25T13:45:35Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: misspelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document describes how to upgrade Visual Prolog 7.4 projects to Visual Prolog 7.5, for older projects you should also read [[Visual Prolog 7.4 Upgrade Notes]].&lt;br /&gt;
&lt;br /&gt;
If you have problems with upgrading your projects and need additional information, you are welcome to ask questions in [http://discuss.visual-prolog.com/viewforum.php?f=2 Visual Prolog Discussion Forum].&lt;br /&gt;
&lt;br /&gt;
By default, the installation of Visual Prolog 7.5 will not replace any previously installed versions. It is possible to work with several versions on a single computer.&lt;br /&gt;
* The Commercial Edition will by default be installed in &amp;#039;&amp;#039;&amp;#039;C:\Program Files (x86)\Visual Prolog 7.5&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;C:\Program Files\Visual Prolog 7.5&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* The Personal Edition will by default be installed to &amp;#039;&amp;#039;&amp;#039;C:\Program Files (x86)\Visual Prolog 7.5PE&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;C:\Program Files\Visual Prolog 7.5PE&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Visual Prolog 7.5 projects are backward-compatible with Visual Prolog 7.4 projects.&lt;br /&gt;
If you are going to use different versions of Visual Prolog installed at one computer, avoid opening projects by double-clicking on prj6 and vipprj files.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Notice&amp;#039;&amp;#039;&amp;#039; it is highly advisable to have a backup of a project before updating.&lt;br /&gt;
&lt;br /&gt;
When your open a project in the Visual Prolog 7.5 IDE, it will automatically create a new .vipprj project file in XML format instead of the .prj6 files used by previous versions. The .prj6 file will still exist but it will not be updated by Visual Prolog 7.5, so the two files will come out of sync and therefore it is safest to delete the .prj6 file after the update.&lt;br /&gt;
After loading the project you should rebuild the entire project with the help of the &amp;#039;&amp;#039;&amp;#039;Build | Rebuild All command&amp;#039;&amp;#039;&amp;#039; and answer &amp;quot;Yes to All&amp;quot; to the messages suggesting adding or removing packages and include statements.  You may have to build again several times to complete the build process.&lt;br /&gt;
&lt;br /&gt;
Notice that you should simply delete include directives to PFC files which cannot be found: proper include directives will (normally) be inserted automatically.&lt;br /&gt;
&lt;br /&gt;
Many projects will only require:&lt;br /&gt;
* Accept to remove all unexisting packages&lt;br /&gt;
* Accept to add required packages&lt;br /&gt;
* Delete all include directives for files that does not exist&lt;br /&gt;
* Accept to add include directives&lt;br /&gt;
&lt;br /&gt;
== Manual updates ==&lt;br /&gt;
&lt;br /&gt;
This section describes things that may need manual and semi-manual updates.&lt;br /&gt;
&lt;br /&gt;
=== findall, trap and finally ===&lt;br /&gt;
&lt;br /&gt;
The predicates &amp;lt;vp&amp;gt;findall/3&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;trap/3&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;finally/2&amp;lt;/vp&amp;gt; have been deprecated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;findall/3&amp;lt;/vp&amp;gt; should be replaced by using list comprehension:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;findall(X, B, L) ==&amp;gt; L = [ X || B]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;trap/3&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;finally/2&amp;lt;/vp&amp;gt; should be replaced by the try construct:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;trap(P, E, H) ==&amp;gt; try P catch E do H end try&lt;br /&gt;
finally(P, F) ==&amp;gt; try P finally F end try&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In all three cases the IDE will provide a &amp;quot;Fix&amp;quot; button in the error window than can make the rewrite, notice however that it may be necessary to make these in the opposite direction (last error first) to avoid that one fix will make the next fail.&lt;br /&gt;
&lt;br /&gt;
=== Must unity ===&lt;br /&gt;
&lt;br /&gt;
Must unify &amp;quot;==&amp;quot; can no longer be used on terms that will always unify, you should use &amp;quot;=&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[New Features in Visual Prolog 7.5]]&lt;br /&gt;
* [[Visual Prolog 7.4 Upgrade Notes]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Release Notes|7.5 Upgrade Notes]]&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Constants&amp;diff=4733</id>
		<title>Language Reference/Built-in entities/Constants</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Constants&amp;diff=4733"/>
		<updated>2020-07-07T11:02:20Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: format: HH-MM-SS -&amp;gt; HH:MM:SS&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
|[[#compilation_date|compilation_date]]&lt;br /&gt;
|Compilation date.&lt;br /&gt;
|-&lt;br /&gt;
|[[#compilation_time|compilation_time]]&lt;br /&gt;
|Compilation time.&lt;br /&gt;
|-&lt;br /&gt;
|[[#compiler_buildDate|compiler_buildDate]]&lt;br /&gt;
|Build date of a compiler.&lt;br /&gt;
|-&lt;br /&gt;
|[[#compiler_version|compiler_version]]&lt;br /&gt;
|A compiler version.&lt;br /&gt;
|-&lt;br /&gt;
|[[#maxFloatDigits|maxFloatDigits]]&lt;br /&gt;
|Defines the maximal value of &amp;quot;digits&amp;quot;, which is supported by the compiler.&lt;br /&gt;
|-&lt;br /&gt;
|[[#null|null]]&lt;br /&gt;
|The default NULL pointer.&lt;br /&gt;
|-&lt;br /&gt;
|[[#nullHandle|nullHandle]]&lt;br /&gt;
|A special constant of a handle type with the zero value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#invalidHandle|invalidHandle]]&lt;br /&gt;
|A special constant of a handle type with the invalid (-1) value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#platform_bits|platform_bits]]&lt;br /&gt;
|Defines the digital capacity of compilation platform.&lt;br /&gt;
|-&lt;br /&gt;
|[[#platform_name|platform_name]]&lt;br /&gt;
|Defines the target platform name.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== compilation_date ====&lt;br /&gt;
&lt;br /&gt;
Compilation date. Here &amp;#039;&amp;#039;YYYY&amp;#039;&amp;#039; means the number of a year, &amp;#039;&amp;#039;MM&amp;#039;&amp;#039; means a month number, and &amp;#039;&amp;#039;DD&amp;#039;&amp;#039; means a day number.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;compilation_date : string = &amp;quot;YYYY-MM-DD&amp;quot;.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== compilation_time ====&lt;br /&gt;
&lt;br /&gt;
Compilation time. Here &amp;#039;&amp;#039;HH&amp;#039;&amp;#039; means hours, &amp;#039;&amp;#039;MM&amp;#039;&amp;#039; means minutes, and &amp;#039;&amp;#039;SS &amp;#039;&amp;#039;means seconds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;compilation_time : string = &amp;quot;HH:MM:SS&amp;quot;.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== compiler_buildDate ====&lt;br /&gt;
&lt;br /&gt;
Build date of the compiler.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;compiler_buildDate : string = &amp;quot;YYYY-MM-DD HH:MM&amp;quot;.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== compiler_version ====&lt;br /&gt;
&lt;br /&gt;
A compiler version. This value depends upon the compiler version.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;compiler_version = 6003.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== maxFloatDigits ====&lt;br /&gt;
&lt;br /&gt;
Defines the maximal value of &amp;quot;digits&amp;quot;, which is supported by the compiler.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;maxFloatDigits = 16.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== null ====&lt;br /&gt;
&lt;br /&gt;
A special constant of a pointer type with the zero value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;null : pointer = uncheckedConvert(pointer, 0).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== nullHandle ====&lt;br /&gt;
&lt;br /&gt;
A special constant of a handle type with the zero value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;nullHandle : handle = uncheckedConvert(handle, 0).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== invalidHandle ====&lt;br /&gt;
&lt;br /&gt;
A special constant of a handle type with the invalid (-1) value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;invalidHandle : handle = uncheckedConvert(handle, -1).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== platform_bits ====&lt;br /&gt;
&lt;br /&gt;
Defines the digital capacity of compilation platform.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;platform_bits = 32.&lt;br /&gt;
or&lt;br /&gt;
platform_bits = 64.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== platform_name ====&lt;br /&gt;
&lt;br /&gt;
Defines the target platform name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;platform_name : string = &amp;quot;Windows 32bits&amp;quot;.&lt;br /&gt;
or&lt;br /&gt;
platform_name : string = &amp;quot;Windows 64bits&amp;quot;.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{LanguageReferenceSubarticle|Built-in entities/Constants}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Constants&amp;diff=4732</id>
		<title>Language Reference/Built-in entities/Constants</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Constants&amp;diff=4732"/>
		<updated>2020-07-07T10:50:47Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: format HH:MM:SS -&amp;gt; HH:MM&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
|[[#compilation_date|compilation_date]]&lt;br /&gt;
|Compilation date.&lt;br /&gt;
|-&lt;br /&gt;
|[[#compilation_time|compilation_time]]&lt;br /&gt;
|Compilation time.&lt;br /&gt;
|-&lt;br /&gt;
|[[#compiler_buildDate|compiler_buildDate]]&lt;br /&gt;
|Build date of a compiler.&lt;br /&gt;
|-&lt;br /&gt;
|[[#compiler_version|compiler_version]]&lt;br /&gt;
|A compiler version.&lt;br /&gt;
|-&lt;br /&gt;
|[[#maxFloatDigits|maxFloatDigits]]&lt;br /&gt;
|Defines the maximal value of &amp;quot;digits&amp;quot;, which is supported by the compiler.&lt;br /&gt;
|-&lt;br /&gt;
|[[#null|null]]&lt;br /&gt;
|The default NULL pointer.&lt;br /&gt;
|-&lt;br /&gt;
|[[#nullHandle|nullHandle]]&lt;br /&gt;
|A special constant of a handle type with the zero value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#invalidHandle|invalidHandle]]&lt;br /&gt;
|A special constant of a handle type with the invalid (-1) value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#platform_bits|platform_bits]]&lt;br /&gt;
|Defines the digital capacity of compilation platform.&lt;br /&gt;
|-&lt;br /&gt;
|[[#platform_name|platform_name]]&lt;br /&gt;
|Defines the target platform name.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== compilation_date ====&lt;br /&gt;
&lt;br /&gt;
Compilation date. Here &amp;#039;&amp;#039;YYYY&amp;#039;&amp;#039; means the number of a year, &amp;#039;&amp;#039;MM&amp;#039;&amp;#039; means a month number, and &amp;#039;&amp;#039;DD&amp;#039;&amp;#039; means a day number.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;compilation_date : string = &amp;quot;YYYY-MM-DD&amp;quot;.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== compilation_time ====&lt;br /&gt;
&lt;br /&gt;
Compilation time. Here &amp;#039;&amp;#039;HH&amp;#039;&amp;#039; means hours, &amp;#039;&amp;#039;MM&amp;#039;&amp;#039; means minutes, and &amp;#039;&amp;#039;SS &amp;#039;&amp;#039;means seconds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;compilation_time : string = &amp;quot;HH-MM-SS&amp;quot;.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== compiler_buildDate ====&lt;br /&gt;
&lt;br /&gt;
Build date of the compiler.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;compiler_buildDate : string = &amp;quot;YYYY-MM-DD HH:MM&amp;quot;.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== compiler_version ====&lt;br /&gt;
&lt;br /&gt;
A compiler version. This value depends upon the compiler version.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;compiler_version = 6003.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== maxFloatDigits ====&lt;br /&gt;
&lt;br /&gt;
Defines the maximal value of &amp;quot;digits&amp;quot;, which is supported by the compiler.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;maxFloatDigits = 16.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== null ====&lt;br /&gt;
&lt;br /&gt;
A special constant of a pointer type with the zero value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;null : pointer = uncheckedConvert(pointer, 0).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== nullHandle ====&lt;br /&gt;
&lt;br /&gt;
A special constant of a handle type with the zero value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;nullHandle : handle = uncheckedConvert(handle, 0).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== invalidHandle ====&lt;br /&gt;
&lt;br /&gt;
A special constant of a handle type with the invalid (-1) value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;invalidHandle : handle = uncheckedConvert(handle, -1).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== platform_bits ====&lt;br /&gt;
&lt;br /&gt;
Defines the digital capacity of compilation platform.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;platform_bits = 32.&lt;br /&gt;
or&lt;br /&gt;
platform_bits = 64.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== platform_name ====&lt;br /&gt;
&lt;br /&gt;
Defines the target platform name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;platform_name : string = &amp;quot;Windows 32bits&amp;quot;.&lt;br /&gt;
or&lt;br /&gt;
platform_name : string = &amp;quot;Windows 64bits&amp;quot;.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{LanguageReferenceSubarticle|Built-in entities/Constants}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Directives&amp;diff=4717</id>
		<title>Language Reference/Directives</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Directives&amp;diff=4717"/>
		<updated>2020-02-18T17:09:53Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: add #stringinclude&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{languageReferenceNavbar|Directives}}&lt;br /&gt;
&lt;br /&gt;
Each compiler directive starts from the &amp;lt;vp&amp;gt;#&amp;lt;/vp&amp;gt; character. The following directives are supported:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;#bininclude &amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;#stringinclude &amp;lt;/vp&amp;gt; - file inclusion.&lt;br /&gt;
* &amp;lt;vp&amp;gt;#if&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;#then&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;#else&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;#elseif&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;#endif&amp;lt;/vp&amp;gt; - conditional statements.&lt;br /&gt;
* &amp;lt;vp&amp;gt;#export&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;#externally&amp;lt;/vp&amp;gt; - exporting and importing classes.&lt;br /&gt;
* &amp;lt;vp&amp;gt;#message&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;#error&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;#requires&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;#orrequires&amp;lt;/vp&amp;gt; - compilation time information.&lt;br /&gt;
* &amp;lt;vp&amp;gt;#options&amp;lt;/vp&amp;gt; - compiler options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Source File Inclusion ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; compiler directive is used to include the contents of another file into your program source code during compilation. It has the following syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Pp_dir_include&amp;gt; :&lt;br /&gt;
   #include &amp;lt;String_literal&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The {{lang2|Lexical_Elements|String_Literals|&amp;lt;vpbnf&amp;gt;&amp;lt;String_literal&amp;gt;&amp;lt;/vpbnf&amp;gt;}} should specify an existing filename.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;#include &amp;quot;pfc\\exception\\exception.ph&amp;quot; % Includes pfc\exception\exception.ph file&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;#include @&amp;quot;pfc\vpi\vpimessage\vpimessage.ph&amp;quot; % Includes pfc\vpi\vpimessage\vpimessage.ph&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compiler directive uses &amp;quot;include the first file occurrence only&amp;quot; semantics. That is, if a compilation unit contains several include directives for the same file, it will be included only one time with the first include directive.&lt;br /&gt;
&lt;br /&gt;
Each included file must contain several accomplished scopes; an included file cannot contain uncompleted scopes. That is, it should contain several accomplished interface declarations, class declarations, class implementations or/and several compiler directives.&lt;br /&gt;
&lt;br /&gt;
The compiler tries to find the specified include source file in the following way:&lt;br /&gt;
&lt;br /&gt;
#If the filename contains an absolute path, then this file should be included.&lt;br /&gt;
#Otherwise, the compiler searches for the specified include filename among the paths that had been defined by the &amp;lt;vp&amp;gt;/Include&amp;lt;/vp&amp;gt; command line option. These paths are handled consequently as they are specified in the option. In the IDE you can set these paths in the &amp;#039;&amp;#039;&amp;#039;Include Directories&amp;#039;&amp;#039;&amp;#039; in the &amp;#039;&amp;#039;&amp;#039;Directories&amp;#039;&amp;#039;&amp;#039; tab of the &amp;#039;&amp;#039;&amp;#039;Project Settings&amp;#039;&amp;#039;&amp;#039; dialog.&lt;br /&gt;
&lt;br /&gt;
If the compiler does not find the specified file a compiling time error is generated.&lt;br /&gt;
&lt;br /&gt;
=== Text File Inclusion ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;#stringinclude&amp;lt;/vp&amp;gt; compiler directive is used to include (during compilation) the contents of a file (specified by the {{lang2|Lexical_Elements|String_Literals|string_literal}} string) as a ::{{lang2|Built-in_entities|string|string}} constant into your program source code. It has the following syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Pp_dir_bininclude&amp;gt; :&lt;br /&gt;
   #stringinclude( &amp;lt;String_literal&amp;gt; )&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This directive can be used in any places where {{lang2|Built-in_entities|string|string}} constants are allowed. The {{lang2|Lexical_Elements|String_Literals|string_literal}} should specify an existing filename. The syntax is the same as in the &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; compiler directive described in the previous paragraph {{lang2|Directives|Source_File_Inclusion|Source File Inclusions}}. The compiler tries to find the specified file in the same way as for &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; compiler directive.  If the file has a byte-order-mark it will be treated accordingly, if the file does not have byte order mark and does not appear to be in utf-16 it will be read with the current codepage (it is recommended to use files with byte-order-mark utf-8 or utf-16).&lt;br /&gt;
{{Example|A typical usage is like this:&lt;br /&gt;
&amp;lt;vip&amp;gt;&lt;br /&gt;
constants&lt;br /&gt;
    myText : string = #stringinclude(&amp;quot;text.txt&amp;quot;).&lt;br /&gt;
    % String constant from contents of the file &amp;quot;text.txt&amp;quot;.&lt;br /&gt;
&amp;lt;/vip&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Binary File Inclusion ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;#bininclude&amp;lt;/vp&amp;gt; compiler directive is used to include (during compilation) the contents of a file (specified by the {{lang2|Lexical_Elements|String_Literals|string_literal}} string) as a ::{{lang2|Built-in_entities|binary|binary}} constant into your program source code. It has the following syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Pp_dir_bininclude&amp;gt; :&lt;br /&gt;
   #bininclude( &amp;lt;String_literal&amp;gt; )&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This directive can be used in any places where {{lang2|Built-in_entities|binary|binary}} constants are allowed. The {{lang2|Lexical_Elements|String_Literals|string_literal}} should specify an existing filename. The syntax is the same as in the &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; compiler directive described in the previous paragraph {{lang2|Directives|Source_File_Inclusion|Source File Inclusions}}. The compiler tries to find the specified file in the same way as for &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; compiler directive.&lt;br /&gt;
&lt;br /&gt;
{{Example|A typical usage is like this:&lt;br /&gt;
&amp;lt;vip&amp;gt;&lt;br /&gt;
constants&lt;br /&gt;
    myBin : binary = #bininclude(&amp;quot;Bin.bin&amp;quot;).&lt;br /&gt;
    % Binary constant from contents of the file &amp;quot;Bin.bin&amp;quot;.&lt;br /&gt;
&amp;lt;/vip&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
When creating a binary constant the compiler adds the EOS symbol immediately after this constant.&lt;br /&gt;
&lt;br /&gt;
=== Exporting and Importing Classes ===&lt;br /&gt;
&lt;br /&gt;
Compiler directives &amp;lt;vp&amp;gt;#export&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;#externally&amp;lt;/vp&amp;gt; are used to determine lists of exported and imported classes, respectively. They have the following syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Pp_dir_export&amp;gt; :&lt;br /&gt;
   #export &amp;lt;ClassNames&amp;gt;-comma-sep-list&lt;br /&gt;
&amp;lt;Pp_dir_export&amp;gt; :&lt;br /&gt;
   #externally &amp;lt;ClassNames&amp;gt;-comma-sep-list&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These compiler directives are applied only to classes {{lang|Classes|classNames}}, which do not construct objects.&lt;br /&gt;
&lt;br /&gt;
They can be used only outside scopes; that is, they cannot be used inside declarations of interfaces and classes and they cannot be used inside implementations of classes.&lt;br /&gt;
&lt;br /&gt;
By default, predicates within one executed module are hidden at runtime for all other executed modules. An &amp;lt;vp&amp;gt;#export&amp;lt;/vp&amp;gt; compiler directive makes names of specified classes public outside the module in which they are declared (and implemented). Therefore, all predicates from this module declared in the classes (specified in an &amp;lt;vp&amp;gt;#export&amp;lt;/vp&amp;gt; directive) become accessible while runtime from other executed modules.&lt;br /&gt;
&lt;br /&gt;
Usually, an &amp;lt;vp&amp;gt;#export&amp;lt;/vp&amp;gt; compiler directives can be used in projects, which target modules are DLLs. It enumerates classes declared in a DLL, which should be accessible to other modules that use this DLL.&lt;br /&gt;
&lt;br /&gt;
If a compilation unit export some class, then this compilation unit should contain this class implementation.&lt;br /&gt;
&lt;br /&gt;
Also an &amp;lt;vp&amp;gt;#export&amp;lt;/vp&amp;gt; compiler directives can be used to specify {{lang2|Directives|Conditional_Compilation|condition}} expressions for &amp;lt;vp&amp;gt;#if&amp;lt;/vp&amp;gt; compiler directives.&lt;br /&gt;
&lt;br /&gt;
For example, let us suppose that somewhere in the beginning of a compilation unit the compiler has met the &amp;lt;vp&amp;gt;#export&amp;lt;/vp&amp;gt; compiler directive like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;#export className&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the compiler, if in the subsequent code it meets an &amp;lt;vp&amp;gt;#if&amp;lt;/vp&amp;gt; compiler directive with the same &amp;lt;vp&amp;gt;#export&amp;lt;/vp&amp;gt; compiler directive used as the condition expression, for example like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;#if #export className #then  ...  #endif   &amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the compiler evaluates the &amp;lt;vp&amp;gt;#export&amp;lt;/vp&amp;gt; condition expression as &amp;lt;vp&amp;gt;true&amp;lt;/vp&amp;gt; and, hence, the compiler executes the &amp;lt;vp&amp;gt;#then&amp;lt;/vp&amp;gt; branch of the conditional compilation directive.&lt;br /&gt;
&lt;br /&gt;
For example, the following &amp;lt;vp&amp;gt;#export&amp;lt;/vp&amp;gt; compiler directive with the subsequent &amp;lt;vp&amp;gt;#if&amp;lt;/vp&amp;gt; conditional compilation compiler directive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;#export className&lt;br /&gt;
...&lt;br /&gt;
#if #export className #then #requires &amp;quot;some.pack&amp;quot; #endif&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
guaranty that the &amp;lt;vp&amp;gt;&amp;quot;some.pack&amp;quot;&amp;lt;/vp&amp;gt; package will be included into the compilation unit.&lt;br /&gt;
&lt;br /&gt;
From the other hand, if an &amp;lt;vp&amp;gt;#export&amp;lt;/vp&amp;gt; compiler directive is not met by the compiler (somewhere in the compilation unit before the &amp;lt;vp&amp;gt;#if&amp;lt;/vp&amp;gt; compiler directive, which uses the same &amp;lt;vp&amp;gt;#export&amp;lt;/vp&amp;gt; compiler directive as the conditional expression), then the compiler evaluates this &amp;lt;vp&amp;gt;#export&amp;lt;/vp&amp;gt; condition expression as &amp;lt;vp&amp;gt;false&amp;lt;/vp&amp;gt;. Hence, the compiler will not execute the &amp;lt;vp&amp;gt;#then&amp;lt;/vp&amp;gt; branch of the &amp;lt;vp&amp;gt;#if&amp;lt;/vp&amp;gt; conditional compilation directive. That is, the single &amp;lt;vp&amp;gt;#if&amp;lt;/vp&amp;gt; compiler directive without previous &amp;lt;vp&amp;gt;#export&amp;lt;/vp&amp;gt; directive&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;#if #export className #then #requires &amp;quot;some.pack&amp;quot; #endif&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
does not requires to include the &amp;lt;vp&amp;gt;&amp;quot;some.pack&amp;quot;&amp;lt;/vp&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
An &amp;lt;vp&amp;gt;#externally&amp;lt;/vp&amp;gt; compiler directive is counterpart to an &amp;lt;vp&amp;gt;#export&amp;lt;/vp&amp;gt; compiler directive. An &amp;lt;vp&amp;gt;#externally&amp;lt;/vp&amp;gt; compiler directive can be used instead of (and concurrently with) an &amp;lt;vp&amp;gt;IMPORTS&amp;lt;/vp&amp;gt; directive in definition files. An &amp;lt;vp&amp;gt;#externally&amp;lt;/vp&amp;gt; compiler directive enumerates classes, which are declared in a module but implemented in other modules. Therefore, the compiler will not produce errors when it detects such classes. The referenced classes can be implemented (and exported) in DLLs, which can be linked to the module at runtime.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;#export&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;#externally&amp;lt;/vp&amp;gt; compiler directives can be used as &amp;lt;vpbnf&amp;gt;&amp;lt;Condition&amp;gt;&amp;lt;/vpbnf&amp;gt; boolean expressions in {{lang2|Directives|Conditional Compilation|Conditional Compilation}}.&lt;br /&gt;
&lt;br /&gt;
For example, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;#if #export className #then #include &amp;quot;Some package.pack&amp;quot; #endif&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compile Time Information ===&lt;br /&gt;
&lt;br /&gt;
Compiler directives &amp;lt;vp&amp;gt;#message&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;#requires&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;#orrequires&amp;lt;/vp&amp;gt;, and &amp;lt;vp&amp;gt;#error&amp;lt;/vp&amp;gt; can be used to issue user-defined messages into a listing file while compilation of project modules and to interrupt compilation.&lt;br /&gt;
&lt;br /&gt;
These directives can be used either outside scopes (interface declaration, class declaration or class implementation), or inside scopes but outside sections. They have the following syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Pp_dir_message&amp;gt;: one of&lt;br /&gt;
    #message &amp;lt;String_literal&amp;gt;&lt;br /&gt;
    #error &amp;lt;String_literal&amp;gt;&lt;br /&gt;
    #requires &amp;lt;String_literal&amp;gt; &amp;lt;Pp_dir_orrequires&amp;gt;-list-opt&lt;br /&gt;
    #orrequires &amp;lt;String_literal&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the compiler meets any of these directives, it generates the correspondent warning message and place the directive text into a &amp;#039;&amp;#039;listing file&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
A listing file name can be specified with the compiler directive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;/listingfile:&amp;quot;FileName&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that no empty spaces can be used between the colon &amp;lt;vp&amp;gt;:&amp;lt;/vp&amp;gt; (after &amp;lt;vp&amp;gt;/listinglile&amp;lt;/vp&amp;gt;) and &amp;lt;vp&amp;gt;&amp;quot;FileName&amp;quot;&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By default the compiler does NOT generate informative messages for the &amp;lt;vp&amp;gt;#message&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;#requires&amp;lt;/vp&amp;gt;, and &amp;lt;vp&amp;gt;#orrequires&amp;lt;/vp&amp;gt; directives. You can switch generation of these informative messages ON specifying the compiler options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;/listing:message&lt;br /&gt;
/listing:requires&lt;br /&gt;
/listing:ALL&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Example| In this case, when the compiler meets a directive like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;#message &amp;quot;Some message&amp;quot;&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
it will place the following text into the listing file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;C:\Tests\test\test.pro(14,10) : information c062: #message &amp;quot;Some message&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The directive &amp;lt;vp&amp;gt;#requires&amp;lt;/vp&amp;gt; (&amp;lt;vp&amp;gt;#orrequires&amp;lt;/vp&amp;gt;) issues arbitrary user-defined messages about the needed source (object) files into a listing file. The &amp;lt;vp&amp;gt;#orrequires&amp;lt;/vp&amp;gt; directive cannot be used alone: the &amp;lt;vp&amp;gt;#requires&amp;lt;/vp&amp;gt; directive should immediately (separated with white spaces or comments only) precede it.&lt;br /&gt;
&lt;br /&gt;
The directive &amp;lt;vp&amp;gt;#error&amp;lt;/vp&amp;gt; always terminates the compilation and issues the user-defined error message like the following into a listing file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;C:\Tests\test\test.pro(14,10) : error c080: #error &amp;quot;Compilation is interrupted&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can parse and analyze these messages and accept the required actions. For example, the VDE analyzes information printed by the &amp;lt;vp&amp;gt;#requires&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;#orrequires&amp;lt;/vp&amp;gt; directives and automatically adds all needed PFC packages and standard libraries to the compiled project (See also the &amp;#039;&amp;#039;&amp;#039;Handling Project Modules&amp;#039;&amp;#039;&amp;#039; topic).&lt;br /&gt;
&lt;br /&gt;
{{Example| The directives &amp;lt;vp&amp;gt;#requires&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;#orrequires&amp;lt;/vp&amp;gt; can be used like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;#requires @&amp;quot;\Common\Sources\CommonTypes.pack&amp;quot;&lt;br /&gt;
#orrequires @&amp;quot;\Common\Lib\CommonTypes.lib&amp;quot;&lt;br /&gt;
#orrequires @&amp;quot;\Common\Obj\Foreign.obj&amp;quot;&lt;br /&gt;
#if someClass::debugLevel &amp;gt; 0 #then&lt;br /&gt;
   #requires @&amp;quot;\Sources\Debug\Tools.pack&amp;quot;&lt;br /&gt;
   #orrequires @&amp;quot;\Lib\Debug\Tools.lib&amp;quot;&lt;br /&gt;
#else&lt;br /&gt;
   #requires @&amp;quot;\Sources\Release\Tools.pack&amp;quot;&lt;br /&gt;
   #orrequires @&amp;quot;\Lib\Release\Tools.lib&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
#orrequires &amp;quot;SomeLibrary.lib&amp;quot;&lt;br /&gt;
#requires &amp;quot;SomePackage.pack&amp;quot;&lt;br /&gt;
#if someClass::debugLevel &amp;gt; 0 #then&lt;br /&gt;
   #orrequires @&amp;quot;\Debug\SomePackage.lib&amp;quot;&lt;br /&gt;
#else&lt;br /&gt;
   #orrequires @&amp;quot;\Release\SomePackage.lib&amp;quot;&lt;br /&gt;
#endif&amp;lt;/vip&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example| The &amp;lt;vp&amp;gt;#message&amp;lt;/vp&amp;gt; directive can be used like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;#message &amp;quot;Some text&amp;quot;&lt;br /&gt;
#if someClass::someConstant &amp;gt; 0 #then&lt;br /&gt;
   #message &amp;quot;someClass::someConstant &amp;gt; 0&amp;quot;&lt;br /&gt;
#else&lt;br /&gt;
   #message &amp;quot;someClass::someConstant &amp;lt;= 0&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
class someClass&lt;br /&gt;
   #if ::compiler_version &amp;gt; 600 #then&lt;br /&gt;
       #message  &amp;quot;New compiler&amp;quot;&lt;br /&gt;
       constants&lt;br /&gt;
           someConstant = 1.&lt;br /&gt;
   #else&lt;br /&gt;
       #message &amp;quot;Old compiler&amp;quot;&lt;br /&gt;
       constants&lt;br /&gt;
           someConstant = 0.&lt;br /&gt;
   #endif&lt;br /&gt;
end class someClass&amp;lt;/vip&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example| The &amp;lt;vp&amp;gt;#error&amp;lt;/vp&amp;gt; can be used like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;#if someClass::debugLevel &amp;gt; 0 #then&lt;br /&gt;
   #error &amp;quot;Debug version is not yet implemented&amp;quot;&lt;br /&gt;
#endif&amp;lt;/vip&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Compiler options directive ===&lt;br /&gt;
&lt;br /&gt;
Compiler directive &amp;lt;vp&amp;gt;#options &amp;lt;string_literal&amp;gt;&amp;lt;/vp&amp;gt; affects the whole compilation unit. This directive should be used outside scopes and conditional compilation statements in the main source file for a compilation unit (i.e. in the source file which is passed to the compiler). Otherwise the compiler generates a warning message and ignores the directive.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;&amp;lt;string_literal&amp;gt;&amp;lt;/vp&amp;gt; can only contain the following compiler options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;&amp;quot;/Warning&amp;quot;&lt;br /&gt;
&amp;quot;/Check&amp;quot;&lt;br /&gt;
&amp;quot;/NOCheck&amp;quot;&lt;br /&gt;
&amp;quot;/Optimize&amp;quot;&lt;br /&gt;
&amp;quot;/DEBug&amp;quot;&lt;br /&gt;
&amp;quot;/GOAL&amp;quot;&lt;br /&gt;
&amp;quot;/MAXErrors&amp;quot;&lt;br /&gt;
&amp;quot;/MAXWarnings&amp;quot;&lt;br /&gt;
&amp;quot;/profile&amp;quot;&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Otherwise the compiler generates the error message for invalid option.&lt;br /&gt;
If there are several &amp;lt;vp&amp;gt;#options&amp;lt;/vp&amp;gt; directives they are handled in the textual order.&lt;br /&gt;
&lt;br /&gt;
=== Conditional Compilation ===&lt;br /&gt;
&lt;br /&gt;
The conditional programming constructions are part of the Visual Prolog language. Only other compiler directives, {{lang|Compilation Units|Compilation Units}}, and {{lang|Program Sections|Program Sections}} (including empty) can be conditional. The following syntax is used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;ConditionalItem&amp;gt; :&lt;br /&gt;
   #if &amp;lt;Condition&amp;gt; #then &amp;lt;CompilationItem&amp;gt;-list-opt &amp;lt;ElseIfItem&amp;gt;-list-opt &amp;lt;ElseItem&amp;gt;-opt #endif&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;ElseIfItem&amp;gt; :&lt;br /&gt;
   #elseif &amp;lt;Condition&amp;gt; #then &amp;lt;CompilationItem&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;ElseItem&amp;gt; :&lt;br /&gt;
   #else &amp;lt;CompilationItem&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;vpbnf&amp;gt;&amp;lt;Condition&amp;gt;&amp;lt;/vpbnf&amp;gt; can be any expression, which can be evaluated to fail or succeed during compilation time.&lt;br /&gt;
&lt;br /&gt;
Each one conditional compilation statement must be in one file, that is, the compiler directives &amp;lt;vp&amp;gt;#if&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;#then&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;#elseif&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;#else&amp;lt;/vp&amp;gt; (if present), &amp;lt;vp&amp;gt;#endif&amp;lt;/vp&amp;gt; of the same level of nesting must be in one file.&lt;br /&gt;
&lt;br /&gt;
During compilation the compiler evaluates the conditions, in order to determine which parts to include in the final program. Parts that are excluded from the final program are called the dead branches.&lt;br /&gt;
&lt;br /&gt;
All branches of conditional compilation items are syntax checked and must be syntactically correct. That is, also the dead branches must be syntactically correct.&lt;br /&gt;
&lt;br /&gt;
The compiler only calculates conditions on a need to know basis, i.e. it does not calculate conditions in dead branches.&lt;br /&gt;
&lt;br /&gt;
A condition may not depend on any code, which is located textually inside the conditional statement.&lt;br /&gt;
&lt;br /&gt;
The example below is &amp;#039;&amp;#039;&amp;#039;illegal&amp;#039;&amp;#039;&amp;#039; because the condition depends on the scope (and constant) which is declared inside the condition branch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;#if aaa::x &amp;gt; 7 #then % ERROR!&lt;br /&gt;
class aaa&lt;br /&gt;
    constants&lt;br /&gt;
        x = 3&lt;br /&gt;
end class aaa&lt;br /&gt;
#else&lt;br /&gt;
class aaa&lt;br /&gt;
    constants&lt;br /&gt;
        x = 23&lt;br /&gt;
end class aaa&lt;br /&gt;
#endif&amp;lt;/vip&amp;gt;&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Terms&amp;diff=4696</id>
		<title>Language Reference/Terms</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Terms&amp;diff=4696"/>
		<updated>2019-10-29T10:57:49Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: add --&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{languageReferenceNavbar|Terms}}&lt;br /&gt;
&lt;br /&gt;
This section describes terms and how execution/evaluation of terms and clauses proceeds.&lt;br /&gt;
&lt;br /&gt;
Semantically, there are two kinds of terms: &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;formulas&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;expressions&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
*Expressions represent values, like the number 7.&lt;br /&gt;
*Formulas represent logical statements, like &amp;quot;the number 7 is greater than the number 3&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Syntactically the two kinds have a huge overlap and therefore the syntax unites the two kinds into &amp;#039;&amp;#039;terms&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The following definition of &amp;lt;vpbnf&amp;gt;&amp;lt;Term&amp;gt;&amp;lt;/vpbnf&amp;gt; is simplified, in the sense that it includes syntactic constructions that are not legal. For example, one cannot legally write &amp;lt;vp&amp;gt;! + !&amp;lt;/vp&amp;gt;. We do however believe that using this simple syntax description in combination with intuitive understanding of language concepts, the type system, and the operator hierarchy described below is better for most purposes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Term&amp;gt;:&lt;br /&gt;
    ( &amp;lt;Term&amp;gt; )&lt;br /&gt;
    &amp;lt;Literal&amp;gt;&lt;br /&gt;
    &amp;lt;Variable&amp;gt;&lt;br /&gt;
    &amp;lt;Identifier&amp;gt;&lt;br /&gt;
    &amp;lt;MemberAccess&amp;gt;&lt;br /&gt;
    &amp;lt;PredicateCall&amp;gt;&lt;br /&gt;
    &amp;lt;PredicateExpression&amp;gt;&lt;br /&gt;
    &amp;lt;UnaryOperator&amp;gt; &amp;lt;Term&amp;gt;&lt;br /&gt;
    &amp;lt;Term&amp;gt; &amp;lt;Operator&amp;gt; &amp;lt;Term&amp;gt;&lt;br /&gt;
    &amp;lt;Cut&amp;gt;&lt;br /&gt;
    &amp;lt;Ellipsis&amp;gt;&lt;br /&gt;
    &amp;lt;FactvariableAssignment&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Backtracking ===&lt;br /&gt;
&lt;br /&gt;
The evaluation of a Prolog program is a search for a &amp;quot;solution&amp;quot; to the goal. Each step in the search for a solution can either &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeed&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fail&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;. At certain points in the program execution there are more than one possible choices for finding a solution. When such a choice point is met a so called &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;backtrack point&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is created. A backtrack point is a recording of the program state plus a pointer to the choice that was not executed. If it turn out that the original choice could not provide the solution (i.e. if it &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fails&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;), then the program will &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;backtrack&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; to the recorded backtrack point. Thereby restoring the program state and pursuing the other choice. The mechanism will be described and exemplified in details in the following sections.&lt;br /&gt;
&lt;br /&gt;
=== Literals ===&lt;br /&gt;
&lt;br /&gt;
Literals have {{lang2|Domains|Universal_Types|universal type}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Literal&amp;gt;:&lt;br /&gt;
   &amp;lt;IntegerLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;RealLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;CharacterLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;StringLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;BinaryLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;ListLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;CompoundDomainLiteral&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also {{lang2|Lexical Elements|Literals|Literals (in Lexical Elements)}}&lt;br /&gt;
&lt;br /&gt;
=== Variables ===&lt;br /&gt;
&lt;br /&gt;
Variables in Visual Prolog are immutable: once they are bound to a value they retain that value, but backtracking can unbind the variable again during the process of restoring a previous program state.&lt;br /&gt;
&lt;br /&gt;
A variable can thus be bound (during unification and matching), if it is already bound then it evaluates to the value that it is bound to.&lt;br /&gt;
&lt;br /&gt;
Variables are names starting with an upper-case letter or with an underscore (_), followed by a sequence of letters (both uppercase and lowercase), digits, and underscore characters (all in all called an UppercaseIdentifier):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Variable&amp;gt;:&lt;br /&gt;
    &amp;lt;UppercaseIdentifer&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following are examples of valid variable names:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;My_first_correct_variable_name&lt;br /&gt;
_&lt;br /&gt;
_Sales_10_11_86&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
while the next two are invalid:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;1stattempt&lt;br /&gt;
second_attempt&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variable consisting of single underscore character (i.e. &amp;lt;vp&amp;gt;_&amp;lt;/vp&amp;gt;) is known as the &amp;#039;&amp;#039;anonymous variable&amp;#039;&amp;#039;. The anonymous variable is used in patterns and bindings where the corresponding value is of no interest and should be ignored.  Every occurrence of the anonymous variable is an independent anonymous variable, i.e. even though the anonymous variable is used several times in a single clause they have no relation to each other.&lt;br /&gt;
&lt;br /&gt;
If variables that starts with an underscore are not anonymous, but they are still intended for values of no interest that should be ignored.  The compiler will issue a warning if the value of such a warning is actually not ignored.&lt;br /&gt;
&lt;br /&gt;
Prolog variables are local to the clause in which it occurs. That is, if two clauses each contain a variable called &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt;, these &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt;-s are two distinct variables.&lt;br /&gt;
&lt;br /&gt;
A variable is said to be &amp;#039;&amp;#039;free&amp;#039;&amp;#039; when it is not yet associated with a term and to be &amp;#039;&amp;#039;bound&amp;#039;&amp;#039; or instantiated when it is unified with a term.&lt;br /&gt;
&lt;br /&gt;
The Visual Prolog compiler does not make a distinction between upper and lower case letters in names, except for the first letter. This means that the two variables &amp;lt;vp&amp;gt;SourceCode&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;SOURCECODE&amp;lt;/vp&amp;gt; are the same.&lt;br /&gt;
&lt;br /&gt;
=== Identifier ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Identifier&amp;gt;:&lt;br /&gt;
    &amp;lt;MemberName&amp;gt;&lt;br /&gt;
    &amp;lt;GlobalScopeMembername&amp;gt;&lt;br /&gt;
    &amp;lt;ScopeQualifiedMemberName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;MemberName&amp;gt;:&lt;br /&gt;
    &amp;lt;LowerCaseIdentifier&amp;gt;&lt;br /&gt;
&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Identifiers are used to refer to named entities (i.e. classes, interfaces, constants, domains, predicates, facts, ...).&lt;br /&gt;
&lt;br /&gt;
An identifier can just be a lower case identifier (i.e. a lowercase letter followed by a sequence of letters, numbers and underscore characters).&lt;br /&gt;
&lt;br /&gt;
Many entities can have the same name.  So it may be necessary or desirable to qualify the lowercase identifier the name of the particular scope of interest, or to state that the name is in the global namespace.&lt;br /&gt;
&lt;br /&gt;
{{Example| These are examples of unqualified identifiers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;integer&lt;br /&gt;
mainExe&lt;br /&gt;
myPredicate&amp;lt;/vip&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Global Entities Access ====&lt;br /&gt;
&lt;br /&gt;
The only global entities, which exist in Visual Prolog, are built-in domains, predicates, and constants. Global names are directly accessible in any scope. There might however exist situations where a global name is shadowed by a local or imported name. In that case the global entity can be qualified with a double colon &amp;#039;&amp;lt;vp&amp;gt;::&amp;lt;/vp&amp;gt;&amp;#039; (without a prefixed class/interface name). The double colon can be used everywhere, but the most important place is where an interface name is used as formal parameter type specifier.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;GlobalScopeMemberName&amp;gt;:&lt;br /&gt;
    :: &amp;lt;MemberName&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Example| The built-in domain &amp;lt;vp&amp;gt;integer&amp;lt;/vp&amp;gt; is defined in the global scope, to avoid ambiguity or stress that it is this particular domains you can use the global scope member name:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;::integer&amp;lt;/vip&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Class/Interface Member Access ====&lt;br /&gt;
&lt;br /&gt;
Static members of classes and interfaces are accessed by means of qualification with the class name (and optionally a namespace prefix):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;ScopeQualifiedMemberName&amp;gt;&lt;br /&gt;
    &amp;lt;NamespacePrefix&amp;gt;-opt &amp;lt;ScopeName&amp;gt; :: &amp;lt;MemberName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;NamespacePrefix&amp;gt;:&lt;br /&gt;
    &amp;lt;NamespaceIdentifier&amp;gt;-opt \&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ScopeName&amp;gt;:&lt;br /&gt;
    &amp;lt;LowercaseIdentifier&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ScopeName is the name of the class or interface that defines/declares the name.&lt;br /&gt;
&lt;br /&gt;
Namespace prefixing is explained in: {{lang2|Namespaces|Referencing names in namespaces|Referencing names in namespaces}}.&lt;br /&gt;
&lt;br /&gt;
Some names can be accessed without qualification, see {{lang2|Basic_Concepts|Scoping_&amp;amp;_Visibility|scoping &amp;amp; visibility}}.&lt;br /&gt;
&lt;br /&gt;
=== Predicate Call ===&lt;br /&gt;
&lt;br /&gt;
A predicate call have the form&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;PredicateCall&amp;gt;:&lt;br /&gt;
     &amp;lt;Term&amp;gt; ( &amp;lt;Term&amp;gt;-comma-sep-list-opt )&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first term must be an expression that evaluates to a value with predicate type.  Typically, it is either the name of a predicate in a class, or an expression that evaluates to a predicate member of an object.&lt;br /&gt;
&lt;br /&gt;
Notice that some predicates return values, whereas other predicates do not. A predicate that returns a value is an expression, and the predicate call is often referred to as a &amp;#039;&amp;#039;&amp;#039;function&amp;#039;&amp;#039;&amp;#039; call.  A predicate that does return a value is a formula.&lt;br /&gt;
&lt;br /&gt;
A predicate is invoked by applying arguments to the predicate. The predicate must have a flow-pattern that matches the free/bound state of the arguments.&lt;br /&gt;
&lt;br /&gt;
Most predicates are defined by a set of clauses, but some predicates are built into the language and some are defined externally in a DLL (perhaps in a foreign programming language).&lt;br /&gt;
&lt;br /&gt;
When a predicate is invoked by a predicate call, each clause is executed in turn until one of them &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeeds&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, or there are no more clauses left to execute. If no clause succeeds the predicate &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fails&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
If a clause succeeds and there are more relevant clauses left, a &amp;#039;&amp;#039;&amp;#039;backtrackpoint&amp;#039;&amp;#039;&amp;#039; is created to the next relevant clause.&lt;br /&gt;
&lt;br /&gt;
Thus, a predicate can &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fail&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeed&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, and even &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeed&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; multiple times.&lt;br /&gt;
&lt;br /&gt;
Each clause has a head and optionally a body.&lt;br /&gt;
&lt;br /&gt;
When a predicate is called the clauses are tried in turn (from top to bottom). For each clause the arguments in the head is unified with the arguments from the call. If this unification succeeds then the body of the clause (if present) is executed. The clause &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeeds,&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; if the match of the head &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeeds&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; and the body &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeeds&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;. Otherwise it &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fails&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp() :- qqq(X), write(X), fail.&lt;br /&gt;
&lt;br /&gt;
   qqq(1).&lt;br /&gt;
   qqq(2).&lt;br /&gt;
   qqq(3).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is called it in turn calls &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt;. When &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; is called, it first creates a backtrack point pointing to the second clause. Then the first clause is executed. Hereby the free variable &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; from &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is matched against the number &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;, whereby &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is bound to &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; (i.e. &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;) is written and then &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; cause backtracking to the backtrackpoint. Hereby program control is set to the second clause in &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; and the program state is set back to the state it was in when &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; was first entered, i.e. &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; in &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is unbound again.&lt;br /&gt;
&lt;br /&gt;
Before the actual execution of the second clause in &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; begins a backtrack point to the third clause is created.  The execution then proceeds as it did for &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Unification ===&lt;br /&gt;
&lt;br /&gt;
When a predicate is called the arguments from the call is &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;unified&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; with the terms in the head of each clause.&lt;br /&gt;
&lt;br /&gt;
Unification is the process of binding variables in such a way that two terms become equal, making as few bindings as possible (i.e. leaving as much as possible open for further binding).&lt;br /&gt;
&lt;br /&gt;
Variables can be bound to any kind of terms, including variables or terms containing variables.&lt;br /&gt;
&lt;br /&gt;
Unification is either possible or impossible, i.e. it can &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeed&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fail&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Variables and terms to which they are unified have types, a variable can only be bound to a term of the same type as the variable, or a subtype. When two variables are bound to each other they must therefore have exactly the same type.&lt;br /&gt;
&lt;br /&gt;
Unification takes place (as mentioned) between a predicate call and the clause head. It also takes place when two terms are compared for equality.&lt;br /&gt;
&lt;br /&gt;
{{Example| Consider two terms (of the same type):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;T1 = f1(g(), X, 17, Y, 17)&lt;br /&gt;
T2 = f1(Z, Z, V, U, 43)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will attempt to unify these two terms from left to right (i.e. a left-to-right pre-traversal).&lt;br /&gt;
&lt;br /&gt;
Both &amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt; are &amp;lt;vp&amp;gt;f1/5&amp;lt;/vp&amp;gt; terms, this match. Therefore we attempt to unify each of the arguments from &amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; with each correspondent argument of &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt;. First we must unify &amp;lt;vp&amp;gt;Z&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;, this can be unified if we bind &amp;lt;vp&amp;gt;Z&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;. So far everything is fine and we have the first binding in our unifier:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Z = g()&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next two arguments are &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;Z&amp;lt;/vp&amp;gt;, which already has been bound to &amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;. These two arguments can also be unified if we also bind &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;. So we now have the following contributions to our unifier:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;X = Z = g()&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we must bind &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;17&amp;lt;/vp&amp;gt; and then we must bind &amp;lt;vp&amp;gt;Y&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;U&amp;lt;/vp&amp;gt;. So far everything unifies with the following unifier:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;X = Z = g()&lt;br /&gt;
V = 17&lt;br /&gt;
Y = U&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two unified terms are now equivalent to these terms:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;T1 = f1(g(), g(), 17, Y, 17)&lt;br /&gt;
T2 = f1(g(), g(), 17, Y, 43)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But we have not yet unified the two last arguments, which are &amp;lt;vp&amp;gt;17&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;43&amp;lt;/vp&amp;gt;. No variable binding can make these terms equal, so all in all the unification &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fails&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt; cannot be unified.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
In the example above &amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; could have been a predicate call and &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt; a clause head. But they could also have been two terms that were compared with equal &amp;quot;&amp;lt;vp&amp;gt;=&amp;lt;/vp&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Matching ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Matching&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is the same as unification except that variables can only be bound to grounded terms. A &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;grounded&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; term is a term that does not contain any unbound variables.&lt;br /&gt;
&lt;br /&gt;
It is the flow-patterns that are stated for predicates, that make it possible to use matching rather than full-blown unification.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp(Z, Z, 17).&lt;br /&gt;
   qqq() :-&lt;br /&gt;
      ppp(g(), X, 17).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unification of the &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt;-call with the &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt;-clause is possible with the following unifier:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Z = X = g()&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; have the flow &amp;lt;vp&amp;gt;(i,o,i)&amp;lt;/vp&amp;gt; then the unification is just a match:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt; is input as the first argument, this is bound to &amp;lt;vp&amp;gt;Z&amp;lt;/vp&amp;gt;&lt;br /&gt;
*The second argument in the clause is therefore bound and can thus be output to &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt;, which therefore becomes bound to &amp;#039;&amp;#039;&amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
*finally the third argument is &amp;lt;vp&amp;gt;17&amp;lt;/vp&amp;gt; used as input this number is simply compared to the third argument in the clause.&lt;br /&gt;
&lt;br /&gt;
It is the flow-pattern that makes it possible to predict that the clause does not need real unification.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Nested Function Calls ===&lt;br /&gt;
&lt;br /&gt;
Terms that have to be unified or matched with each other are allowed to contain sub-terms that are actually expressions or function calls that have to be evaluated before the unification/matching can be completed.&lt;br /&gt;
&lt;br /&gt;
The evaluation of such sub-terms is done on a by-need basis.&lt;br /&gt;
&lt;br /&gt;
In a predicate call all input arguments are evaluated before the predicate is called, all output arguments are variables, which does not need evaluation.&lt;br /&gt;
&lt;br /&gt;
Clause heads can also contain terms that have to be evaluated, before matching/unification can be determined.&lt;br /&gt;
&lt;br /&gt;
*all matching/unification that does not require any evaluation is performed before any evaluation is performed;&lt;br /&gt;
*then evaluation corresponding to input arguments is performed one by one left-to-right. Comparing each value to the corresponding input after each evaluation;&lt;br /&gt;
*then the clause body is evaluated;&lt;br /&gt;
*then the output arguments are evaluated (left-to-right);&lt;br /&gt;
*then the return value (if the predicate is a function) is evaluated.&lt;br /&gt;
&lt;br /&gt;
If any of these &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fail&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; then the rest of the evaluation is not carried out.&lt;br /&gt;
&lt;br /&gt;
All in all the base principles are:&lt;br /&gt;
&lt;br /&gt;
*input after other match, before body evaluation&lt;br /&gt;
*output after body evaluation&lt;br /&gt;
*left-to-right&lt;br /&gt;
&lt;br /&gt;
=== Arguments ===&lt;br /&gt;
{{:Language Reference/Terms/Arguments}}&lt;br /&gt;
=== Fact Variable Assignment ===&lt;br /&gt;
&lt;br /&gt;
Assign operator &amp;lt;vp&amp;gt;:=&amp;lt;/vp&amp;gt; is used to assign a new value for a {{lang2|Facts|Fact_Variable_Declarations|fact variable}} &amp;lt;vpbnf&amp;gt;&amp;lt;FactVariable&amp;gt;&amp;lt;/vpbnf&amp;gt;. The &amp;lt;vpbnf&amp;gt;&amp;lt;Term&amp;gt;&amp;lt;/vpbnf&amp;gt; must be evaluated to a value of suitable type (i.e. the same type as the fact variable, or a subtype).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;FactVariableAssignment&amp;gt;:&lt;br /&gt;
    &amp;lt;FactVariable&amp;gt; := &amp;lt;Term&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Facts ===&lt;br /&gt;
&lt;br /&gt;
A fact database contains a number of fully instantiated (grounded) predicate heads corresponding to the facts from the facts section declaration. The facts can be accessed by a predicate call, using the fact name as the predicate name. The predicate call is matched against each fact in turn; succeeding with a possible backtrack point to the next fact each time the predicate call match the fact. When there are no more facts in the fact database then the predicate call fails.&lt;br /&gt;
&lt;br /&gt;
New facts can be &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;asserted&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; using the predicates {{lang2|Built-in_entities|assert|assert/1}}, {{lang2|Built-in_entities|asserta|asserta/1}}, and {{lang2|Built-in_entities|assertz|assertz/1}}. {{lang2|Built-in_entities|assert|assert/1}} is the same as {{lang2|Built-in_entities|assertz|assertz/1}} and it asserts a new fact to the end of the list of facts, whereas {{lang2|Built-in_entities|asserta|asserta/1}} asserts a new fact to the start of the list.&lt;br /&gt;
&lt;br /&gt;
Existing facts can be &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;retracted&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; with the predicate {{lang2|Built-in_entities|retract|retract/1}} and {{lang2|Built-in_entities|retractall|retractAll/1}}. {{lang2|Built-in_entities|retract|retract/1}} retracts the first fact that match the argument binding variables in the argument and leaving a backtrack point so that more facts will potentially be retracted when backtracking.&lt;br /&gt;
&lt;br /&gt;
{{lang2|Built-in_entities|retractall|retractAll/1}} retracts all facts that matches the arguments and succeeds without any binding.&lt;br /&gt;
&lt;br /&gt;
=== Operators ===&lt;br /&gt;
&lt;br /&gt;
Operators are organized in a precedence hierarchy. In the rule below operators in each group have same precedence, which is higher than those below. I.e. the power operator has higher precedence than unary minus and plus, which in turn has higher precedence than the multiplication operators, etc. Parenthesis can be used to circumvent the precedence (and for clarification).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Operator&amp;gt;: one of&lt;br /&gt;
    &amp;lt;PowerOperator&amp;gt;&lt;br /&gt;
    &amp;lt;UnaryOperator&amp;gt;&lt;br /&gt;
    &amp;lt;MultiplicationOperator&amp;gt;&lt;br /&gt;
    &amp;lt;AdditionOperator&amp;gt;&lt;br /&gt;
    &amp;lt;OtherwiseOperator&amp;gt;&lt;br /&gt;
    &amp;lt;RelationOperator&amp;gt;&lt;br /&gt;
    &amp;lt;MustUnifyOperator&amp;gt;&lt;br /&gt;
    &amp;lt;InOperator&amp;gt;&lt;br /&gt;
    &amp;lt;AndOperator&amp;gt;&lt;br /&gt;
    &amp;lt;OrOperator&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;UnaryOperator&amp;gt;: one of&lt;br /&gt;
    - +&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All operators except the &amp;lt;vpbnf&amp;gt;&amp;lt;UnaryOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;&amp;#039;s are binary.  The power operator is right associative, all other operators are left associative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vpbnf&amp;gt;&amp;lt;RelationOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;, &amp;lt;vpbnf&amp;gt;&amp;lt;MustUnifyOperator&amp;gt;&amp;lt;/vpbnf&amp;gt; and &amp;lt;vpbnf&amp;gt;&amp;lt;InOperator&amp;gt;&amp;lt;/vpbnf&amp;gt; have same precedence.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Notice&amp;#039;&amp;#039;&amp;#039; that the placement &amp;lt;vpbnf&amp;gt;&amp;lt;UnaryOperator&amp;gt;&amp;lt;/vpbnf&amp;gt; is not consistent with mathematics, where these operators are at the same level as the &amp;lt;vpbnf&amp;gt;&amp;lt;AdditionalOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;&amp;#039;s.  The difference has no influence of the calculated value, but it allows writing &amp;lt;vp&amp;gt;2*-2&amp;lt;/vp&amp;gt;, where mathematics would require a parenthesis around the second operator &amp;lt;vp&amp;gt;2*(-2)&amp;lt;/vp&amp;gt;.  It also means that &amp;lt;vp&amp;gt;-2*2&amp;lt;/vp&amp;gt; is mmeans (-2)*2 where it would be &amp;lt;vp&amp;gt;-(2*2)&amp;lt;/vp&amp;gt; in mathematics (the resulting value is the same).&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vp&amp;gt;-2^2&amp;lt;/vp&amp;gt; is the same as &amp;lt;vp&amp;gt;-(2^2)&amp;lt;/vp&amp;gt; because ^ has higher precedence than unary minus.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vp&amp;gt;3^2^2&amp;lt;/vp&amp;gt; is the same as &amp;lt;vp&amp;gt;3^(2^2)&amp;lt;/vp&amp;gt; because ^ is right associative.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vp&amp;gt;-2*-3^-4+5&amp;lt;/vp&amp;gt; is the same as &amp;lt;vp&amp;gt;((-2) * (-(3 ^ (-4)))) + 5&amp;lt;/vp&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example| The following term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;7 + 3 * 5 * 13 + 4 + 3 = X / 6 ; A &amp;lt; 7,  p(X)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
has the same meaning as this term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;((((7 + ((3 * 5) * 13)) + 4) + 3) = (X / 6)) ; ((A &amp;lt; 7) , p(X))&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I.e. at outermost level the term is an &amp;quot;&amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;&amp;quot; of two terms, the first of these is a relational (&amp;lt;vp&amp;gt;=&amp;lt;/vp&amp;gt;) term, the second is an &amp;quot;&amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt;&amp;quot; term, etc.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
&lt;br /&gt;
The arithmetic operators are used for arithmetic operations on numbers. They are expressions, which takes expressions as arguments. They have root types as arguments and return universal types as result. (See {{lang2|Domains|Universal_and_Root_Types|Universal and Root types}}.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;PowerOperator&amp;gt;:&lt;br /&gt;
    ^&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;MultiplicationOperator&amp;gt;: one of&lt;br /&gt;
    * / div mod quot rem&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;AdditionOperator&amp;gt;: one of&lt;br /&gt;
    +  -&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Relational Operators ===&lt;br /&gt;
&lt;br /&gt;
The relational operators are formulas, which takes expressions as arguments. Given this nature they are non-associative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;RelationOperator&amp;gt;: one of&lt;br /&gt;
  =   &amp;gt;   &amp;lt;   &amp;gt;=   &amp;lt;=   &amp;lt;&amp;gt;   &amp;gt;&amp;lt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the left term is evaluated, then the right term is evaluated and then the results are compared.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Notice&amp;#039;&amp;#039;&amp;#039; that &amp;lt;vp&amp;gt;&amp;lt;&amp;gt;&amp;lt;/vp&amp;gt; (different) is not the dual operation of = (equal). &amp;lt;vp&amp;gt;&amp;lt;&amp;gt;&amp;lt;/vp&amp;gt; compares two values, whereas &amp;lt;vp&amp;gt;=&amp;lt;/vp&amp;gt; tries to unify two terms (in the general case at least).&lt;br /&gt;
&lt;br /&gt;
The dual to expression &amp;lt;vp&amp;gt;A = B&amp;lt;/vp&amp;gt; is &amp;lt;vp&amp;gt;not (A = B)&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Must Unify Operator ====&lt;br /&gt;
&lt;br /&gt;
The must unify operator is a procedure, which takes expressions as arguments. It is non-associative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;MustUnifyOperator&amp;gt;:&lt;br /&gt;
  ==&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vpbnf&amp;gt;A == B&amp;lt;/vpbnf&amp;gt; unifies &amp;lt;vpbnf&amp;gt;A&amp;lt;/vpbnf&amp;gt; and &amp;lt;vpbnf&amp;gt;B&amp;lt;/vpbnf&amp;gt;; if the unification fails an exception is raised, otherwise the predicate succeeds.  Therefore &amp;lt;vpbnf&amp;gt;A == B&amp;lt;/vpbnf&amp;gt; always succeeds.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    p(L) :-&lt;br /&gt;
        [H|T] == L,&lt;br /&gt;
        ...&amp;lt;/vip&amp;gt;&lt;br /&gt;
&amp;lt;vp&amp;gt;p&amp;lt;/vp&amp;gt; is a procedure. An exception will be raised if it is called with an empty list, because &amp;lt;vp&amp;gt;[H|T]&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt; cannot unify.}}&lt;br /&gt;
&lt;br /&gt;
=== Bitwise and boolean operators ===&lt;br /&gt;
&lt;br /&gt;
The following operators for bitwise operations on &amp;lt;vp&amp;gt;unsigned&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;unsigned64&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;unsignedNative&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;&lt;br /&gt;
A ** B % A and B&lt;br /&gt;
A ++ B % A or B&lt;br /&gt;
A -- B % A and not B&lt;br /&gt;
A ^^ B % A exclusive or B&lt;br /&gt;
~~ A % not A&lt;br /&gt;
A &amp;lt;&amp;lt; N % Shifts the bits in A N times to the left.&lt;br /&gt;
A &amp;gt;&amp;gt; N % Shifts the bits in A N times to the right.&lt;br /&gt;
&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The logical operations (&amp;lt;vp&amp;gt;**&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;++&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;^^&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;~~&amp;lt;/vp&amp;gt;) can also be used on &amp;lt;vp&amp;gt;boolean&amp;lt;/vp&amp;gt; values.&lt;br /&gt;
&lt;br /&gt;
The shift operations discard bits that is shifted out of the number, and shift-in zero bits in the opposite end.&lt;br /&gt;
&lt;br /&gt;
=== Logical Operators ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vpbnf&amp;gt;&amp;lt;AndOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;(s) and &amp;lt;vpbnf&amp;gt;&amp;lt;OrOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;(s) are formulas, which takes formulas as arguments. They are all left associative. The &amp;lt;vp&amp;gt;,&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;and &amp;lt;/vp&amp;gt; are synonyms and so are &amp;lt;vp&amp;gt;; &amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;AndOperator&amp;gt;: one of&lt;br /&gt;
 ,   and&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;OrOperator&amp;gt;: one of&lt;br /&gt;
  ;  or orelse&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== and (,) ====&lt;br /&gt;
&lt;br /&gt;
The evaluation of an &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term &amp;lt;vp&amp;gt;A, B&amp;lt;/vp&amp;gt; proceeds as follows. First the left sub-term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is evaluated. If this evaluation fails, the whole &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term fails. If &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds then the right sub-term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is evaluated. If this evaluation fails, the whole &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term fails, otherwise the &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term succeeds.&lt;br /&gt;
&lt;br /&gt;
Thus the second sub-term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is only evaluated, if the first sub-term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp() :-&lt;br /&gt;
       qqq(), rrr().&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is called it will first call &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; and if &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; succeeds, then it will call &amp;lt;vp&amp;gt;rrr&amp;lt;/vp&amp;gt;. If &amp;lt;vp&amp;gt;rrr&amp;lt;/vp&amp;gt; succeeds, then the &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term and subsequently the whole clause succeeds.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== or (;) ====&lt;br /&gt;
&lt;br /&gt;
The evaluation of an &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt;; &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; proceeds as follows. First a backtrack point to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is created and then the first term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is evaluated. If the evaluation of the first term succeeds, then the whole &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; term succeeds and is left with a backtrack to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt;. If the evaluation of the first term fails, the backtrack point to the second term is activated.&lt;br /&gt;
&lt;br /&gt;
If the backtrack point to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is activated (either because the first term fails, or because something later in the execution invokes the backtrack point), then the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is evaluated and the whole &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; term will succeed if &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
Thus an &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; term can succeed with a backtrack point and the second sub-term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is only evaluated on backtrack.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp() :-&lt;br /&gt;
       (V = 3 or V = 7), write(V), fail.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we have used the keyword &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;, but you can also use semi-colon &amp;lt;vp&amp;gt;;&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is called we first create a backtrack point to the term &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; and then we evaluate &amp;lt;vp&amp;gt;V = 3&amp;lt;/vp&amp;gt;. Thereby &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; will be bound to &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt; we then continue to the &amp;lt;vp&amp;gt;write(V)&amp;lt;/vp&amp;gt; after &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt; has been written &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; is met. &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; always fails so we effectuate the backtrack point leading us to the term &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Backtracking also undo all bindings made since the backtrack point was created. In this case it means that &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; is unbound.&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; is evaluated and &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; becomes bound to &amp;lt;vp&amp;gt;7&amp;lt;/vp&amp;gt; and er continue to the term &amp;lt;vp&amp;gt;write(V)&amp;lt;/vp&amp;gt;, and then &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; is met again, this time there are no more backtrack points &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; fails.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Using parentheses &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; can be nested deeply in clauses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   p(X) = Y :-&lt;br /&gt;
       (X = 1, !, Z = 3 or Z = 7), Y = 2*Z.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We recommend careful usage of &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;. It is mainly intended for usage in test-conditions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   isOutside(X) :-&lt;br /&gt;
       (X &amp;lt; 10 or X &amp;gt; 90), !.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; is a nondeterministic construction, but &amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; can be used as a deterministic pendant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   isOutside(X) :-&lt;br /&gt;
       X &amp;lt; 10 orelse X &amp;gt; 90.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== orelse ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; is a deterministic pendant to the nondeterministic &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;.  &amp;lt;vp&amp;gt;A orelse B&amp;lt;/vp&amp;gt; will succeed if &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds or if &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; succeeds, but it will &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; leave a backtrack point to &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; if &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
The evaluation of an &amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; term &amp;lt;vp&amp;gt;A orelse B&amp;lt;/vp&amp;gt; proceeds as follows: First a backtrack point to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is created and then the first term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is evaluated. If the evaluation of the first term succeeds then the backtrack to the second term (and any backtrack point within it) &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; are removed again and the whole &amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; term succeeds. If the evaluation of the first term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; fails, the backtrack point to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is evaluated.&lt;br /&gt;
&lt;br /&gt;
So an &amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; term does not leave a backtrack point.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp(V) :-&lt;br /&gt;
       (V = 3 orelse V = 7), write(V).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is called we first create a backtrack point to the term &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; and then we evaluate the term &amp;lt;vp&amp;gt;V = 3&amp;lt;/vp&amp;gt;, if &amp;lt;vp&amp;gt;V = 3&amp;lt;/vp&amp;gt; succeeds we remove the backtrack point to &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; again and then continue to &amp;lt;vp&amp;gt;write(V)&amp;lt;/vp&amp;gt;.  If &amp;lt;vp&amp;gt;V = 3&amp;lt;/vp&amp;gt; fails the backtrack point to &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; is effectuated.  If &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; succeeds we continue to &amp;lt;vp&amp;gt;write(V)&amp;lt;/vp&amp;gt;, if &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; fails the entire &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; predicate will fail.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== otherwise ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;otherwise&amp;lt;/vp&amp;gt; is an expression operator; though it has control flow that makes it resemble the logical operators. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;A otherwise B&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an expression (&amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; must be expressions).  If the evaluation of &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds by evaluating to the value VA then &amp;lt;vp&amp;gt;A otherwise B&amp;lt;/vp&amp;gt; evaluates to VA, otherwise (i.e. if the evaluation of &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; fails) then &amp;lt;vp&amp;gt;A otherwise B&amp;lt;/vp&amp;gt; will be the result of evaluating &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;otherwise&amp;lt;/vp&amp;gt; is right associative:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;A otherwise B otherwise C&lt;br /&gt;
=&amp;gt;&lt;br /&gt;
A otherwise (B otherwise C)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It has lower precedence than all other expression operators, but higher than relational operators:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;V &amp;lt; A + tryGet() otherwise 9&lt;br /&gt;
=&amp;gt;&lt;br /&gt;
V &amp;lt; ((A + tryGet()) otherwise 9)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;core&amp;lt;/vp&amp;gt; have been enriched with a predicate &amp;lt;vp&amp;gt;isSome&amp;lt;/vp&amp;gt; for providing default values for &amp;lt;vp&amp;gt;core::optional&amp;lt;/vp&amp;gt; matching:&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;V = isSome(Optional) otherwise 0&amp;lt;/vip&amp;gt;&lt;br /&gt;
If &amp;lt;vp&amp;gt;Optional&amp;lt;/vp&amp;gt; have the form &amp;lt;vp&amp;gt;some(X)&amp;lt;/vp&amp;gt; then &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; will get the value &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; otherwise &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; will get the value &amp;lt;vp&amp;gt;0&amp;lt;/vp&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
==== not ====&lt;br /&gt;
&lt;br /&gt;
The {{lang2|Built-in_entities|not|not/1}} takes a term as the argument. The evaluation of &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; first evaluates &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt;. If &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds, then &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; fails, if &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; fails, then &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
Notice that &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; will never bind any variables, because if &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; succeeds then &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; has failed, and a failed term does not bind anything. If &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; on the other hand fails, it cannot bind any variables either, because then the term itself failed.&lt;br /&gt;
&lt;br /&gt;
Also notice that &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; can never succeed with backtrack points, because if &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; succeeds then &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; have failed, and a failed term cannot contain any backtrack points. This in turn means that all possibilities of success in &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; have been exhausted.&lt;br /&gt;
&lt;br /&gt;
==== cut (!) ====&lt;br /&gt;
&lt;br /&gt;
Cut &amp;quot;&amp;lt;vp&amp;gt;!&amp;lt;/vp&amp;gt;&amp;quot; removes all backtrack points created since the entrance to the current predicate, this means all backtrack points to subsequent clauses, plus backtrack points in predicate calls made in the current clause before the &amp;quot;&amp;lt;vp&amp;gt;!&amp;lt;/vp&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Cut&amp;gt;:&lt;br /&gt;
    !&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp(X) :-&lt;br /&gt;
       X &amp;gt; 7,&lt;br /&gt;
       !,&lt;br /&gt;
       write(&amp;quot;Greater than seven&amp;quot;).&lt;br /&gt;
   ppp(_X) :-&lt;br /&gt;
       write(&amp;quot;Not greater than seven&amp;quot;).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is executed, there is first created a backtrack point to the second clause, and then the first clause is executed. If the test &amp;quot;&amp;lt;vp&amp;gt;X &amp;gt; 7&amp;lt;/vp&amp;gt;&amp;quot; succeeds then the cut &amp;quot;&amp;lt;vp&amp;gt;!&amp;lt;/vp&amp;gt;&amp;quot; is reached. This cut &amp;quot;&amp;lt;vp&amp;gt;!&amp;lt;/vp&amp;gt;&amp;quot; will remove the backtrack point to the second clause.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp() :-&lt;br /&gt;
       qqq(X),&lt;br /&gt;
       X &amp;gt; 7,&lt;br /&gt;
       !,&lt;br /&gt;
       write(&amp;quot;Found one&amp;quot;).&lt;br /&gt;
   ppp() :-&lt;br /&gt;
       write(&amp;quot;Did not find one&amp;quot;).&lt;br /&gt;
clauses&lt;br /&gt;
   qqq(3).&lt;br /&gt;
   qqq(12).&lt;br /&gt;
   qqq(13).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is executed it first creates a backtrack point to the second &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; clause and then &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; is called. The &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; will create a backtrack point to the second &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; clause and execute the first clause, thereby returning the value &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt;. In &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; variable &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is bound to this value and then compared to &amp;lt;vp&amp;gt;7&amp;lt;/vp&amp;gt;. This test fails and, therefore, the control backtracks to the second clause of &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before executing the second clause a new backtrack point to the third clause of &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; is created and then the second clause returns &amp;lt;vp&amp;gt;12&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This time the test against &amp;lt;vp&amp;gt;7&amp;lt;/vp&amp;gt; succeeds and, therefore, the cut is executed. This cut will remove both the backtrack point left in &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; as well as the backtrack point to the second clause of &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== cut Scopes =====&lt;br /&gt;
&lt;br /&gt;
A cut scope is a scope to which the effect of a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is limited. Meaning that if a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is met within a cut scope then only backtrack points within that scope are discarded, while backtrack points outside (i.e. prior to) the cut scope remains.&lt;br /&gt;
&lt;br /&gt;
The clauses of a predicate is a cut scope. Meeting a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; will (at most) discard the backtrack points that was created after entrance to the predicate.  Backtrack points created before entrance to the predicate will remain.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   aaa() :- p1_nd(), qqq().&lt;br /&gt;
   qqq() :- p2_nd(), !.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;aaa&amp;lt;/vp&amp;gt; calls &amp;lt;vp&amp;gt;p1_nd&amp;lt;/vp&amp;gt;, which leaves a backtrack point, and then it calls &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt;. &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; calls &amp;lt;vp&amp;gt;p2_nd&amp;lt;/vp&amp;gt;, which also leaves a backtrack point. Then we meet a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt;. This &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is in the &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt;-scope of the &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; predicate, so it is only the backtrack point in &amp;lt;vp&amp;gt;p2_nd&amp;lt;/vp&amp;gt; which is discarded, the one in &amp;lt;vp&amp;gt;p1_nd&amp;lt;/vp&amp;gt; remains.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Several terms introduce cut scopes (see the respective terms: {{lang2|Terms|List_Comprehension|list comprehension}}, {{lang2|Terms|if-then-else|if-then-else}}, {{lang2|Terms|foreach|foreach}}). Here we will use &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; to illustrate the effect of cut scopes.  Consider the schematic &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;if Cond then T1 else T2 end if&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The condition &amp;lt;vp&amp;gt;Cond&amp;lt;/vp&amp;gt; is a cut-scope, meaning that a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; inside &amp;lt;vp&amp;gt;Cond&amp;lt;/vp&amp;gt; will only have effect inside &amp;lt;vp&amp;gt;Cond&amp;lt;/vp&amp;gt;. &amp;lt;vp&amp;gt;Cut&amp;lt;/vp&amp;gt;s inside &amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt;, on the other hand, have effect outside the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; statement.&lt;br /&gt;
&lt;br /&gt;
Consider this code fragment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;X = getMember_nd([3,1,2]),&lt;br /&gt;
if X = getMember_nd([3,3]), ! then&lt;br /&gt;
   write(X)&lt;br /&gt;
else&lt;br /&gt;
   !&lt;br /&gt;
end if,&lt;br /&gt;
fail&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt; is a nondeterministic predicate. The evaluation of this code will go as follows. First &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is bound to &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt; leaves a backtrack point (so that &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; can later become &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt; and then even &amp;lt;vp&amp;gt;2&amp;lt;/vp&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Then we evaluate the condition in the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term. The first part of this condition succeeds as &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt; is a member of &amp;lt;vp&amp;gt;[3,3]&amp;lt;/vp&amp;gt;. The first part also leaves a backtrack point, so that it can be examined whether &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is a member several times.&lt;br /&gt;
&lt;br /&gt;
Now we meet a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt;. This &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is inside the condition part of an &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; statement, so it only has local effect, meaning that it only discards the backtrack point in the second &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt;, but leaves the backtrack point in the first &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt; predicate.&lt;br /&gt;
&lt;br /&gt;
The whole condition succeeds and we enter the then-part and write out &amp;quot;&amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
After the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; we meet &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt;, which backtracks us to the first &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt; then binds &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;, and leaves a backtrack point (so that &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; can later become &amp;lt;vp&amp;gt;2&amp;lt;/vp&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Then we evaluate the condition in the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term. The first part of this condition fails as &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt; is not a member of &amp;lt;vp&amp;gt;[3,3]&amp;lt;/vp&amp;gt;. So we enter the &amp;lt;vp&amp;gt;else&amp;lt;/vp&amp;gt;-part.&lt;br /&gt;
&lt;br /&gt;
Here we meet a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt;. This &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is in the &amp;lt;vp&amp;gt;else&amp;lt;/vp&amp;gt;-part of a conditional term so it has effect outside the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term and subsequently it discards the backtrack point in the first &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When we meet the &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; after the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term there are no more backtrack points in the code and it will fail. So all in all &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; never becomes &amp;lt;vp&amp;gt;2&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== fail/0 and succeed/0 ====&lt;br /&gt;
&lt;br /&gt;
{{lang2|Built-in_entities|fail|fail/0}} and {{lang2|Built-in_entities|succeed|succeed/0}} are two built-in nullary predicates. {{lang2|Built-in_entities|fail|fail/0}} always fails and {{lang2|Built-in_entities|succeed|succeed/0}} always succeeds, besides this the predicates have no effect.&lt;br /&gt;
&lt;br /&gt;
=== in ===&lt;br /&gt;
{{:Language Reference/Terms/in}}&lt;br /&gt;
=== List Comprehension ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;ListComprehensionTerm&amp;gt; :&lt;br /&gt;
    [ &amp;lt;Term&amp;gt; || &amp;lt;Term&amp;gt; ]&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list comprehension term is a list expression. Consider this schematic term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;[ Exp || Gen ]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt; is (typically) a &amp;lt;vp&amp;gt;nondeterm&amp;lt;/vp&amp;gt; term. &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt; is evaluated for each solution of &amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt;, and the resulting &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt;&amp;#039;s are collected in a list. The &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt; corresponding to the first solution of &amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt; is the first element in the list, etc. This list is the result of the list comprehension term. &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt; must be procedure (or erroneous). Both &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt; are {{lang2|Terms|Cut_Scopes|cut scopes}}.&lt;br /&gt;
&lt;br /&gt;
The list comprehension (normally) reads: The list of &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt;&amp;#039;s such that &amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;[ X || X = getMember_nd(L), X mod 2 = 0 ]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This reads the list of &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt;&amp;#039;s such that &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is in &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is even. So this expression is the even numbers of &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;[ X + 1 || X = getMember_nd(L), X mod 2 = 0 ]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the collected expression is more complex. This makes say the term more awkward:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;the list of (X+1)&amp;#039;s such that ...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This expression again finds the even elements in &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt;, but the resulting list contains all these values incremented.&lt;br /&gt;
&lt;br /&gt;
This term is completely equivalent to this term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;[ Y || X = getMember_nd(L), X mod 2 = 0 , Y = X+1 ]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This term is easier to say:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;The list of Y&amp;#039;s such that (there exists an) X which is member of L, and which is even, and Y is X+1.&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Anonymous Predicates ===&lt;br /&gt;
{{:Language Reference/Terms/Anonymous Predicates}}&lt;br /&gt;
=== Object Member Access ===&lt;br /&gt;
&lt;br /&gt;
Whenever we have a reference to an object, we can access the object member predicates of that object.&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;MemberAccess&amp;gt;:&lt;br /&gt;
    &amp;lt;Term&amp;gt; : &amp;lt;Identifier&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Currently, the {{lang|Terms|term}} must be a variable or a fact variable).&lt;br /&gt;
&lt;br /&gt;
The {{lang2|Lexical_Elements|Identifiers|identifier}} must have the type of the {{lang|Terms|term}}.&lt;br /&gt;
&lt;br /&gt;
Inside an implementation object member predicates can be invoked without reference to an object, because &amp;quot;&amp;lt;vp&amp;gt;This&amp;lt;/vp&amp;gt;&amp;quot; is subsumed, see {{lang2|Basic_Concepts|Scoping_&amp;amp;_Visibility|Scoping}}.&lt;br /&gt;
&lt;br /&gt;
=== Domain, Functor, and Constant Access ===&lt;br /&gt;
&lt;br /&gt;
Domains, functors, and constants are all accessed as if they are class members. Even if they are declared in an interface. This means that when they are qualified, then they are always qualified with class/interface name and a double colon.&lt;br /&gt;
&lt;br /&gt;
=== foreach ===&lt;br /&gt;
{{:Language Reference/Terms/Foreach}}&lt;br /&gt;
=== if-then-else ===&lt;br /&gt;
{{:Language Reference/Terms/If-then-else}}&lt;br /&gt;
=== try-catch-finally ===&lt;br /&gt;
{{:Language Reference/Terms/Try-catch-finally}}&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Terms&amp;diff=4482</id>
		<title>Language Reference/Terms</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Terms&amp;diff=4482"/>
		<updated>2018-07-31T13:21:47Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: /* or (;) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{languageReferenceNavbar|Terms}}&lt;br /&gt;
&lt;br /&gt;
This section describes terms and how execution/evaluation of terms and clauses proceeds.&lt;br /&gt;
&lt;br /&gt;
Semantically, there are two kinds of terms: &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;formulas&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;expressions&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
*Expressions represent values, like the number 7.&lt;br /&gt;
*Formulas represent logical statements, like &amp;quot;the number 7 is greater than the number 3&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Syntactically the two kinds have a huge overlap and therefore the syntax unites the two kinds into &amp;#039;&amp;#039;terms&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The following definition of &amp;lt;vpbnf&amp;gt;&amp;lt;Term&amp;gt;&amp;lt;/vpbnf&amp;gt; is simplified, in the sense that it includes syntactic constructions that are not legal. For example, one cannot legally write &amp;lt;vp&amp;gt;! + !&amp;lt;/vp&amp;gt;. We do however believe that using this simple syntax description in combination with intuitive understanding of language concepts, the type system, and the operator hierarchy described below is better for most purposes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Term&amp;gt;:&lt;br /&gt;
    ( &amp;lt;Term&amp;gt; )&lt;br /&gt;
    &amp;lt;Literal&amp;gt;&lt;br /&gt;
    &amp;lt;Variable&amp;gt;&lt;br /&gt;
    &amp;lt;Identifier&amp;gt;&lt;br /&gt;
    &amp;lt;MemberAccess&amp;gt;&lt;br /&gt;
    &amp;lt;PredicateCall&amp;gt;&lt;br /&gt;
    &amp;lt;PredicateExpression&amp;gt;&lt;br /&gt;
    &amp;lt;UnaryOperator&amp;gt; &amp;lt;Term&amp;gt;&lt;br /&gt;
    &amp;lt;Term&amp;gt; &amp;lt;Operator&amp;gt; &amp;lt;Term&amp;gt;&lt;br /&gt;
    &amp;lt;Cut&amp;gt;&lt;br /&gt;
    &amp;lt;Ellipsis&amp;gt;&lt;br /&gt;
    &amp;lt;FactvariableAssignment&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Backtracking ===&lt;br /&gt;
&lt;br /&gt;
The evaluation of a Prolog program is a search for a &amp;quot;solution&amp;quot; to the goal. Each step in the search for a solution can either &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeed&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fail&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;. At certain points in the program execution there are more than one possible choices for finding a solution. When such a choice point is met a so called &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;backtrack point&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is created. A backtrack point is a recording of the program state plus a pointer to the choice that was not executed. If it turn out that the original choice could not provide the solution (i.e. if it &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fails&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;), then the program will &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;backtrack&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; to the recorded backtrack point. Thereby restoring the program state and pursuing the other choice. The mechanism will be described and exemplified in details in the following sections.&lt;br /&gt;
&lt;br /&gt;
=== Literals ===&lt;br /&gt;
&lt;br /&gt;
Literals have {{lang2|Domains|Universal_Types|universal type}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Literal&amp;gt;:&lt;br /&gt;
   &amp;lt;IntegerLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;RealLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;CharacterLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;StringLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;BinaryLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;ListLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;CompoundDomainLiteral&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also {{lang2|Lexical Elements|Literals|Literals (in Lexical Elements)}}&lt;br /&gt;
&lt;br /&gt;
=== Variables ===&lt;br /&gt;
&lt;br /&gt;
Variables in Visual Prolog are immutable: once they are bound to a value they retain that value, but backtracking can unbind the variable again during the process of restoring a previous program state.&lt;br /&gt;
&lt;br /&gt;
A variable can thus be bound (during unification and matching), if it is already bound then it evaluates to the value that it is bound to.&lt;br /&gt;
&lt;br /&gt;
Variables are names starting with an upper-case letter or with an underscore (_), followed by a sequence of letters (both uppercase and lowercase), digits, and underscore characters (all in all called an UppercaseIdentifier):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Variable&amp;gt;:&lt;br /&gt;
    &amp;lt;UppercaseIdentifer&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following are examples of valid variable names:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;My_first_correct_variable_name&lt;br /&gt;
_&lt;br /&gt;
_Sales_10_11_86&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
while the next two are invalid:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;1stattempt&lt;br /&gt;
second_attempt&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variable consisting of single underscore character (i.e. &amp;lt;vp&amp;gt;_&amp;lt;/vp&amp;gt;) is known as the &amp;#039;&amp;#039;anonymous variable&amp;#039;&amp;#039;. The anonymous variable is used in patterns and bindings where the corresponding value is of no interest and should be ignored.  Every occurrence of the anonymous variable is an independent anonymous variable, i.e. even though the anonymous variable is used several times in a single clause they have no relation to each other.&lt;br /&gt;
&lt;br /&gt;
If variables that starts with an underscore are not anonymous, but they are still intended for values of no interest that should be ignored.  The compiler will issue a warning if the value of such a warning is actually not ignored.&lt;br /&gt;
&lt;br /&gt;
Prolog variables are local to the clause in which it occurs. That is, if two clauses each contain a variable called &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt;, these &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt;-s are two distinct variables.&lt;br /&gt;
&lt;br /&gt;
A variable is said to be &amp;#039;&amp;#039;free&amp;#039;&amp;#039; when it is not yet associated with a term and to be &amp;#039;&amp;#039;bound&amp;#039;&amp;#039; or instantiated when it is unified with a term.&lt;br /&gt;
&lt;br /&gt;
The Visual Prolog compiler does not make a distinction between upper and lower case letters in names, except for the first letter. This means that the two variables &amp;lt;vp&amp;gt;SourceCode&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;SOURCECODE&amp;lt;/vp&amp;gt; are the same.&lt;br /&gt;
&lt;br /&gt;
=== Identifier ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Identifier&amp;gt;:&lt;br /&gt;
    &amp;lt;MemberName&amp;gt;&lt;br /&gt;
    &amp;lt;GlobalScopeMembername&amp;gt;&lt;br /&gt;
    &amp;lt;ScopeQualifiedMemberName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;MemberName&amp;gt;:&lt;br /&gt;
    &amp;lt;LowerCaseIdentifier&amp;gt;&lt;br /&gt;
&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Identifiers are used to refer to named entities (i.e. classes, interfaces, constants, domains, predicates, facts, ...).&lt;br /&gt;
&lt;br /&gt;
An identifier can just be a lower case identifier (i.e. a lowercase letter followed by a sequence of letters, numbers and underscore characters).&lt;br /&gt;
&lt;br /&gt;
Many entities can have the same name.  So it may be necessary or desirable to qualify the lowercase identifier the name of the particular scope of interest, or to state that the name is in the global namespace.&lt;br /&gt;
&lt;br /&gt;
{{Example| These are examples of unqualified identifiers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;integer&lt;br /&gt;
mainExe&lt;br /&gt;
myPredicate&amp;lt;/vip&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Global Entities Access ====&lt;br /&gt;
&lt;br /&gt;
The only global entities, which exist in Visual Prolog, are built-in domains, predicates, and constants. Global names are directly accessible in any scope. There might however exist situations where a global name is shadowed by a local or imported name. In that case the global entity can be qualified with a double colon &amp;#039;&amp;lt;vp&amp;gt;::&amp;lt;/vp&amp;gt;&amp;#039; (without a prefixed class/interface name). The double colon can be used everywhere, but the most important place is where an interface name is used as formal parameter type specifier.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;GlobalScopeMemberName&amp;gt;:&lt;br /&gt;
    :: &amp;lt;MemberName&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Example| The built-in domain &amp;lt;vp&amp;gt;integer&amp;lt;/vp&amp;gt; is defined in the global scope, to avoid ambiguity or stress that it is this particular domains you can use the global scope member name:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;::integer&amp;lt;/vip&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Class/Interface Member Access ====&lt;br /&gt;
&lt;br /&gt;
Static members of classes and interfaces are accessed by means of qualification with the class name (and optionally a namespace prefix):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;ScopeQualifiedMemberName&amp;gt;&lt;br /&gt;
    &amp;lt;NamespacePrefix&amp;gt;-opt &amp;lt;ScopeName&amp;gt; :: &amp;lt;MemberName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;NamespacePrefix&amp;gt;:&lt;br /&gt;
    &amp;lt;NamespaceIdentifier&amp;gt;-opt \&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ScopeName&amp;gt;:&lt;br /&gt;
    &amp;lt;LowercaseIdentifier&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ScopeName is the name of the class or interface that defines/declares the name.&lt;br /&gt;
&lt;br /&gt;
Namespace prefixing is explained in: {{lang2|Namespaces|Referencing names in namespaces|Referencing names in namespaces}}.&lt;br /&gt;
&lt;br /&gt;
Some names can be accessed without qualification, see {{lang2|Basic_Concepts|Scoping_&amp;amp;_Visibility|scoping &amp;amp; visibility}}.&lt;br /&gt;
&lt;br /&gt;
=== Predicate Call ===&lt;br /&gt;
&lt;br /&gt;
A predicate call have the form&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;PredicateCall&amp;gt;:&lt;br /&gt;
     &amp;lt;Term&amp;gt; ( &amp;lt;Term&amp;gt;-comma-sep-list-opt )&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first term must be an expression that evaluates to a value with predicate type.  Typically, it is either the name of a predicate in a class, or an expression that evaluates to a predicate member of an object.&lt;br /&gt;
&lt;br /&gt;
Notice that some predicates return values, whereas other predicates do not. A predicate that returns a value is an expression, and the predicate call is often referred to as a &amp;#039;&amp;#039;&amp;#039;function&amp;#039;&amp;#039;&amp;#039; call.  A predicate that does return a value is a formula.&lt;br /&gt;
&lt;br /&gt;
A predicate is invoked by applying arguments to the predicate. The predicate must have a flow-pattern that matches the free/bound state of the arguments.&lt;br /&gt;
&lt;br /&gt;
Most predicates are defined by a set of clauses, but some predicates are built into the language and some are defined externally in a DLL (perhaps in a foreign programming language).&lt;br /&gt;
&lt;br /&gt;
When a predicate is invoked by a predicate call, each clause is executed in turn until one of them &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeeds&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, or there are no more clauses left to execute. If no clause succeeds the predicate &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fails&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
If a clause succeeds and there are more relevant clauses left, a &amp;#039;&amp;#039;&amp;#039;backtrackpoint&amp;#039;&amp;#039;&amp;#039; is created to the next relevant clause.&lt;br /&gt;
&lt;br /&gt;
Thus, a predicate can &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fail&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeed&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, and even &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeed&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; multiple times.&lt;br /&gt;
&lt;br /&gt;
Each clause has a head and optionally a body.&lt;br /&gt;
&lt;br /&gt;
When a predicate is called the clauses are tried in turn (from top to bottom). For each clause the arguments in the head is unified with the arguments from the call. If this unification succeeds then the body of the clause (if present) is executed. The clause &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeeds,&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; if the match of the head &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeeds&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; and the body &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeeds&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;. Otherwise it &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fails&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp() :- qqq(X), write(X), fail.&lt;br /&gt;
&lt;br /&gt;
   qqq(1).&lt;br /&gt;
   qqq(2).&lt;br /&gt;
   qqq(3).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is called it in turn calls &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt;. When &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; is called, it first creates a backtrack point pointing to the second clause. Then the first clause is executed. Hereby the free variable &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; from &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is matched against the number &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;, whereby &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is bound to &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; (i.e. &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;) is written and then &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; cause backtracking to the backtrackpoint. Hereby program control is set to the second clause in &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; and the program state is set back to the state it was in when &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; was first entered, i.e. &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; in &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is unbound again.&lt;br /&gt;
&lt;br /&gt;
Before the actual execution of the second clause in &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; begins a backtrack point to the third clause is created.  The execution then proceeds as it did for &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Unification ===&lt;br /&gt;
&lt;br /&gt;
When a predicate is called the arguments from the call is &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;unified&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; with the terms in the head of each clause.&lt;br /&gt;
&lt;br /&gt;
Unification is the process of binding variables in such a way that two terms become equal, making as few bindings as possible (i.e. leaving as much as possible open for further binding).&lt;br /&gt;
&lt;br /&gt;
Variables can be bound to any kind of terms, including variables or terms containing variables.&lt;br /&gt;
&lt;br /&gt;
Unification is either possible or impossible, i.e. it can &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeed&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fail&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Variables and terms to which they are unified have types, a variable can only be bound to a term of the same type as the variable, or a subtype. When two variables are bound to each other they must therefore have exactly the same type.&lt;br /&gt;
&lt;br /&gt;
Unification takes place (as mentioned) between a predicate call and the clause head. It also takes place when two terms are compared for equality.&lt;br /&gt;
&lt;br /&gt;
{{Example| Consider two terms (of the same type):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;T1 = f1(g(), X, 17, Y, 17)&lt;br /&gt;
T2 = f1(Z, Z, V, U, 43)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will attempt to unify these two terms from left to right (i.e. a left-to-right pre-traversal).&lt;br /&gt;
&lt;br /&gt;
Both &amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt; are &amp;lt;vp&amp;gt;f1/5&amp;lt;/vp&amp;gt; terms, this match. Therefore we attempt to unify each of the arguments from &amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; with each correspondent argument of &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt;. First we must unify &amp;lt;vp&amp;gt;Z&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;, this can be unified if we bind &amp;lt;vp&amp;gt;Z&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;. So far everything is fine and we have the first binding in our unifier:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Z = g()&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next two arguments are &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;Z&amp;lt;/vp&amp;gt;, which already has been bound to &amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;. These two arguments can also be unified if we also bind &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;. So we now have the following contributions to our unifier:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;X = Z = g()&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we must bind &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;17&amp;lt;/vp&amp;gt; and then we must bind &amp;lt;vp&amp;gt;Y&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;U&amp;lt;/vp&amp;gt;. So far everything unifies with the following unifier:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;X = Z = g()&lt;br /&gt;
V = 17&lt;br /&gt;
Y = U&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two unified terms are now equivalent to these terms:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;T1 = f1(g(), g(), 17, Y, 17)&lt;br /&gt;
T2 = f1(g(), g(), 17, Y, 43)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But we have not yet unified the two last arguments, which are &amp;lt;vp&amp;gt;17&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;43&amp;lt;/vp&amp;gt;. No variable binding can make these terms equal, so all in all the unification &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fails&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt; cannot be unified.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
In the example above &amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; could have been a predicate call and &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt; a clause head. But they could also have been two terms that were compared with equal &amp;quot;&amp;lt;vp&amp;gt;=&amp;lt;/vp&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Matching ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Matching&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is the same as unification except that variables can only be bound to grounded terms. A &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;grounded&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; term is a term that does not contain any unbound variables.&lt;br /&gt;
&lt;br /&gt;
It is the flow-patterns that are stated for predicates, that make it possible to use matching rather than full-blown unification.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp(Z, Z, 17).&lt;br /&gt;
   qqq() :-&lt;br /&gt;
      ppp(g(), X, 17).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unification of the &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt;-call with the &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt;-clause is possible with the following unifier:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Z = X = g()&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; have the flow &amp;lt;vp&amp;gt;(i,o,i)&amp;lt;/vp&amp;gt; then the unification is just a match:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt; is input as the first argument, this is bound to &amp;lt;vp&amp;gt;Z&amp;lt;/vp&amp;gt;&lt;br /&gt;
*The second argument in the clause is therefore bound and can thus be output to &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt;, which therefore becomes bound to &amp;#039;&amp;#039;&amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
*finally the third argument is &amp;lt;vp&amp;gt;17&amp;lt;/vp&amp;gt; used as input this number is simply compared to the third argument in the clause.&lt;br /&gt;
&lt;br /&gt;
It is the flow-pattern that makes it possible to predict that the clause does not need real unification.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Nested Function Calls ===&lt;br /&gt;
&lt;br /&gt;
Terms that have to be unified or matched with each other are allowed to contain sub-terms that are actually expressions or function calls that have to be evaluated before the unification/matching can be completed.&lt;br /&gt;
&lt;br /&gt;
The evaluation of such sub-terms is done on a by-need basis.&lt;br /&gt;
&lt;br /&gt;
In a predicate call all input arguments are evaluated before the predicate is called, all output arguments are variables, which does not need evaluation.&lt;br /&gt;
&lt;br /&gt;
Clause heads can also contain terms that have to be evaluated, before matching/unification can be determined.&lt;br /&gt;
&lt;br /&gt;
*all matching/unification that does not require any evaluation is performed before any evaluation is performed;&lt;br /&gt;
*then evaluation corresponding to input arguments is performed one by one left-to-right. Comparing each value to the corresponding input after each evaluation;&lt;br /&gt;
*then the clause body is evaluated;&lt;br /&gt;
*then the output arguments are evaluated (left-to-right);&lt;br /&gt;
*then the return value (if the predicate is a function) is evaluated.&lt;br /&gt;
&lt;br /&gt;
If any of these &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fail&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; then the rest of the evaluation is not carried out.&lt;br /&gt;
&lt;br /&gt;
All in all the base principles are:&lt;br /&gt;
&lt;br /&gt;
*input after other match, before body evaluation&lt;br /&gt;
*output after body evaluation&lt;br /&gt;
*left-to-right&lt;br /&gt;
&lt;br /&gt;
=== Fact Variable Assignment ===&lt;br /&gt;
&lt;br /&gt;
Assign operator &amp;lt;vp&amp;gt;:=&amp;lt;/vp&amp;gt; is used to assign a new value for a {{lang2|Facts|Fact_Variable_Declarations|fact variable}} &amp;lt;vpbnf&amp;gt;&amp;lt;FactVariable&amp;gt;&amp;lt;/vpbnf&amp;gt;. The &amp;lt;vpbnf&amp;gt;&amp;lt;Term&amp;gt;&amp;lt;/vpbnf&amp;gt; must be evaluated to a value of suitable type (i.e. the same type as the fact variable, or a subtype).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;FactVariableAssignment&amp;gt;:&lt;br /&gt;
    &amp;lt;FactVariable&amp;gt; := &amp;lt;Term&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Facts ===&lt;br /&gt;
&lt;br /&gt;
A fact database contains a number of fully instantiated (grounded) predicate heads corresponding to the facts from the facts section declaration. The facts can be accessed by a predicate call, using the fact name as the predicate name. The predicate call is matched against each fact in turn; succeeding with a possible backtrack point to the next fact each time the predicate call match the fact. When there are no more facts in the fact database then the predicate call fails.&lt;br /&gt;
&lt;br /&gt;
New facts can be &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;asserted&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; using the predicates {{lang2|Built-in_entities|assert|assert/1}}, {{lang2|Built-in_entities|asserta|asserta/1}}, and {{lang2|Built-in_entities|assertz|assertz/1}}. {{lang2|Built-in_entities|assert|assert/1}} is the same as {{lang2|Built-in_entities|assertz|assertz/1}} and it asserts a new fact to the end of the list of facts, whereas {{lang2|Built-in_entities|asserta|asserta/1}} asserts a new fact to the start of the list.&lt;br /&gt;
&lt;br /&gt;
Existing facts can be &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;retracted&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; with the predicate {{lang2|Built-in_entities|retract|retract/1}} and {{lang2|Built-in_entities|retractall|retractAll/1}}. {{lang2|Built-in_entities|retract|retract/1}} retracts the first fact that match the argument binding variables in the argument and leaving a backtrack point so that more facts will potentially be retracted when backtracking.&lt;br /&gt;
&lt;br /&gt;
{{lang2|Built-in_entities|retractall|retractAll/1}} retracts all facts that matches the arguments and succeeds without any binding.&lt;br /&gt;
&lt;br /&gt;
=== Operators ===&lt;br /&gt;
&lt;br /&gt;
Operators are organized in a precedence hierarchy. In the rule below operators in each group have same precedence, which is higher than those below. I.e. the power operator has higher precedence than unary minus and plus, which in turn has higher precedence than the multiplication operators, etc. Parenthesis can be used to circumvent the precedence (and for clarification).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Operator&amp;gt;: one of&lt;br /&gt;
    &amp;lt;PowerOperator&amp;gt;&lt;br /&gt;
    &amp;lt;UnaryOperator&amp;gt;&lt;br /&gt;
    &amp;lt;MultiplicationOperator&amp;gt;&lt;br /&gt;
    &amp;lt;AdditionOperator&amp;gt;&lt;br /&gt;
    &amp;lt;OtherwiseOperator&amp;gt;&lt;br /&gt;
    &amp;lt;RelationOperator&amp;gt;&lt;br /&gt;
    &amp;lt;MustUnifyOperator&amp;gt;&lt;br /&gt;
    &amp;lt;InOperator&amp;gt;&lt;br /&gt;
    &amp;lt;AndOperator&amp;gt;&lt;br /&gt;
    &amp;lt;OrOperator&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;UnaryOperator&amp;gt;: one of&lt;br /&gt;
    - +&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All operators except the &amp;lt;vpbnf&amp;gt;&amp;lt;UnaryOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;&amp;#039;s are binary.  The power operator is right associative, all other operators are left associative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vpbnf&amp;gt;&amp;lt;RelationOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;, &amp;lt;vpbnf&amp;gt;&amp;lt;MustUnifyOperator&amp;gt;&amp;lt;/vpbnf&amp;gt; and &amp;lt;vpbnf&amp;gt;&amp;lt;InOperator&amp;gt;&amp;lt;/vpbnf&amp;gt; have same precedence.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Notice&amp;#039;&amp;#039;&amp;#039; that the placement &amp;lt;vpbnf&amp;gt;&amp;lt;UnaryOperator&amp;gt;&amp;lt;/vpbnf&amp;gt; is not consistent with mathematics, where these operators are at the same level as the &amp;lt;vpbnf&amp;gt;&amp;lt;AdditionalOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;&amp;#039;s.  The difference has no influence of the calculated value, but it allows writing &amp;lt;vp&amp;gt;2*-2&amp;lt;/vp&amp;gt;, where mathematics would require a parenthesis around the second operator &amp;lt;vp&amp;gt;2*(-2)&amp;lt;/vp&amp;gt;.  It also means that &amp;lt;vp&amp;gt;-2*2&amp;lt;/vp&amp;gt; is mmeans (-2)*2 where it would be &amp;lt;vp&amp;gt;-(2*2)&amp;lt;/vp&amp;gt; in mathematics (the resulting value is the same).&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vp&amp;gt;-2^2&amp;lt;/vp&amp;gt; is the same as &amp;lt;vp&amp;gt;-(2^2)&amp;lt;/vp&amp;gt; because ^ has higher precedence than unary minus.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vp&amp;gt;3^2^2&amp;lt;/vp&amp;gt; is the same as &amp;lt;vp&amp;gt;3^(2^2)&amp;lt;/vp&amp;gt; because ^ is right associative.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vp&amp;gt;-2*-3^-4+5&amp;lt;/vp&amp;gt; is the same as &amp;lt;vp&amp;gt;((-2) * (-(3 ^ (-4)))) + 5&amp;lt;/vp&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example| The following term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;7 + 3 * 5 * 13 + 4 + 3 = X / 6 ; A &amp;lt; 7,  p(X)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
has the same meaning as this term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;((((7 + ((3 * 5) * 13)) + 4) + 3) = (X / 6)) ; ((A &amp;lt; 7) , p(X))&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I.e. at outermost level the term is an &amp;quot;&amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;&amp;quot; of two terms, the first of these is a relational (&amp;lt;vp&amp;gt;=&amp;lt;/vp&amp;gt;) term, the second is an &amp;quot;&amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt;&amp;quot; term, etc.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
&lt;br /&gt;
The arithmetic operators are used for arithmetic operations on numbers. They are expressions, which takes expressions as arguments. They have root types as arguments and return universal types as result. (See {{lang2|Domains|Universal_and_Root_Types|Universal and Root types}}.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;PowerOperator&amp;gt;:&lt;br /&gt;
    ^&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;MultiplicationOperator&amp;gt;: one of&lt;br /&gt;
    * / div mod quot rem&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;AdditionOperator&amp;gt;: one of&lt;br /&gt;
    +  -&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Relational Operators ===&lt;br /&gt;
&lt;br /&gt;
The relational operators are formulas, which takes expressions as arguments. Given this nature they are non-associative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;RelationOperator&amp;gt;: one of&lt;br /&gt;
  =   &amp;gt;   &amp;lt;   &amp;gt;=   &amp;lt;=   &amp;lt;&amp;gt;   &amp;gt;&amp;lt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the left term is evaluated, then the right term is evaluated and then the results are compared.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Notice&amp;#039;&amp;#039;&amp;#039; that &amp;lt;vp&amp;gt;&amp;lt;&amp;gt;&amp;lt;/vp&amp;gt; (different) is not the dual operation of = (equal). &amp;lt;vp&amp;gt;&amp;lt;&amp;gt;&amp;lt;/vp&amp;gt; compares two values, whereas &amp;lt;vp&amp;gt;=&amp;lt;/vp&amp;gt; tries to unify two terms (in the general case at least).&lt;br /&gt;
&lt;br /&gt;
The dual to expression &amp;lt;vp&amp;gt;A = B&amp;lt;/vp&amp;gt; is &amp;lt;vp&amp;gt;not (A = B)&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Must Unify Operator ====&lt;br /&gt;
&lt;br /&gt;
The must unify operator is a procedure, which takes expressions as arguments. It is non-associative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;MustUnifyOperator&amp;gt;:&lt;br /&gt;
  ==&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vpbnf&amp;gt;A == B&amp;lt;/vpbnf&amp;gt; unifies &amp;lt;vpbnf&amp;gt;A&amp;lt;/vpbnf&amp;gt; and &amp;lt;vpbnf&amp;gt;B&amp;lt;/vpbnf&amp;gt;; if the unification fails an exception is raised, otherwise the predicate succeeds.  Therefore &amp;lt;vpbnf&amp;gt;A == B&amp;lt;/vpbnf&amp;gt; always succeeds.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    p(L) :-&lt;br /&gt;
        [H|T] == L,&lt;br /&gt;
        ...&amp;lt;/vip&amp;gt;&lt;br /&gt;
&amp;lt;vp&amp;gt;p&amp;lt;/vp&amp;gt; is a procedure. An exception will be raised if it is called with an empty list, because &amp;lt;vp&amp;gt;[H|T]&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt; cannot unify.}}&lt;br /&gt;
&lt;br /&gt;
=== Logical Operators ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vpbnf&amp;gt;&amp;lt;AndOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;(s) and &amp;lt;vpbnf&amp;gt;&amp;lt;OrOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;(s) are formulas, which takes formulas as arguments. They are all left associative. The &amp;lt;vp&amp;gt;,&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;and &amp;lt;/vp&amp;gt; are synonyms and so are &amp;lt;vp&amp;gt;; &amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;AndOperator&amp;gt;: one of&lt;br /&gt;
 ,   and&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;OrOperator&amp;gt;: one of&lt;br /&gt;
  ;  or orelse&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== and (,) ====&lt;br /&gt;
&lt;br /&gt;
The evaluation of an &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term &amp;lt;vp&amp;gt;A, B&amp;lt;/vp&amp;gt; proceeds as follows. First the left sub-term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is evaluated. If this evaluation fails, the whole &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term fails. If &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds then the right sub-term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is evaluated. If this evaluation fails, the whole &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term fails, otherwise the &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term succeeds.&lt;br /&gt;
&lt;br /&gt;
Thus the second sub-term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is only evaluated, if the first sub-term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp() :-&lt;br /&gt;
       qqq(), rrr().&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is called it will first call &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; and if &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; succeeds, then it will call &amp;lt;vp&amp;gt;rrr&amp;lt;/vp&amp;gt;. If &amp;lt;vp&amp;gt;rrr&amp;lt;/vp&amp;gt; succeeds, then the &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term and subsequently the whole clause succeeds.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== or (;) ====&lt;br /&gt;
&lt;br /&gt;
The evaluation of an &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt;; &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; proceeds as follows. First a backtrack point to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is created and then the first term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is evaluated. If the evaluation of the first term succeeds, then the whole &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; term succeeds and is left with a backtrack to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt;. If the evaluation of the first term fails, the backtrack point to the second term is activated.&lt;br /&gt;
&lt;br /&gt;
If the backtrack point to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is activated (either because the first term fails, or because something later in the execution invokes the backtrack point), then the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is evaluated and the whole &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; term will succeed if &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
Thus an &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; term can succeed with a backtrack point and the second sub-term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is only evaluated on backtrack.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp() :-&lt;br /&gt;
       (V = 3 or V = 7), write(V), fail.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we have used the keyword &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;, but you can also use semi-colon &amp;lt;vp&amp;gt;;&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is called we first create a backtrack point to the term &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; and then we evaluate &amp;lt;vp&amp;gt;V = 3&amp;lt;/vp&amp;gt;. Thereby &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; will be bound to &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt; we then continue to the &amp;lt;vp&amp;gt;write(V)&amp;lt;/vp&amp;gt; after &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt; has been written &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; is met. &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; always fails so we effectuate the backtrack point leading us to the term &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Backtracking also undo all bindings made since the backtrack point was created. In this case it means that &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; is unbound.&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; is evaluated and &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; becomes bound to &amp;lt;vp&amp;gt;7&amp;lt;/vp&amp;gt; and er continue to the term &amp;lt;vp&amp;gt;write(V)&amp;lt;/vp&amp;gt;, and then &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; is met again, this time there are no more backtrack points &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; fails.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Using parentheses &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; can be nested deeply in clauses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   p(X) = Y :-&lt;br /&gt;
       (X = 1, !, Z = 3 or Z = 7), Y = 2*Z.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We recommend careful usage of &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;. It is mainly intended for usage in test-conditions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   isOutside(X) :-&lt;br /&gt;
       (X &amp;lt; 10 or X &amp;gt; 90), !.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; is a nondeterministic construction, but &amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; can be used as a deterministic pendant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   isOutside(X) :-&lt;br /&gt;
       X &amp;lt; 10 orelse X &amp;gt; 90.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== orelse ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; is a deterministic pendant to the nondeterministic &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;.  &amp;lt;vp&amp;gt;A orelse B&amp;lt;/vp&amp;gt; will succeed if &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds or if &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; succeeds, but it will &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; leave a backtrack point to &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; if &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
The evaluation of an &amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; term &amp;lt;vp&amp;gt;A orelse B&amp;lt;/vp&amp;gt; proceeds as follows: First a backtrack point to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is created and then the first term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is evaluated. If the evaluation of the first term succeeds then the backtrack to the second term (and any backtrack point within it) &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; are removed again and the whole &amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; term succeeds. If the evaluation of the first term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; fails, the backtrack point to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is evaluated.&lt;br /&gt;
&lt;br /&gt;
So an &amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; term does not leave a backtrack point.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp(V) :-&lt;br /&gt;
       (V = 3 orelse V = 7), write(V).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is called we first create a backtrack point to the term &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; and then we evaluate the term &amp;lt;vp&amp;gt;V = 3&amp;lt;/vp&amp;gt;, if &amp;lt;vp&amp;gt;V = 3&amp;lt;/vp&amp;gt; succeeds we remove the backtrack point to &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; again and then continue to &amp;lt;vp&amp;gt;write(V)&amp;lt;/vp&amp;gt;.  If &amp;lt;vp&amp;gt;V = 3&amp;lt;/vp&amp;gt; fails the backtrack point to &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; is effectuated.  If &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; succeeds we continue to &amp;lt;vp&amp;gt;write(V)&amp;lt;/vp&amp;gt;, if &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; fails the entire &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; predicate will fail.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== otherwise ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;otherwise&amp;lt;/vp&amp;gt; is an expression operator; though it has control flow that makes it resemble the logical operators. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;A otherwise B&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an expression (&amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; must be expressions).  If the evaluation of &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds by evaluating to the value VA then &amp;lt;vp&amp;gt;A otherwise B&amp;lt;/vp&amp;gt; evaluates to VA, otherwise (i.e. if the evaluation of &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; fails) then &amp;lt;vp&amp;gt;A otherwise B&amp;lt;/vp&amp;gt; will be the result of evaluating &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;otherwise&amp;lt;/vp&amp;gt; is right associative:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;A otherwise B otherwise C&lt;br /&gt;
=&amp;gt;&lt;br /&gt;
A otherwise (B otherwise C)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It has lower precedence than all other expression operators, but higher than relational operators:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;V &amp;lt; A + tryGet() otherwise 9&lt;br /&gt;
=&amp;gt;&lt;br /&gt;
V &amp;lt; ((A + tryGet()) otherwise 9)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;core&amp;lt;/vp&amp;gt; have been enriched with a predicate &amp;lt;vp&amp;gt;isSome&amp;lt;/vp&amp;gt; for providing default values for &amp;lt;vp&amp;gt;core::optional&amp;lt;/vp&amp;gt; matching:&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;V = isSome(Optional) otherwise 0&amp;lt;/vip&amp;gt;&lt;br /&gt;
If &amp;lt;vp&amp;gt;Optional&amp;lt;/vp&amp;gt; have the form &amp;lt;vp&amp;gt;some(X)&amp;lt;/vp&amp;gt; then &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; will get the value &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; otherwise &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; will get the value &amp;lt;vp&amp;gt;0&amp;lt;/vp&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
==== not ====&lt;br /&gt;
&lt;br /&gt;
The {{lang2|Built-in_entities|not|not/1}} takes a term as the argument. The evaluation of &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; first evaluates &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt;. If &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds, then &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; fails, if &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; fails, then &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
Notice that &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; will never bind any variables, because if &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; succeeds then &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; has failed, and a failed term does not bind anything. If &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; on the other hand fails, it cannot bind any variables either, because then the term itself failed.&lt;br /&gt;
&lt;br /&gt;
Also notice that &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; can never succeed with backtrack points, because if &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; succeeds then &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; have failed, and a failed term cannot contain any backtrack points. This in turn means that all possibilities of success in &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; have been exhausted.&lt;br /&gt;
&lt;br /&gt;
==== Cut ====&lt;br /&gt;
&lt;br /&gt;
Cut &amp;quot;&amp;lt;vp&amp;gt;!&amp;lt;/vp&amp;gt;&amp;quot; removes all backtrack points created since the entrance to the current predicate, this means all backtrack points to subsequent clauses, plus backtrack points in predicate calls made in the current clause before the &amp;quot;&amp;lt;vp&amp;gt;!&amp;lt;/vp&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Cut&amp;gt;:&lt;br /&gt;
    !&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp(X) :-&lt;br /&gt;
       X &amp;gt; 7,&lt;br /&gt;
       !,&lt;br /&gt;
       write(&amp;quot;Greater than seven&amp;quot;).&lt;br /&gt;
   ppp(_X) :-&lt;br /&gt;
       write(&amp;quot;Not greater than seven&amp;quot;).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is executed, there is first created a backtrack point to the second clause, and then the first clause is executed. If the test &amp;quot;&amp;lt;vp&amp;gt;X &amp;gt; 7&amp;lt;/vp&amp;gt;&amp;quot; succeeds then the cut &amp;quot;&amp;lt;vp&amp;gt;!&amp;lt;/vp&amp;gt;&amp;quot; is reached. This cut &amp;quot;&amp;lt;vp&amp;gt;!&amp;lt;/vp&amp;gt;&amp;quot; will remove the backtrack point to the second clause.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp() :-&lt;br /&gt;
       qqq(X),&lt;br /&gt;
       X &amp;gt; 7,&lt;br /&gt;
       !,&lt;br /&gt;
       write(&amp;quot;Found one&amp;quot;).&lt;br /&gt;
   ppp() :-&lt;br /&gt;
       write(&amp;quot;Did not find one&amp;quot;).&lt;br /&gt;
clauses&lt;br /&gt;
   qqq(3).&lt;br /&gt;
   qqq(12).&lt;br /&gt;
   qqq(13).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is executed it first creates a backtrack point to the second &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; clause and then &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; is called. The &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; will create a backtrack point to the second &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; clause and execute the first clause, thereby returning the value &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt;. In &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; variable &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is bound to this value and then compared to &amp;lt;vp&amp;gt;7&amp;lt;/vp&amp;gt;. This test fails and, therefore, the control backtracks to the second clause of &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before executing the second clause a new backtrack point to the third clause of &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; is created and then the second clause returns &amp;lt;vp&amp;gt;12&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This time the test against &amp;lt;vp&amp;gt;7&amp;lt;/vp&amp;gt; succeeds and, therefore, the cut is executed. This cut will remove both the backtrack point left in &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; as well as the backtrack point to the second clause of &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== Cut Scopes =====&lt;br /&gt;
&lt;br /&gt;
A cut scope is a scope to which the effect of a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is limited. Meaning that if a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is met within a cut scope then only backtrack points within that scope are discarded, while backtrack points outside (i.e. prior to) the cut scope remains.&lt;br /&gt;
&lt;br /&gt;
The clauses of a predicate is a cut scope. Meeting a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; will (at most) discard the backtrack points that was created after entrance to the predicate.  Backtrack points created before entrance to the predicate will remain.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   aaa() :- p1_nd(), qqq().&lt;br /&gt;
   qqq() :- p2_nd(), !.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;aaa&amp;lt;/vp&amp;gt; calls &amp;lt;vp&amp;gt;p1_nd&amp;lt;/vp&amp;gt;, which leaves a backtrack point, and then it calls &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt;. &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; calls &amp;lt;vp&amp;gt;p2_nd&amp;lt;/vp&amp;gt;, which also leaves a backtrack point. Then we meet a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt;. This &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is in the &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt;-scope of the &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; predicate, so it is only the backtrack point in &amp;lt;vp&amp;gt;p2_nd&amp;lt;/vp&amp;gt; which is discarded, the one in &amp;lt;vp&amp;gt;p1_nd&amp;lt;/vp&amp;gt; remains.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Several terms introduce cut scopes (see the respective terms: {{lang2|Terms|List_Comprehension|list comprehension}}, {{lang2|Terms|if-then-else|if-then-else}}, {{lang2|Terms|foreach|foreach}}). Here we will use &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; to illustrate the effect of cut scopes.  Consider the schematic &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;if Cond then T1 else T2 end if&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The condition &amp;lt;vp&amp;gt;Cond&amp;lt;/vp&amp;gt; is a cut-scope, meaning that a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; inside &amp;lt;vp&amp;gt;Cond&amp;lt;/vp&amp;gt; will only have effect inside &amp;lt;vp&amp;gt;Cond&amp;lt;/vp&amp;gt;. &amp;lt;vp&amp;gt;Cut&amp;lt;/vp&amp;gt;s inside &amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt;, on the other hand, have effect outside the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; statement.&lt;br /&gt;
&lt;br /&gt;
Consider this code fragment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;X = getMember_nd([3,1,2]),&lt;br /&gt;
if X = getMember_nd([3,3]), ! then&lt;br /&gt;
   write(X)&lt;br /&gt;
else&lt;br /&gt;
   !&lt;br /&gt;
end if,&lt;br /&gt;
fail&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt; is a nondeterministic predicate. The evaluation of this code will go as follows. First &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is bound to &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt; leaves a backtrack point (so that &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; can later become &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt; and then even &amp;lt;vp&amp;gt;2&amp;lt;/vp&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Then we evaluate the condition in the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term. The first part of this condition succeeds as &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt; is a member of &amp;lt;vp&amp;gt;[3,3]&amp;lt;/vp&amp;gt;. The first part also leaves a backtrack point, so that it can be examined whether &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is a member several times.&lt;br /&gt;
&lt;br /&gt;
Now we meet a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt;. This &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is inside the condition part of an &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; statement, so it only has local effect, meaning that it only discards the backtrack point in the second &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt;, but leaves the backtrack point in the first &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt; predicate.&lt;br /&gt;
&lt;br /&gt;
The whole condition succeeds and we enter the then-part and write out &amp;quot;&amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
After the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; we meet &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt;, which backtracks us to the first &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt; then binds &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;, and leaves a backtrack point (so that &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; can later become &amp;lt;vp&amp;gt;2&amp;lt;/vp&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Then we evaluate the condition in the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term. The first part of this condition fails as &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt; is not a member of &amp;lt;vp&amp;gt;[3,3]&amp;lt;/vp&amp;gt;. So we enter the &amp;lt;vp&amp;gt;else&amp;lt;/vp&amp;gt;-part.&lt;br /&gt;
&lt;br /&gt;
Here we meet a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt;. This &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is in the &amp;lt;vp&amp;gt;else&amp;lt;/vp&amp;gt;-part of a conditional term so it has effect outside the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term and subsequently it discards the backtrack point in the first &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When we meet the &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; after the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term there are no more backtrack points in the code and it will fail. So all in all &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; never becomes &amp;lt;vp&amp;gt;2&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== fail/0 and succeed/0 ====&lt;br /&gt;
&lt;br /&gt;
{{lang2|Built-in_entities|fail|fail/0}} and {{lang2|Built-in_entities|succeed|succeed/0}} are two built-in nullary predicates. {{lang2|Built-in_entities|fail|fail/0}} always fails and {{lang2|Built-in_entities|succeed|succeed/0}} always succeeds, besides this the predicates have no effect.&lt;br /&gt;
&lt;br /&gt;
=== in ===&lt;br /&gt;
{{:Language Reference/Terms/in}}&lt;br /&gt;
=== List Comprehension ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;ListComprehensionTerm&amp;gt; :&lt;br /&gt;
    [ &amp;lt;Term&amp;gt; || &amp;lt;Term&amp;gt; ]&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list comprehension term is a list expression. Consider this schematic term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;[ Exp || Gen ]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt; is (typically) a &amp;lt;vp&amp;gt;nondeterm&amp;lt;/vp&amp;gt; term. &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt; is evaluated for each solution of &amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt;, and the resulting &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt;&amp;#039;s are collected in a list. The &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt; corresponding to the first solution of &amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt; is the first element in the list, etc. This list is the result of the list comprehension term. &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt; must be procedure (or erroneous). Both &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt; are {{lang2|Terms|Cut_Scopes|cut scopes}}.&lt;br /&gt;
&lt;br /&gt;
The list comprehension (normally) reads: The list of &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt;&amp;#039;s such that &amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;[ X || X = getMember_nd(L), X mod 2 = 0 ]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This reads the list of &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt;&amp;#039;s such that &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is in &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is even. So this expression is the even numbers of &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;[ X + 1 || X = getMember_nd(L), X mod 2 = 0 ]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the collected expression is more complex. This makes say the term more awkward:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;the list of (X+1)&amp;#039;s such that ...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This expression again finds the even elements in &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt;, but the resulting list contains all these values incremented.&lt;br /&gt;
&lt;br /&gt;
This term is completely equivalent to this term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;[ Y || X = getMember_nd(L), X mod 2 = 0 , Y = X+1 ]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This term is easier to say:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;The list of Y&amp;#039;s such that (there exists an) X which is member of L, and which is even, and Y is X+1.&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Anonymous Predicates ===&lt;br /&gt;
{{:Language Reference/Terms/Anonymous Predicates}}&lt;br /&gt;
=== Object Member Access ===&lt;br /&gt;
&lt;br /&gt;
Whenever we have a reference to an object, we can access the object member predicates of that object.&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;MemberAccess&amp;gt;:&lt;br /&gt;
    &amp;lt;Term&amp;gt; : &amp;lt;Identifier&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Currently, the {{lang|Terms|term}} must be a variable or a fact variable).&lt;br /&gt;
&lt;br /&gt;
The {{lang2|Lexical_Elements|Identifiers|identifier}} must have the type of the {{lang|Terms|term}}.&lt;br /&gt;
&lt;br /&gt;
Inside an implementation object member predicates can be invoked without reference to an object, because &amp;quot;&amp;lt;vp&amp;gt;This&amp;lt;/vp&amp;gt;&amp;quot; is subsumed, see {{lang2|Basic_Concepts|Scoping_&amp;amp;_Visibility|Scoping}}.&lt;br /&gt;
&lt;br /&gt;
=== Domain, Functor, and Constant Access ===&lt;br /&gt;
&lt;br /&gt;
Domains, functors, and constants are all accessed as if they are class members. Even if they are declared in an interface. This means that when they are qualified, then they are always qualified with class/interface name and a double colon.&lt;br /&gt;
&lt;br /&gt;
=== foreach ===&lt;br /&gt;
{{:Language Reference/Terms/Foreach}}&lt;br /&gt;
=== if-then-else ===&lt;br /&gt;
{{:Language Reference/Terms/If-then-else}}&lt;br /&gt;
=== try-catch-finally ===&lt;br /&gt;
{{:Language Reference/Terms/Try-catch-finally}}&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Objects_and_Polymorphism&amp;diff=4412</id>
		<title>Language Reference/Objects and Polymorphism</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Objects_and_Polymorphism&amp;diff=4412"/>
		<updated>2017-07-10T09:36:38Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: /* Parametric Polymorphism */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{languageReferenceNavbar|Generic Interfaces and Classes}}&lt;br /&gt;
&lt;br /&gt;
The programming language Visual Prolog has gone through a huge development in the latest years, and this will also continue in future. Most noticeable is the shift to object-orientation, and the introduction of parametric polymorphism. In this paper we will explain the reason for introducing these features. Examples will be used to illustrate how these facilities can help to tackle the increasing complexity and size of software.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
&lt;br /&gt;
While Prolog has many great virtues, one must remember that it is from the IT-bronze-age, and it would be silly to think that it would stay contemporary after three decades or more, especially considering the speed with, which the IT-world has evolved since then. Back then you could write an amazing Prolog program that described how to get a cabbage, a goat, a wolf and a farmer across a river in a little boat without anybody eating anybody. You can still write such programs just as easily (see [[Farmer, Wolf, Goat and Cabbage]]), but they are just not that amazing anymore. Show it to your children and they will immediately ask why the solution is not an animation, and explain that there are millions of much more advanced programs one click away on the Internet already.&lt;br /&gt;
&lt;br /&gt;
Programs today must be more advanced than yesterday.  They also have to live and interact with a much larger world than yesterday.  And this is an ongoing story.&lt;br /&gt;
&lt;br /&gt;
Many attempts has been made to help tackle these challenges; we have chosen to add the elements that we believe are the winners to Visual Prolog. These are especially object-orientation and parametric polymorphism, but there are also other new elements especially taken from the functional programming world.&lt;br /&gt;
&lt;br /&gt;
=== Goals and Means ===&lt;br /&gt;
&lt;br /&gt;
The goals of the language update is to provide better means for creating and maintaining more complex programs for more complex surroundings.&lt;br /&gt;
&lt;br /&gt;
==== Simplicity ====&lt;br /&gt;
&lt;br /&gt;
Humans are better to dealing with simple things than complex things, so one important way to deal with complexity is to reduce it to something simpler, especially by using &amp;quot;structure&amp;quot; to organize the complexity.&lt;br /&gt;
&lt;br /&gt;
The main &amp;quot;trick&amp;quot; is the &amp;#039;&amp;#039;divide and conquer &amp;#039;&amp;#039; principle: Divide the original problem into separate sub-problems that can be solved individually. I.e., the solution to the overall problem consists of a number of sub-solutions and something that combines these into the overall solution.&lt;br /&gt;
&lt;br /&gt;
==== Maintainability ====&lt;br /&gt;
&lt;br /&gt;
For software it is often not enough to solve a problem, we must also be able to maintain and extend the solution in an evolving world.  So it is important that the used methods not only solve the problem, but also result in a program that can be maintained. Here it is important that the program is understandable and especially that the &amp;#039;&amp;#039;divides&amp;#039;&amp;#039; are visible and clear in the program.&lt;br /&gt;
&lt;br /&gt;
==== Reuse and sharing ====&lt;br /&gt;
&lt;br /&gt;
When you divide problems into sub-problems, perhaps repeatedly, you will sometimes see similar sub-problems. Then it would of course be nice to short cut by reusing a similar solution. Such a solution can be adopted into the new context, but there are two ways this can happen. We can make a copy and update it to its new purpose, or we can try to share the code between the two problems.&lt;br /&gt;
&lt;br /&gt;
The latter is clearly the hardest and only makes sense if both pieces of software are still maintained. But in that case you will have the advantage that maintenance made in one context is also shared with the other context.&lt;br /&gt;
&lt;br /&gt;
==== Flexibility ====&lt;br /&gt;
&lt;br /&gt;
It is also desirable that your software is flexible. You may for example need to deliver several variants of your software to different customers. Or you may need to reconfigure the software to a changed context.  Also some of your shared sub-solutions may need to go into contexts that are not completely the same.&lt;br /&gt;
&lt;br /&gt;
==== Power ====&lt;br /&gt;
&lt;br /&gt;
Finally, it is of course desirable if language extensions add additional programming power. For example, by simplifying the code necessary to tackle certain standard &amp;quot;issues&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Polymorphism ===&lt;br /&gt;
&lt;br /&gt;
Visual Prolog has been extended with many language features that support the goals above, but it is still up to the programmer to apply these features such that the goals are achieved. Here we will focus on understanding and using polymorphism.&lt;br /&gt;
&lt;br /&gt;
The object-system in Visual Prolog gives so called &amp;#039;&amp;#039; subsumption polymorphism&amp;#039;&amp;#039;, and from Visual Prolog 7.0 you also have &amp;#039;&amp;#039; parametric polymorphism&amp;#039;&amp;#039;. Polymorphism is especially well-suited for &amp;#039;&amp;#039; divide and conquer&amp;#039;&amp;#039; that supports &amp;#039;&amp;#039;sharing&amp;#039;&amp;#039; of code.&lt;br /&gt;
&lt;br /&gt;
==== Subsumption polymorphism ====&lt;br /&gt;
&lt;br /&gt;
An object is a closed entity that carries state and code. The object provides an interface through which the surroundings can interact with the object. The object can also interact with other objects through their interfaces.&lt;br /&gt;
&lt;br /&gt;
Each interface has an explicit definition in the source code. The definition effectively consists of a name and a number of predicate declarations.&lt;br /&gt;
&lt;br /&gt;
Let us assume that we want an object through which some administrative system can report salary. In an oversimplified world, such an object might have this interface:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface salarySystem&lt;br /&gt;
predicates&lt;br /&gt;
    salary : (string Name,  real Amount).&lt;br /&gt;
end interface salarySystem&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An object with this interface will allow you to report an Amount for a person (identified by Name).&lt;br /&gt;
&lt;br /&gt;
The  salarySystem interface defines a data type that can be used in the program. The main salary reporting predicate in the application might be declared like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    reportSalary : (salarySystem SalarySystem).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the sake of the example, we simply hard code a little salary reporting like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    reportSalary(SalarySystem) :-&lt;br /&gt;
        SalarySystem:salary(&amp;quot;John D&amp;quot;, 135.12),&lt;br /&gt;
        SalarySystem:salary(&amp;quot;Elvis P&amp;quot;, 117.00).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will of course also need to implement our salary system objects, and that is where the subsumption polymorphism comes in play.  The thing is that our customers of course use a lot of different salary systems, which must receive input in many different formats and using many different media. Objects are implemented by classes, and the fortunate thing is that many different classes can implement the same interface. Objects produced by any such class can be used by the reportSalary predicate.  Thus, the reportSalary predicate is &amp;#039;&amp;#039;polymorphic&amp;#039;&amp;#039; because the salarySystem type &amp;#039;&amp;#039; subsumes&amp;#039;&amp;#039; all the different implementations of the interface. To deal with the ACME salary system we declare this class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class acme : salarySystem&lt;br /&gt;
end class acme&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The declaration simply says that acme is a class that produces objects of type salarySystem. The class also needs an implementation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;implement acme&lt;br /&gt;
constants&lt;br /&gt;
    fmt = &amp;quot;SAL:%&amp;gt;&amp;gt;&amp;gt;%\n&amp;quot;.&lt;br /&gt;
clauses&lt;br /&gt;
    salary(Name, Amount) :-&lt;br /&gt;
        stdio::writef(fmt, Name, Amount).&lt;br /&gt;
end implement  acme&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To illustrate the polymorphism, we will also implement the integration to the O&amp;#039;Salery system. Again we declare and implement a class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class oSalary : salarySystem&lt;br /&gt;
end class oSalary&lt;br /&gt;
&lt;br /&gt;
implement oSalary&lt;br /&gt;
constants&lt;br /&gt;
    fmt = &amp;quot;&amp;lt;salary name=\&amp;quot;%\&amp;quot; wage=\&amp;quot;%\&amp;quot; /&amp;gt;\n&amp;quot;.&lt;br /&gt;
clauses&lt;br /&gt;
    salary(Name, Amount) :-&lt;br /&gt;
        stdio::writef(fmt, Name, Amount).&lt;br /&gt;
end implement oSalary&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now let us try our two salary system integrations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    test():-&lt;br /&gt;
        ACME = acme::new(),&lt;br /&gt;
        reportSalary(ACME),&lt;br /&gt;
        Osalery = oSalary::new(),&lt;br /&gt;
        reportSalary(Osalery).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the  test predicate above, we create one of each salary systems and report salary to them. The result looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;SAL:John D&amp;gt;&amp;gt;&amp;gt;135.12&lt;br /&gt;
SAL:Elvis P&amp;gt;&amp;gt;&amp;gt;117&lt;br /&gt;
&amp;lt;salary name=&amp;quot;John D&amp;quot; wage=&amp;quot;135.12&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;salary name=&amp;quot;Elvis P&amp;quot; wage=&amp;quot;117&amp;quot; /&amp;gt;&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example, the difference was not that big, but we might also have placed the result in a database, used a foreign API, called a WEB service or whatever.&lt;br /&gt;
&lt;br /&gt;
The solution above uses the divide and conquer principle to separate the reporting in a vendor independent part and a vendor specific part. In this case the vendor independent part also deals with the company level in the reporting, were as the vendor dependent part only deals with the person level.&lt;br /&gt;
&lt;br /&gt;
We have used subsumption polymorphism to provide the flexibility to deal with many different salary systems in a seamless way. In real world, this may not be as simple as here though. The key to success is that the salarySystem interface is a sufficiently powerful abstraction/generalization of &amp;#039;&amp;#039;all&amp;#039;&amp;#039; the relevant salary systems. It may for example be necessary to provide several different ways to identify persons in the salary predicate.  Different salary systems can then use the identification method, which is appropriate for them and ignore the rest.&lt;br /&gt;
&lt;br /&gt;
The  reportSalary predicate is &amp;#039;&amp;#039;shared&amp;#039;&amp;#039; across different salary systems.  The sharing is a high-level domain specific sharing, within the same application or variants of it.&lt;br /&gt;
&lt;br /&gt;
Visual Prolog also has another kind of subsumption polymorphism: Predicate values. A predicate value is a predicate that is bound to variables, transferred as parameter and/or stored in facts. Again, the polymorphism comes from a type that &amp;#039;&amp;#039;subsumes&amp;#039;&amp;#039; many different implementations.&lt;br /&gt;
&lt;br /&gt;
As an example, PFC uses predicate values in its heavily used &amp;#039;&amp;#039;event notification scheme&amp;#039;&amp;#039;. A scheme that can of course also be used outside PFC.&lt;br /&gt;
&lt;br /&gt;
The event notification scheme has two kinds of actors: the event source and the event listener. There is one event source, but there can be any number of listeners. The event source offers predicates for registering and deregistering event listeners. When the event occurs all registered listeners are notified.&lt;br /&gt;
&lt;br /&gt;
The interesting thing is that the event listener is a predicate, meaning that the notification will immediately execute code. In addition, due to the subsumption polymorphism each listener can have its own implementation and thus perform quite different actions.&lt;br /&gt;
&lt;br /&gt;
A very important property of predicate values is that they can be &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;object&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; predicates, and that these have access to the object state to which they belong.&lt;br /&gt;
&lt;br /&gt;
We shall not describe the event notification scheme in details here, though it is good to understand. The reader is encouraged to study the concept in PFC (look for &amp;#039;&amp;#039;addXxxxListener&amp;#039;&amp;#039;). However, the use of predicate values will be exercised in the example in the job-scheduling example in the end of this paper.&lt;br /&gt;
&lt;br /&gt;
==== Parametric Polymorphism ====&lt;br /&gt;
&lt;br /&gt;
Like for subsumption polymorphism the purpose of &amp;#039;&amp;#039;parametric&amp;#039;&amp;#039; polymorphism is to use the same code for many things. However, where subsumption polymorphism is mainly about supplying different implementations to the same context, parametric polymorphism is mainly about using the same implementation in different contexts.&lt;br /&gt;
&lt;br /&gt;
Let us start with a very simple example, to introduce the concepts. We will implement a function, which takes the list as argument and returns the elements one by one (non-deterministically).&lt;br /&gt;
&lt;br /&gt;
In Visual Prolog the list domain is a polymorphic domain: If  Elem is a type/domain then Elem* the list domain of Elem.  The new thing is that &amp;#039;&amp;#039;parameters&amp;#039;&amp;#039; like Elem and type expressions like Elem* can be used in declarations, and that the resulting declaration will cover any instantiation of such parameters.&lt;br /&gt;
&lt;br /&gt;
Therefore we can declare our getMember_nd function like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicates&lt;br /&gt;
    getMember_nd : (Elem* List) -&amp;gt; Elem Value&lt;br /&gt;
        nondeterm.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This declaration says that getMember_nd is a function, which takes a list of Elem argument and returns an Elem, where Elem is any domain/type.&lt;br /&gt;
&lt;br /&gt;
The implementation is straightforward:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    getMember_nd([V|_L]) = V.&lt;br /&gt;
    getMember_nd([_V|L]) = getMember_nd(L).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Without further notice getMember_nd can be used on any list kind:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    run():-&lt;br /&gt;
        console::init(),&lt;br /&gt;
        L = [[1,2,3], [7,-7], [9,4,5]],&lt;br /&gt;
        foreach X = list::getMember_nd(L) do&lt;br /&gt;
            stdio::writef(&amp;quot;X = %\n&amp;quot;, X)&lt;br /&gt;
        end foreach.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here Elem is integer* (i.e. list of integers). The output looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;X = [1,2,3]&lt;br /&gt;
X = [7,-7]&lt;br /&gt;
X = [9,4,5]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list domain is a predefined polymorphic domain. But you can also define polymorphic domains yourself. As an example we can create a &amp;#039;&amp;#039;priority queue&amp;#039;&amp;#039;; sometimes called a heap. Let me warn you, the implementation I will use here is not particularly efficient; it is just simple.&lt;br /&gt;
&lt;br /&gt;
The idea of the priority queue is that we can insert some Data with a  Priority, later we can then retrieve the data with lowest Priority.  It sounds a bit strange, that it is the one with the lowest Priority that is retrieved; but that is how it normally works. I assume that it comes from the idea of first priority, second priority, etc. where smaller number means higher priority.&lt;br /&gt;
&lt;br /&gt;
Anyway, in this case we want to implement the queue as a list of tuple&amp;#039;s, each tuple has two elements the first is the Priority and the second is the Data.  Furthermore, we will keep the list sorted after Priority (i.e. an invariant), such that the smallest element is always first in the list.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;tuple&amp;#039;&amp;#039;&amp;#039; is already defined in Visual Prolog its definition looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;domains&lt;br /&gt;
    tuple{T1, T2} = tuple(T1, T2).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are also tuple&amp;#039;s with other arities, but we only need the pair. This is an example of a programmer defined polymorphic domain. What the definition says is that tuple is a domain with two type parameters T1 and T2.  You may think of it as an infinite family of domains corresponding to all instantiations of the type parameters, e.g.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;domains&lt;br /&gt;
    tuple_char_char = tuple(char, char).&lt;br /&gt;
    tuple_char_integer = tuple(char, integer).&lt;br /&gt;
    tuple_char_string = tuple(char, string).&lt;br /&gt;
    ...&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The single domain definition above corresponds to all these domains, but actually the domain names/expressions look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;    tuple{char, char}&lt;br /&gt;
    tuple{char, integer}&lt;br /&gt;
    tuple{char, string}&lt;br /&gt;
    ...&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The values looks as expected; let us take a relatively complex one right away:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;    X = tuple(tuple(&amp;#039;a&amp;#039;,&amp;quot;a&amp;quot;), [1.2])&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
X is a tuple, its first element is itself a tuple (containing a char and a string), its second element is a list of  real&amp;#039;s. Subsequently, X has this type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;    tuple{ tuple{char, string}, real* } &amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see type expressions can become rather complex. You will probably soon get use to this, but below I will show a little scheme that can be used to keep type expressions simpler and more understandable, and which will at the same time make your program more type safe.&lt;br /&gt;
&lt;br /&gt;
We are now ready to define our queue domain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;domains&lt;br /&gt;
    queue_rep{Priority, Data} = tuple{Priority, Data}*.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The  _rep in the domain name has to do with the scheme mentioned above, right now you can simply ignore it. The domain definition says that queue_rep is a domain with two type parameters Priority and Data further more it is a list of tuple&amp;#039;s of these types.&lt;br /&gt;
&lt;br /&gt;
You may wonder why Priority is a type parameter, you may think that it should have been a number type like integer. However, in Visual Prolog 7.0 all data types are ordered, and therefore any data type can be used as a priority. Using a type parameter here makes the resulting queue more flexible. And at least I do not have to choose whether the priority should be integer, unsigned or real.&lt;br /&gt;
&lt;br /&gt;
To know whether you can use a type parameter or have to use a regular type you will have to consider what you need from the type. Like here where we need ordering (comparison). The following is possible on type parameters:&lt;br /&gt;
&lt;br /&gt;
*transferring as parameter&lt;br /&gt;
&lt;br /&gt;
*binding and unifying (with values of same type)&lt;br /&gt;
&lt;br /&gt;
*comparing (with values of same type)&lt;br /&gt;
&lt;br /&gt;
*writing on streams&lt;br /&gt;
&lt;br /&gt;
*reading from streams&lt;br /&gt;
&lt;br /&gt;
The last thing is partially wrong, the compiler allows this, but in practice you cannot read all kind of data, it is for example not possible to read predicate values and objects from streams.&lt;br /&gt;
&lt;br /&gt;
Let us return to our priority queue. Now that we have defined the domain that represents the queues, we will also have to declare and implement the suitable operations.&lt;br /&gt;
&lt;br /&gt;
Let us start with the simple ones. First we need an operation to obtain the least element in the queue (i.e. the one with least Priority).  This can be declared like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicates&lt;br /&gt;
    tryGetLeast_rep : (queue_rep{Priority, Data} Queue) -&amp;gt; tuple{Priority, Data} Least determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate is determ because the queue might be empty. The predicate is a function whose argument is a priority queue and which returns a tuple containing both the  Priority and the Data.  It does not remove the element from the queue, because I want to be able to peek at the element without removing it.&lt;br /&gt;
&lt;br /&gt;
The list is sorted with the least element first, so the implementation is trivial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    tryGetLeast_rep([Least|_]) = Least.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly we need a predicate for removing the least element:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicates&lt;br /&gt;
    deleteLeast_rep : (queue_rep{Priority, Data} Queue1) -&amp;gt; queue_rep{Priority, Data} Queue.&lt;br /&gt;
clauses&lt;br /&gt;
    deleteLeast_rep([]) = [].&lt;br /&gt;
    deleteLeast_rep([_Least|Rest]) = Rest.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally we need an insert predicate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicates&lt;br /&gt;
    insert_rep : (queue_rep{Pri, Data} Q1,  Pri P,  Data D) -&amp;gt; queue_rep{Pri, Data} Q0.&lt;br /&gt;
clauses&lt;br /&gt;
    insert_rep([], Pri, Data) = [tuple(Pri, Data)].&lt;br /&gt;
&lt;br /&gt;
    insert_rep(Q1, Pri, Data) = Q0 :-&lt;br /&gt;
        [tuple(P1,D1)|Rest] = Q1,&lt;br /&gt;
        if Pri &amp;lt;= P1 then&lt;br /&gt;
            Q0 = [tuple(Pri, Data)| Q1]&lt;br /&gt;
        else&lt;br /&gt;
            Q0 =&lt;br /&gt;
                [tuple(P1,D1) | insert_rep(Rest, Pri, Data)]&lt;br /&gt;
        end if.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have chosen shorter variable names to make the code fit the narrow column, but at the same time it gives me the opportunity to explain that type variables like Pri above only have scope in the declaration/definition where they occur.  Therefore, there is nothing wrong with using Priority in one declaration and Pri in another. Nevertheless, you should of course choose variable names with care, because good names make the code clearer. The compiler would not mind if you exchange  Priority and Data, but I am sure that it could confuse many programmers.&lt;br /&gt;
&lt;br /&gt;
In future versions of Visual Prolog there will also be type variables whose scope is a complete interface/class/implementation.&lt;br /&gt;
&lt;br /&gt;
The priority queue above can be used for various purposes, but it has two disadvantages, which both relate to the way we have defined the queue domain itself:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;domains&lt;br /&gt;
    queue_rep{Priority, Data} = tuple{Priority, Data}*.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A definition like this one is just an abbreviation or synonym, so  queue_rep{integer, sting} is exactly the same as tuple{integer, string}*.&lt;br /&gt;
&lt;br /&gt;
#The debugger will always show the unfolded type (i.e. tuple{integer, string}*) and this can be rather confusing.&lt;br /&gt;
&lt;br /&gt;
#Any piece of data that have this type can accidentally be given as argument to the priority queue predicates. However, the priority queue operations not only require that the data has this type, it also expect that it is sorted in a specific way (i.e. that the data satisfies the invariant).&lt;br /&gt;
&lt;br /&gt;
The latter problem could just as easy exist without polymorphism. It comes from using a general data structure for something specific. If you do this, you can mix anything that is of the general kind even though it is of different specific kinds.&lt;br /&gt;
&lt;br /&gt;
So instead we just consider the queue_rep domain as being the internal &amp;#039;&amp;#039;representation&amp;#039;&amp;#039; of the queues, hence the extension _rep. To the external world we will wrap each queue_rep queue inside a functor.&lt;br /&gt;
&lt;br /&gt;
Therefore, to the real queue domain will look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;domains&lt;br /&gt;
    queue{Priority, Data} = queue(queue_rep{Priority, Data}).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Such a domain is neither an abbreviation nor a synonym.&lt;br /&gt;
&lt;br /&gt;
The exported/public predicates will of course work on queue &amp;#039;s, so the complete class declaration looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class priorityQueue&lt;br /&gt;
    open core&lt;br /&gt;
&lt;br /&gt;
domains&lt;br /&gt;
    queue_rep{Priority, Data} = tuple{Priority, Data}*.&lt;br /&gt;
&lt;br /&gt;
domains&lt;br /&gt;
    queue{Priority, Data} = queue(queue_rep{Priority, Data}).&lt;br /&gt;
&lt;br /&gt;
constants&lt;br /&gt;
    empty : queue{Priority, Data} = queue([]).&lt;br /&gt;
&lt;br /&gt;
predicates&lt;br /&gt;
    insert : (queue{Pri, Data} Q1, Pri Pri, Data Data) -&amp;gt; queue{Pri, Data} Q0.&lt;br /&gt;
&lt;br /&gt;
predicates&lt;br /&gt;
    tryGetLeast : (queue{Priority, Data} Queue) -&amp;gt; tuple{Priority, Data} Least determ.&lt;br /&gt;
&lt;br /&gt;
predicates&lt;br /&gt;
    deleteLeast : (queue{Priority, Data} Queue1) -&amp;gt; queue{Priority, Data} Queue.&lt;br /&gt;
end class priorityQueue&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have also added an empty queue constant to the class. As a user of the class you then do not need to be concerned with the representation of the queues at all, there are predicates and constants for everything.&lt;br /&gt;
&lt;br /&gt;
The predicates in this class are very simple to implement given the predicates we implemented before, the only thing they should do is to remove and add the queue functor in the relevant places:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    insert(queue(Queue), Priority, Data) = queue(insert_rep(Queue, Priority, Data)).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    tryGetLeast(queue(Queue)) = tryGetLeast_rep(Queue).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    deleteLeast(queue(Queue)) = queue(deleteLeast_rep(Queue)).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using this _rep scheme is a bit less efficient, because of the extra functor, and it is entirely up to your temperament whether to use it or not. In any case it makes your type unique, rather than being a synonym type.&lt;br /&gt;
&lt;br /&gt;
Priority queues can be used like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    test():-&lt;br /&gt;
        Pq1 = priorityQueue::empty,&lt;br /&gt;
        Pq2 = priorityQueue::insert(Pq1, 17, &amp;quot;World&amp;quot;),&lt;br /&gt;
        Pq3 = priorityQueue::insert(Pq2, 12, &amp;quot;Hello&amp;quot;),&lt;br /&gt;
        Pq4 = priorityQueue::insert(Pq3, 23, &amp;quot;!&amp;quot;),&lt;br /&gt;
        stdio::writef(&amp;quot;%\n&amp;quot;, Pq4).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output looks like this (except for additional white space):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;queue( [tuple(12,&amp;quot;Hello&amp;quot;), tuple(17,&amp;quot;World&amp;quot;), tuple(23,&amp;quot;!&amp;quot;) ] )&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It may seem that polymorphism disables type check, but in fact it gives a very strong but flexible type check. If, for example, I write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    test():-&lt;br /&gt;
        Pq1 = priorityQueue::empty,&lt;br /&gt;
        Pq2 = priorityQueue::insert(Pq1, 17, &amp;quot;World&amp;quot;),&lt;br /&gt;
        Pq3 = priorityQueue::insert(Pq2, 12, 13).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then I will get the error message:&lt;br /&gt;
&lt;br /&gt;
error c504: The expression has type &amp;#039;::integer&amp;#039;, which is incompatible with the type &amp;#039;::string&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The first insert forces the Data type of Pq2 to be string, therefore you cannot use an integer in the next line.&lt;br /&gt;
&lt;br /&gt;
What may be more surprising is that it also forces the Data type of Pq1 to be string. Therefore this code gives exactly the same error:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    test():-&lt;br /&gt;
        Pq1 = priorityQueue::empty,&lt;br /&gt;
        Pq2 = priorityQueue::insert(Pq1, 17, &amp;quot;World&amp;quot;),&lt;br /&gt;
        Pq3 = priorityQueue::insert(Pq1, 12, 13).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand this is legal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    test():-&lt;br /&gt;
        Pq1a = priorityQueue::empty,&lt;br /&gt;
        Pq2 = priorityQueue::insert(Pq1a, 17, &amp;quot;World&amp;quot;),&lt;br /&gt;
        Pq1b = priorityQueue::empty,&lt;br /&gt;
        Pq3 = priorityQueue::insert(Pq1b, 12, 13).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;moral&amp;quot; is that the constant empty is polymorphic, but variables can only have a monomorphic type, so when empty is bound to a variable a concrete type is chosen and &amp;quot;frozen&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The priority queue above can be use for numerous purposes. And the code can be shared between all such uses, both within a single program and across programs. If I choose to make a more efficient solution to the priority queue, then I will benefit from this in all places where it is used.&lt;br /&gt;
&lt;br /&gt;
Parametric polymorphism is used to solve different problems in the same way (e.g. a using priority queue), and as such it is often used to make basic library software.&lt;br /&gt;
&lt;br /&gt;
Subsumption polymorphism is in many respects the complement to parametric polymorphism: it is used solve the same problem in &amp;#039;&amp;#039; different&amp;#039;&amp;#039; ways (e.g. reporting salaries to &amp;#039;&amp;#039;different&amp;#039;&amp;#039; salary systems), and as such it is often used at high levels in applications to deal with variance.&lt;br /&gt;
&lt;br /&gt;
However, the world is not black and white in this respect, there are many graduations and clear exceptions to this.&lt;br /&gt;
&lt;br /&gt;
=== Example: Job Scheduler ===&lt;br /&gt;
&lt;br /&gt;
Now let us try to combine some of the things from above to produce a simple, but yet powerful &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;job scheduler&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
A &amp;#039;&amp;#039;job&amp;#039;&amp;#039; is just some computation that should be performed. You register a job in the scheduler; the scheduler will then start the job at the requested time. Given such an &amp;quot;alarm clock&amp;quot; scheduler it is relatively easy to deal with reoccurring jobs and jobs that start in X minutes rather than at a certain time, and so forth. Here we will only consider the &amp;quot;alarm clock&amp;quot; functionality.&lt;br /&gt;
&lt;br /&gt;
The scheduler will rely on a timer event: every time the timer even triggers it will see if any jobs are due, and execute these.&lt;br /&gt;
&lt;br /&gt;
In this example I will just assume that time is an integer. I might want to use several schedulers in my program, so I choose to represent each scheduler by an object. Therefore the scheduler is mainly described as an interface, i.e. the type of the scheduler objects. The declaration of the scheduler looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface scheduler&lt;br /&gt;
domains&lt;br /&gt;
    job = (integer Time) procedure (i).&lt;br /&gt;
&lt;br /&gt;
predicates&lt;br /&gt;
    registerJob : (integer Time, job Job).&lt;br /&gt;
&lt;br /&gt;
predicates&lt;br /&gt;
    timerTick : (integer Time).&lt;br /&gt;
end interface scheduler&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A job is a predicate value acting as a callback. I have chosen that the job receive the invocation Time as a parameter. This is mainly for illustrative purposes and simplicity. In real life, I would probably rather give it the scheduler, which I would enrich with predicates for obtaining the current time and probably other things as well. That way the job can itself decide which information it wants to obtain.&lt;br /&gt;
&lt;br /&gt;
registerJob has the obvious functionality.&lt;br /&gt;
&lt;br /&gt;
timerTick should be invoked regularly, since this is the heart of the scheduler.&lt;br /&gt;
&lt;br /&gt;
The implementation looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;implement scheduler&lt;br /&gt;
    open core, priorityQueue&lt;br /&gt;
facts&lt;br /&gt;
    jobQueue : queue{integer, job}.&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    new() :-&lt;br /&gt;
        jobQueue := empty.&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    registerJob(Time, Job) :-&lt;br /&gt;
        jobQueue := insert(jobQueue, Time, Job).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    timerTick(Time) :-&lt;br /&gt;
        if&lt;br /&gt;
            tuple(T, Job) = tryGetLeast(jobQueue),&lt;br /&gt;
            T &amp;lt;= Time&lt;br /&gt;
        then&lt;br /&gt;
            Job(Time),&lt;br /&gt;
            jobQueue := deleteLeast(jobQueue),&lt;br /&gt;
            timerTick(Time)&lt;br /&gt;
        end if.&lt;br /&gt;
end implement scheduler&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Most of the implementation is completely trivial. The main thing is that I use a priority internally for storing the jobs, with the time as priority. This have the advantage that the &amp;quot;most due&amp;quot; job is always easily accessible.&lt;br /&gt;
&lt;br /&gt;
There is a jobQueue fact that is initialized in the constructor, and registerJob simply insert the job in the priority queue.&lt;br /&gt;
&lt;br /&gt;
The important things take place in timerTick. It peek at the &amp;quot;least&amp;quot; job in the queue. If this hob should be started now or earlier then it is stated and removed from the queue, and then the rest of the queue is considered.&lt;br /&gt;
&lt;br /&gt;
If the &amp;quot;least&amp;quot; job is not due then we do nothing, i.e. then we wait for another timer tick.&lt;br /&gt;
&lt;br /&gt;
Before we use the scheduler I want to point out that several good reasons why the scheduler does not contain the actual timer:&lt;br /&gt;
&lt;br /&gt;
*It may be important to be in synchronization with some external clock&lt;br /&gt;
&lt;br /&gt;
*In some contexts the increment in the Time parameter need not be the same al the time&lt;br /&gt;
&lt;br /&gt;
*In some contexts the Time does not relate to real time. (E.g. game steps, workflow steps., etc).&lt;br /&gt;
&lt;br /&gt;
*In a GUI application it may be important that the timerTick&amp;#039;s are invoked from a window event. I.e. to keep the application single threaded.&lt;br /&gt;
&lt;br /&gt;
Using external timer ticks makes all this possible.&lt;br /&gt;
&lt;br /&gt;
Let us use the timer in a console program, where the clock is provided by a simple for loop:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    traceJob : (integer Time).&lt;br /&gt;
clauses&lt;br /&gt;
    traceJob(Time) :-&lt;br /&gt;
        stdio::write(&amp;quot;Now: &amp;quot;, Time, &amp;quot;\n&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    test() :-&lt;br /&gt;
        Scheduler = scheduler::new(),&lt;br /&gt;
        Scheduler:registerJob(500, traceJob),&lt;br /&gt;
        foreach Time = std::fromTo(1,1000) do&lt;br /&gt;
            Scheduler:timerTick(Time)&lt;br /&gt;
        end foreach.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The traceJob simply writes the clock. We create a scheduler and register the traceJob for running at Time = 500, and then we start the clock.&lt;br /&gt;
&lt;br /&gt;
We can also make a job that reschedules itself and thus runs repeatedly. To do this the job must have access to the scheduler and therefore we save it in a fact:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    cyclicJob : (integer Time).&lt;br /&gt;
clauses&lt;br /&gt;
    cyclicJob(Time) :-&lt;br /&gt;
        stdio::write(&amp;quot;Hello World!\n&amp;quot;),&lt;br /&gt;
        scheduler:registerJob(Time+50, cyclicJob).&lt;br /&gt;
&lt;br /&gt;
class facts&lt;br /&gt;
    scheduler : scheduler := erroneous.&lt;br /&gt;
clauses&lt;br /&gt;
    test() :-&lt;br /&gt;
        scheduler := scheduler::new(),&lt;br /&gt;
        scheduler:registerJob(5, cyclicJob),&lt;br /&gt;
        foreach Time = std::fromTo(1,200) do&lt;br /&gt;
            scheduler:timerTick(Time)&lt;br /&gt;
        end foreach.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the scheduler we have clearly used the (parametric) polymorphic priority queue. We have also used the (subsumption) polymorphism that comes from predicate values, such that we can register jobs with different implementation in the scheduler. The parametric polymorphism has exploited the homogeneous treatment of prioritizing things, no matter which kind of things we are dealing with. The subsumption polymorphism has been used to deal with the heterogeneous nature of jobs themselves.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ru:Объекты и полиморфизм. Ч.1]]&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Classes&amp;diff=4411</id>
		<title>Language Reference/Classes</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Classes&amp;diff=4411"/>
		<updated>2017-07-10T09:18:32Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{languageReferenceNavbar|Classes}}&lt;br /&gt;
&lt;br /&gt;
A class declaration defines the appearance of the class to the surroundings: the surroundings can see and use exactly those entities mentioned in the class declaration. We say that the declaration of a class specifies the public part of the class. &lt;br /&gt;
&lt;br /&gt;
A class declaration can contain constant and domain definitions and predicate declarations.&lt;br /&gt;
&lt;br /&gt;
If the class states a construction type &amp;lt;vpbnf&amp;gt;&amp;lt;ConstructionType&amp;gt;&amp;lt;/vpbnf&amp;gt;, then it constructs objects of that type.  Object constructing classes have at least one constructor, but more can be declared.  Classes that do not explicitly declare any constructors are automatically equipped with the default constructors (i.e. &amp;lt;vp&amp;gt;new/0&amp;lt;/vp&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Objects are constructed by invoking one of constructors of the class.&lt;br /&gt;
&lt;br /&gt;
Constructors are also used when initializing inherited classes.&lt;br /&gt;
&lt;br /&gt;
Everything mentioned in a class declaration belongs to the class, rather than to objects it constructs. Everything that relates to the objects must be declared in the construction type of the objects constructed by the class.&lt;br /&gt;
&lt;br /&gt;
Any class declaration &amp;lt;vpbnf&amp;gt;&amp;lt;ClassDeclaration&amp;gt;&amp;lt;/vpbnf&amp;gt; must have an accompanying class implementation {{lang|Implementations|&amp;lt;vpbnf&amp;gt;&amp;lt;ClassImplementation&amp;gt;&amp;lt;/vpbnf&amp;gt;}}.  The definition/implementation of predicates declared in the class declaration is provided by the class implementation.  Likewise the definition of the predicates supported by the objects constructed by the class is provided by the class implementation.  Both kinds of predicates can be implemented by clauses, but object predicates can also be inherited from other classes.&lt;br /&gt;
&lt;br /&gt;
It is important to notice that a class declaration does not state anything about code inheritance.  Code inheritance is a completely private matter that can only be stated in the class implementation. (This is unlike many other object oriented programming languages, and serves to hide all implementation details in the &amp;#039;&amp;#039;implementation).&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If the class does not state a construction type &amp;lt;vpbnf&amp;gt;&amp;lt;ConstructionType&amp;gt;&amp;lt;/vpbnf&amp;gt;, then the class cannot manufacture any objects; it therefore plays the role of a module rather than a &amp;quot;real&amp;quot; class. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;ClassDeclaration&amp;gt; :&lt;br /&gt;
    class &amp;lt;ClassName&amp;gt; &amp;lt;ConstructionType&amp;gt;-opt&lt;br /&gt;
        &amp;lt;ScopeQualifications&amp;gt;&lt;br /&gt;
    &amp;lt;Sections&amp;gt;&lt;br /&gt;
    end class &amp;lt;ClassName&amp;gt;-opt&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;ConstructionType&amp;gt; :&lt;br /&gt;
    : &amp;lt;InterfaceName&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;ClassName&amp;gt; :&lt;br /&gt;
    &amp;lt;LowerCaseIdentifier&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also {{lang|Generic Interfaces and Classes|Generic Interfaces and Classes}} and {{lang|Monitors|Monitors}}.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vpbnf&amp;gt;&amp;lt;ClassName&amp;gt;&amp;lt;/vpbnf&amp;gt; in the end of the class declaration must (if present) be identical to the one in the beginning of the class declaration.&lt;br /&gt;
&lt;br /&gt;
Notice that you can use the same class name &amp;lt;vpbnf&amp;gt;&amp;lt;ClassName&amp;gt;&amp;lt;/vpbnf&amp;gt; as the interface name &amp;lt;vpbnf&amp;gt;&amp;lt;ConstructionType&amp;gt;&amp;lt;/vpbnf&amp;gt; specified as the construction type to this class. That is you can write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class interfaceAndClassName : interfaceAndClassName&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that both the class and the interface can declare domains and constants and these must not conflict with each other since they end up in the same name space (because they can be qualified only with the same name of the interface or the class).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vpbnf&amp;gt;&amp;lt;ScopeQualifications&amp;gt;&amp;lt;/vpbnf&amp;gt; must be of the kind {{lang2|Interfaces|Open_Qualification|&amp;lt;vpbnf&amp;gt;&amp;lt;OpenQualification&amp;gt;&amp;lt;/vpbnf&amp;gt;}}.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vpbnf&amp;gt;&amp;lt;Sections&amp;gt;&amp;lt;/vpbnf&amp;gt; must be of the kinds:&lt;br /&gt;
&lt;br /&gt;
*{{lang2|Constants|Constants_Sections|constantsSection}}&lt;br /&gt;
*{{lang2|Domains|Domains_Sections|domainsSection}}&lt;br /&gt;
*{{lang2|Predicates|Predicates_Sections|predicatesSection}}&lt;br /&gt;
*{{lang2|Predicates|Constructors_Sections|constructorsSection}}&lt;br /&gt;
*{{lang2|Properties|Properties_Sections|propertiesSection}}&lt;br /&gt;
*{{lang2|Directives|Conditional_Compilation|conditionalSection}}&lt;br /&gt;
&lt;br /&gt;
{{lang2|Predicates|Constructors_Sections|constructorsSection}}s are only legal if the class states a &amp;lt;vpbnf&amp;gt;&amp;lt;ConstructionType&amp;gt;&amp;lt;/vpbnf&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All sections contained (transitively) in conditional sections must also be of those kinds.&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Properties&amp;diff=4410</id>
		<title>Language Reference/Properties</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Properties&amp;diff=4410"/>
		<updated>2017-07-10T09:16:09Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: /* Properties from Interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{languageReferenceNavbar|Properties}}&lt;br /&gt;
&lt;br /&gt;
Properties are named values associated with classes and objects.  Actually they are syntactic sugar for get/set predicates for the property value.  And in that sense they are a language incarnation of a frequently used programming pattern.&lt;br /&gt;
&lt;br /&gt;
=== Properties Sections ===&lt;br /&gt;
&lt;br /&gt;
A properties section declares a set of object or class properties in the current scope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;PropertiesSection&amp;gt; :&lt;br /&gt;
   class-opt properties &amp;lt;PropertyDeclaration&amp;gt;-dot-term-list-opt&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The keyword &amp;lt;vp&amp;gt;class&amp;lt;/vp&amp;gt; can be used only inside class implementations, since:&lt;br /&gt;
* properties declared in an interface are always object properties and&lt;br /&gt;
* properties declared in a class declaration are always class properties.&lt;br /&gt;
&lt;br /&gt;
=== Property Declaration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;PropertyDeclaration&amp;gt; :&lt;br /&gt;
    &amp;lt;PropertyName&amp;gt; : &amp;lt;PropertyType&amp;gt; &amp;lt;FlowPattern&amp;gt;-list-opt&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;FlowPattern&amp;gt;: one of&lt;br /&gt;
    (i)&lt;br /&gt;
    (o)&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is possible to get the value of a property that has the (o) flow, and it is possible to set the value of a property that has the (i) flow.  &lt;br /&gt;
If the flow patterns are not stated, both (i) and (o) are assumed, so it is possible bot to set and get the value of such properties.&lt;br /&gt;
&lt;br /&gt;
Though it is legal to state (i) and (o) simultaneously, it is considered better practice to omit them in the get+set case.&lt;br /&gt;
&lt;br /&gt;
{{example|Assume we declare them with an i/o pattern as:&lt;br /&gt;
&amp;lt;vip&amp;gt;properties&lt;br /&gt;
    durationO : real (o). % a get only property&lt;br /&gt;
    durationI : real (i). % a set only property&lt;br /&gt;
    durationIO : real (i) (o). % a &amp;quot;full&amp;quot; property, which can both be set and get.&lt;br /&gt;
    duration : real. % equivalent to the declaration above and preferred.&amp;lt;/vip&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
In the sequel we will use the use the following example:&lt;br /&gt;
&lt;br /&gt;
{{example|&amp;lt;vip&amp;gt;interface ip&lt;br /&gt;
properties&lt;br /&gt;
   duration : real.&lt;br /&gt;
   initialized : boolean (o).&lt;br /&gt;
   scale : real.&lt;br /&gt;
end interface&amp;lt;/vip&amp;gt;&lt;br /&gt;
&amp;lt;vp&amp;gt;duration&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;scale&amp;lt;/vp&amp;gt; are get+set properties, and &amp;lt;vp&amp;gt;initialized&amp;lt;/vp&amp;gt; is a get-only property.}}&lt;br /&gt;
&lt;br /&gt;
Properties are used like fact variables. It is possible to qualify properties for with a scope name or an object.&lt;br /&gt;
&lt;br /&gt;
{{example|&amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is an object that supports the interface &amp;lt;vp&amp;gt;ip&amp;lt;/vp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;X:duration := 5,&lt;br /&gt;
if true = X:initialized then ... else ... end if,&lt;br /&gt;
X:scale := 2.56,&lt;br /&gt;
....&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Inside an implementation of a class that supports &amp;lt;vp&amp;gt;ip&amp;lt;/vp&amp;gt; you access the properties as if they were facts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;duration := 5,&lt;br /&gt;
if true = initialized then ... else ... end if,&lt;br /&gt;
scale := 2.56,&lt;br /&gt;
....&amp;lt;/vip&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
A property is implemented by defining a function for getting the value and a predicate to set it.&lt;br /&gt;
&lt;br /&gt;
{{example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    % implementation of the get function of the duration property&lt;br /&gt;
    duration() = duration_fact.&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    % implementation of the set predicate of the duration property&lt;br /&gt;
    duration(D) :-&lt;br /&gt;
        duration_fact := D / scale.&amp;lt;/vip&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Alternatively the property can be implemented as a fact variable with the same name as the property.&lt;br /&gt;
&lt;br /&gt;
{{example|&lt;br /&gt;
&amp;lt;vip&amp;gt;facts&lt;br /&gt;
    % the initialized property is implemented by a fact variable&lt;br /&gt;
    initialized : boolean := false.&lt;br /&gt;
    % the scale property is implemented by a fact variable&lt;br /&gt;
    scale : real := 1.2&amp;lt;/vip&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
In this case the compiler will implicitly provide clauses that implement the get and set predicates.&lt;br /&gt;
&lt;br /&gt;
{{example|For the two fact variable implementations above the compiler will provide clauses corresponding to this&lt;br /&gt;
&amp;lt;vip&amp;gt;&lt;br /&gt;
clauses&lt;br /&gt;
    % implicit get clause for the initialized property&lt;br /&gt;
    initialized() = initialized.&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    % implicit get clause for the scale property&lt;br /&gt;
    scale() = scale.&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    % implicit set clause for the scale property&lt;br /&gt;
    scale(V) :-&lt;br /&gt;
        scale := V.&lt;br /&gt;
&amp;lt;/vip&amp;gt;&lt;br /&gt;
As mentioned below it would not be legal to state these clauses in a program.}}&lt;br /&gt;
&lt;br /&gt;
It is illegal to have set and get predicates and a fact with the same name, meaning that a property is either implemented by programmer provided clauses or by a fact; mixed implementation is not possible.&lt;br /&gt;
&lt;br /&gt;
{{example|We want to send a &amp;#039;&amp;#039;&amp;#039;changed&amp;#039;&amp;#039;&amp;#039; event when the &amp;lt;vp&amp;gt;duration&amp;lt;/vp&amp;gt; property changes value.  Therefore we have to implement the property by predicates, and use a fact variable with an other name for storing the value.&lt;br /&gt;
&amp;lt;vip&amp;gt;properties&lt;br /&gt;
    duration : integer.&lt;br /&gt;
facts&lt;br /&gt;
    duration_fact : integer.&lt;br /&gt;
clauses&lt;br /&gt;
    duration() = duration_fact.&lt;br /&gt;
clauses&lt;br /&gt;
    duration(D) :-&lt;br /&gt;
        OldDuration = duration_fact,&lt;br /&gt;
        duration_fact := D,&lt;br /&gt;
        OldDuration &amp;lt;&amp;gt; D,&lt;br /&gt;
        !,&lt;br /&gt;
        sendChanged().&lt;br /&gt;
    duration(_D).&amp;lt;/vip&amp;gt;&lt;br /&gt;
It is not possible to use the &amp;lt;vp&amp;gt;duration&amp;lt;/vp&amp;gt; predicates as predicates (they are not declared as predicates, but as a property; it is just the way the get and set of the property are implemented).&lt;br /&gt;
&lt;br /&gt;
But in the predicate names are &amp;quot;used&amp;quot; - so you cannot declare predicates &amp;lt;vp&amp;gt;duration\1&amp;lt;/vp&amp;gt; or &amp;lt;vp&amp;gt;duration\0-&amp;gt;&amp;lt;/vp&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
As mentioned above properties are always implemented by get/set predicates even when the program implement them by a fact variable.&lt;br /&gt;
&lt;br /&gt;
=== Properties from Interface ===&lt;br /&gt;
&lt;br /&gt;
An interface can support a subset of another interface by stating the properties in a properties from section. The &amp;lt;vp&amp;gt;properties from&amp;lt;/vp&amp;gt; section names the interface and all supported properties.&lt;br /&gt;
&lt;br /&gt;
If an interface supports a subset of another interface it is neither subtype or super-type related to the other interface.&lt;br /&gt;
&lt;br /&gt;
The important thing about the &amp;lt;vp&amp;gt;properties from&amp;lt;/vp&amp;gt; section is that the mentioned properties retain their origin interface. Therefore:&lt;br /&gt;
&lt;br /&gt;
*there will be no support conflict with any properties from the origin interface;&lt;br /&gt;
*they can be inherited as the properties from the origin interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;PropertiesFromInterface&amp;gt; :&lt;br /&gt;
    properties from &amp;lt;InterfaceName&amp;gt; &amp;lt;PropertyName&amp;gt;-comma-sep-list-opt&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vpbnf&amp;gt;&amp;lt;PropertiesFromInterface&amp;gt;&amp;lt;/vpbnf&amp;gt; can only be used in interface definitions.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;interface aaa&lt;br /&gt;
   properties&lt;br /&gt;
       pp : integer.&lt;br /&gt;
       qq : boolean.&lt;br /&gt;
end interface aaa&lt;br /&gt;
&lt;br /&gt;
interface bbb&lt;br /&gt;
   properties from aaa&lt;br /&gt;
       pp&lt;br /&gt;
   properties&lt;br /&gt;
       rr : string.&lt;br /&gt;
end interface bbb&lt;br /&gt;
&lt;br /&gt;
interface ccc supports aaa, bbb&lt;br /&gt;
end interface ccc&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Even though &amp;lt;vp&amp;gt;aaa&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;bbb&amp;lt;/vp&amp;gt; both declare a property &amp;lt;vp&amp;gt;pp&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;ccc&amp;lt;/vp&amp;gt; can support them both without any conflicts, because &amp;lt;vp&amp;gt;pp&amp;lt;/vp&amp;gt; has &amp;lt;vp&amp;gt;aaa&amp;lt;/vp&amp;gt; as an origin interface in all cases.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;interface aaa&lt;br /&gt;
   properties&lt;br /&gt;
       pp : integer.&lt;br /&gt;
       qq : boolean.&lt;br /&gt;
end interface aaa&lt;br /&gt;
&lt;br /&gt;
interface bbb&lt;br /&gt;
   properties from aaa&lt;br /&gt;
       pp&lt;br /&gt;
   properties&lt;br /&gt;
       rr : string.&lt;br /&gt;
end interface bbb&lt;br /&gt;
&lt;br /&gt;
class aaa_class : aaa&lt;br /&gt;
end class aaa_class&lt;br /&gt;
&lt;br /&gt;
class bbb_class : bbb&lt;br /&gt;
end class bbb_class&lt;br /&gt;
&lt;br /&gt;
implement aaa_class inherits bbb_class&lt;br /&gt;
   facts&lt;br /&gt;
       pp_fact(): integer.&lt;br /&gt;
   clauses&lt;br /&gt;
       pp()= pp_fact-3.&lt;br /&gt;
   clauses&lt;br /&gt;
       pp(D):- pp_fact:=D+3.&lt;br /&gt;
end implement aaa_class&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;aaa_class&amp;lt;/vp&amp;gt; can inherit &amp;lt;vp&amp;gt;pp&amp;lt;/vp&amp;gt; from &amp;lt;vp&amp;gt;bbb_class&amp;lt;/vp&amp;gt;, because &amp;lt;vp&amp;gt;pp&amp;lt;/vp&amp;gt; in both classes has &amp;lt;vp&amp;gt;aaa&amp;lt;/vp&amp;gt; as origin interface.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Terms&amp;diff=4356</id>
		<title>Language Reference/Terms</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Terms&amp;diff=4356"/>
		<updated>2017-03-22T11:57:39Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: misspelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{languageReferenceNavbar|Terms}}&lt;br /&gt;
&lt;br /&gt;
This section describes terms and how execution/evaluation of terms and clauses proceeds.&lt;br /&gt;
&lt;br /&gt;
Semantically, there are two kinds of terms: &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;formulas&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;expressions&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
*Expressions represent values, like the number 7.&lt;br /&gt;
*Formulas represent logical statements, like &amp;quot;the number 7 is greater than the number 3&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Syntactically the two kinds have a huge overlap and therefore the syntax unites the two kinds into &amp;#039;&amp;#039;terms&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The following definition of &amp;lt;vpbnf&amp;gt;&amp;lt;Term&amp;gt;&amp;lt;/vpbnf&amp;gt; is simplified, in the sense that it includes syntactic constructions that are not legal. For example, one cannot legally write &amp;lt;vp&amp;gt;! + !&amp;lt;/vp&amp;gt;. We do however believe that using this simple syntax description in combination with intuitive understanding of language concepts, the type system, and the operator hierarchy described below is better for most purposes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Term&amp;gt;:&lt;br /&gt;
    ( &amp;lt;Term&amp;gt; )&lt;br /&gt;
    &amp;lt;Literal&amp;gt;&lt;br /&gt;
    &amp;lt;Variable&amp;gt;&lt;br /&gt;
    &amp;lt;Identifier&amp;gt;&lt;br /&gt;
    &amp;lt;MemberAccess&amp;gt;&lt;br /&gt;
    &amp;lt;PredicateCall&amp;gt;&lt;br /&gt;
    &amp;lt;PredicateExpression&amp;gt;&lt;br /&gt;
    &amp;lt;UnaryOperator&amp;gt; &amp;lt;Term&amp;gt;&lt;br /&gt;
    &amp;lt;Term&amp;gt; &amp;lt;Operator&amp;gt; &amp;lt;Term&amp;gt;&lt;br /&gt;
    &amp;lt;Cut&amp;gt;&lt;br /&gt;
    &amp;lt;Ellipsis&amp;gt;&lt;br /&gt;
    &amp;lt;FactvariableAssignment&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Backtracking ===&lt;br /&gt;
&lt;br /&gt;
The evaluation of a Prolog program is a search for a &amp;quot;solution&amp;quot; to the goal. Each step in the search for a solution can either &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeed&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fail&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;. At certain points in the program execution there are more than one possible choices for finding a solution. When such a choice point is met a so called &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;backtrack point&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is created. A backtrack point is a recording of the program state plus a pointer to the choice that was not executed. If it turn out that the original choice could not provide the solution (i.e. if it &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fails&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;), then the program will &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;backtrack&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; to the recorded backtrack point. Thereby restoring the program state and pursuing the other choice. The mechanism will be described and exemplified in details in the following sections.&lt;br /&gt;
&lt;br /&gt;
=== Literals ===&lt;br /&gt;
&lt;br /&gt;
Literals have {{lang2|Domains|Universal_Types|universal type}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Literal&amp;gt;:&lt;br /&gt;
   &amp;lt;IntegerLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;RealLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;CharacterLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;StringLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;BinaryLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;ListLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;CompoundDomainLiteral&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also {{lang2|Lexical Elements|Literals|Literals (in Lexical Elements)}}&lt;br /&gt;
&lt;br /&gt;
=== Variables ===&lt;br /&gt;
&lt;br /&gt;
Variables in Visual Prolog are immutable: once they are bound to a value they retain that value, but backtracking can unbind the variable again during the process of restoring a previous program state.&lt;br /&gt;
&lt;br /&gt;
A variable can thus be bound (during unification and matching), if it is already bound then it evaluates to the value that it is bound to.&lt;br /&gt;
&lt;br /&gt;
Variables are names starting with an upper-case letter or with an underscore (_), followed by a sequence of letters (both uppercase and lowercase), digits, and underscore characters (all in all called an UppercaseIdentifier):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Variable&amp;gt;:&lt;br /&gt;
    &amp;lt;UppercaseIdentifer&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following are examples of valid variable names:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;My_first_correct_variable_name&lt;br /&gt;
_&lt;br /&gt;
_Sales_10_11_86&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
while the next two are invalid:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;1stattempt&lt;br /&gt;
second_attempt&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variable consisting of single underscore character (i.e. &amp;lt;vp&amp;gt;_&amp;lt;/vp&amp;gt;) is known as the &amp;#039;&amp;#039;anonymous variable&amp;#039;&amp;#039;. The anonymous variable is used in patterns and bindings where the corresponding value is of no interest and should be ignored.  Every occurrence of the anonymous variable is an independent anonymous variable, i.e. even though the anonymous variable is used several times in a single clause they have no relation to each other.&lt;br /&gt;
&lt;br /&gt;
If variables that starts with an underscore are not anonymous, but they are still intended for values of no interest that should be ignored.  The compiler will issue a warning if the value of such a warning is actually not ignored.&lt;br /&gt;
&lt;br /&gt;
Prolog variables are local to the clause in which it occurs. That is, if two clauses each contain a variable called &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt;, these &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt;-s are two distinct variables.&lt;br /&gt;
&lt;br /&gt;
A variable is said to be &amp;#039;&amp;#039;free&amp;#039;&amp;#039; when it is not yet associated with a term and to be &amp;#039;&amp;#039;bound&amp;#039;&amp;#039; or instantiated when it is unified with a term.&lt;br /&gt;
&lt;br /&gt;
The Visual Prolog compiler does not make a distinction between upper and lower case letters in names, except for the first letter. This means that the two variables &amp;lt;vp&amp;gt;SourceCode&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;SOURCECODE&amp;lt;/vp&amp;gt; are the same.&lt;br /&gt;
&lt;br /&gt;
=== Identifier ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Identifier&amp;gt;:&lt;br /&gt;
    &amp;lt;MemberName&amp;gt;&lt;br /&gt;
    &amp;lt;GlobalScopeMembername&amp;gt;&lt;br /&gt;
    &amp;lt;ScopeQualifiedMemberName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;MemberName&amp;gt;:&lt;br /&gt;
    &amp;lt;LowerCaseIdentifier&amp;gt;&lt;br /&gt;
&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Identifiers are used to refer to named entities (i.e. classes, interfaces, constants, domains, predicates, facts, ...).&lt;br /&gt;
&lt;br /&gt;
An identifier can just be a lower case identifier (i.e. a lowercase letter followed by a sequence of letters, numbers and underscore characters).&lt;br /&gt;
&lt;br /&gt;
Many entities can have the same name.  So it may be necessary or desirable to qualify the lowercase identifier the name of the particular scope of interest, or to state that the name is in the global namespace.&lt;br /&gt;
&lt;br /&gt;
{{Example| These are examples of unqualified identifiers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;integer&lt;br /&gt;
mainExe&lt;br /&gt;
myPredicate&amp;lt;/vip&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Global Entities Access ====&lt;br /&gt;
&lt;br /&gt;
The only global entities, which exist in Visual Prolog, are built-in domains, predicates, and constants. Global names are directly accessible in any scope. There might however exist situations where a global name is shadowed by a local or imported name. In that case the global entity can be qualified with a double colon &amp;#039;&amp;lt;vp&amp;gt;::&amp;lt;/vp&amp;gt;&amp;#039; (without a prefixed class/interface name). The double colon can be used everywhere, but the most important place is where an interface name is used as formal parameter type specifier.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;GlobalScopeMemberName&amp;gt;:&lt;br /&gt;
    :: &amp;lt;MemberName&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Example| The built-in domain &amp;lt;vp&amp;gt;integer&amp;lt;/vp&amp;gt; is defined in the global scope, to avoid ambiguity or stress that it is this particular domains you can use the global scope member name:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;::integer&amp;lt;/vip&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Class/Interface Member Access ====&lt;br /&gt;
&lt;br /&gt;
Static members of classes and interfaces are accessed by means of qualification with the class name (and optionally a namespace prefix):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;ScopeQualifiedMemberName&amp;gt;&lt;br /&gt;
    &amp;lt;NamespacePrefix&amp;gt;-opt &amp;lt;ScopeName&amp;gt; :: &amp;lt;MemberName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;NamespacePrefix&amp;gt;:&lt;br /&gt;
    &amp;lt;NamespaceIdentifier&amp;gt;-opt \&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ScopeName&amp;gt;:&lt;br /&gt;
    &amp;lt;LowercaseIdentifier&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ScopeName is the name of the class or interface that defines/declares the name.&lt;br /&gt;
&lt;br /&gt;
Namespace prefixing is explained in: {{lang2|Namespaces|Referencing names in namespaces|Referencing names in namespaces}}.&lt;br /&gt;
&lt;br /&gt;
Some names can be accessed without qualification, see {{lang2|Basic_Concepts|Scoping_&amp;amp;_Visibility|scoping &amp;amp; visibility}}.&lt;br /&gt;
&lt;br /&gt;
=== Predicate Call ===&lt;br /&gt;
&lt;br /&gt;
A predicate call have the form&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;PredicateCall&amp;gt;:&lt;br /&gt;
     &amp;lt;Term&amp;gt; ( &amp;lt;Term&amp;gt;-comma-sep-list-opt )&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first term must be an expression that evaluates to a value with predicate type.  Typically, it is either the name of a predicate in a class, or an expression that evaluates to a predicate member of an object.&lt;br /&gt;
&lt;br /&gt;
Notice that some predicates return values, whereas other predicates do not. A predicate that returns a value is an expression, and the predicate call is often referred to as a &amp;#039;&amp;#039;&amp;#039;function&amp;#039;&amp;#039;&amp;#039; call.  A predicate that does return a value is a formula.&lt;br /&gt;
&lt;br /&gt;
A predicate is invoked by applying arguments to the predicate. The predicate must have a flow-pattern that matches the free/bound state of the arguments.&lt;br /&gt;
&lt;br /&gt;
Most predicates are defined by a set of clauses, but some predicates are built into the language and some are defined externally in a DLL (perhaps in a foreign programming language).&lt;br /&gt;
&lt;br /&gt;
When a predicate is invoked by a predicate call, each clause is executed in turn until one of them &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeeds&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, or there are no more clauses left to execute. If no clause succeeds the predicate &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fails&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
If a clause succeeds and there are more relevant clauses left, a &amp;#039;&amp;#039;&amp;#039;backtrackpoint&amp;#039;&amp;#039;&amp;#039; is created to the next relevant clause.&lt;br /&gt;
&lt;br /&gt;
Thus, a predicate can &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fail&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeed&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, and even &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeed&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; multiple times.&lt;br /&gt;
&lt;br /&gt;
Each clause has a head and optionally a body.&lt;br /&gt;
&lt;br /&gt;
When a predicate is called the clauses are tried in turn (from top to bottom). For each clause the arguments in the head is unified with the arguments from the call. If this unification succeeds then the body of the clause (if present) is executed. The clause &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeeds,&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; if the match of the head &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeeds&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; and the body &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeeds&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;. Otherwise it &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fails&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp() :- qqq(X), write(X), fail.&lt;br /&gt;
&lt;br /&gt;
   qqq(1).&lt;br /&gt;
   qqq(2).&lt;br /&gt;
   qqq(3).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is called it in turn calls &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt;. When &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; is called, it first creates a backtrack point pointing to the second clause. Then the first clause is executed. Hereby the free variable &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; from &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is matched against the number &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;, whereby &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is bound to &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; (i.e. &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;) is written and then &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; cause backtracking to the backtrackpoint. Hereby program control is set to the second clause in &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; and the program state is set back to the state it was in when &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; was first entered, i.e. &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; in &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is unbound again.&lt;br /&gt;
&lt;br /&gt;
Before the actual execution of the second clause in &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; begins a backtrack point to the third clause is created.  The execution then proceeds as it did for &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Unification ===&lt;br /&gt;
&lt;br /&gt;
When a predicate is called the arguments from the call is &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;unified&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; with the terms in the head of each clause.&lt;br /&gt;
&lt;br /&gt;
Unification is the process of binding variables in such a way that two terms become equal, making as few bindings as possible (i.e. leaving as much as possible open for further binding).&lt;br /&gt;
&lt;br /&gt;
Variables can be bound to any kind of terms, including variables or terms containing variables.&lt;br /&gt;
&lt;br /&gt;
Unification is either possible or impossible, i.e. it can &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;succeed&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fail&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Variables and terms to which they are unified have types, a variable can only be bound to a term of the same type as the variable, or a subtype. When two variables are bound to each other they must therefore have exactly the same type.&lt;br /&gt;
&lt;br /&gt;
Unification takes place (as mentioned) between a predicate call and the clause head. It also takes place when two terms are compared for equality.&lt;br /&gt;
&lt;br /&gt;
{{Example| Consider two terms (of the same type):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;T1 = f1(g(), X, 17, Y, 17)&lt;br /&gt;
T2 = f1(Z, Z, V, U, 43)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will attempt to unify these two terms from left to right (i.e. a left-to-right pre-traversal).&lt;br /&gt;
&lt;br /&gt;
Both &amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt; are &amp;lt;vp&amp;gt;f1/5&amp;lt;/vp&amp;gt; terms, this match. Therefore we attempt to unify each of the arguments from &amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; with each correspondent argument of &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt;. First we must unify &amp;lt;vp&amp;gt;Z&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;, this can be unified if we bind &amp;lt;vp&amp;gt;Z&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;. So far everything is fine and we have the first binding in our unifier:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Z = g()&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next two arguments are &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;Z&amp;lt;/vp&amp;gt;, which already has been bound to &amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;. These two arguments can also be unified if we also bind &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;. So we now have the following contributions to our unifier:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;X = Z = g()&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we must bind &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;17&amp;lt;/vp&amp;gt; and then we must bind &amp;lt;vp&amp;gt;Y&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;U&amp;lt;/vp&amp;gt;. So far everything unifies with the following unifier:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;X = Z = g()&lt;br /&gt;
V = 17&lt;br /&gt;
Y = U&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two unified terms are now equivalent to these terms:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;T1 = f1(g(), g(), 17, Y, 17)&lt;br /&gt;
T2 = f1(g(), g(), 17, Y, 43)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But we have not yet unified the two last arguments, which are &amp;lt;vp&amp;gt;17&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;43&amp;lt;/vp&amp;gt;. No variable binding can make these terms equal, so all in all the unification &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fails&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt; cannot be unified.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
In the example above &amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; could have been a predicate call and &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt; a clause head. But they could also have been two terms that were compared with equal &amp;quot;&amp;lt;vp&amp;gt;=&amp;lt;/vp&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Matching ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Matching&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is the same as unification except that variables can only be bound to grounded terms. A &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;grounded&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; term is a term that does not contain any unbound variables.&lt;br /&gt;
&lt;br /&gt;
It is the flow-patterns that are stated for predicates, that make it possible to use matching rather than full-blown unification.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp(Z, Z, 17).&lt;br /&gt;
   qqq() :-&lt;br /&gt;
      ppp(g(), X, 17).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unification of the &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt;-call with the &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt;-clause is possible with the following unifier:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Z = X = g()&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; have the flow &amp;lt;vp&amp;gt;(i,o,i)&amp;lt;/vp&amp;gt; then the unification is just a match:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt; is input as the first argument, this is bound to &amp;lt;vp&amp;gt;Z&amp;lt;/vp&amp;gt;&lt;br /&gt;
*The second argument in the clause is therefore bound and can thus be output to &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt;, which therefore becomes bound to &amp;#039;&amp;#039;&amp;lt;vp&amp;gt;g()&amp;lt;/vp&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
*finally the third argument is &amp;lt;vp&amp;gt;17&amp;lt;/vp&amp;gt; used as input this number is simply compared to the third argument in the clause.&lt;br /&gt;
&lt;br /&gt;
It is the flow-pattern that makes it possible to predict that the clause does not need real unification.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Nested Function Calls ===&lt;br /&gt;
&lt;br /&gt;
Terms that have to be unified or matched with each other are allowed to contain sub-terms that are actually expressions or function calls that have to be evaluated before the unification/matching can be completed.&lt;br /&gt;
&lt;br /&gt;
The evaluation of such sub-terms is done on a by-need basis.&lt;br /&gt;
&lt;br /&gt;
In a predicate call all input arguments are evaluated before the predicate is called, all output arguments are variables, which does not need evaluation.&lt;br /&gt;
&lt;br /&gt;
Clause heads can also contain terms that have to be evaluated, before matching/unification can be determined.&lt;br /&gt;
&lt;br /&gt;
*all matching/unification that does not require any evaluation is performed before any evaluation is performed;&lt;br /&gt;
*then evaluation corresponding to input arguments is performed one by one left-to-right. Comparing each value to the corresponding input after each evaluation;&lt;br /&gt;
*then the clause body is evaluated;&lt;br /&gt;
*then the output arguments are evaluated (left-to-right);&lt;br /&gt;
*then the return value (if the predicate is a function) is evaluated.&lt;br /&gt;
&lt;br /&gt;
If any of these &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;fail&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; then the rest of the evaluation is not carried out.&lt;br /&gt;
&lt;br /&gt;
All in all the base principles are:&lt;br /&gt;
&lt;br /&gt;
*input after other match, before body evaluation&lt;br /&gt;
*output after body evaluation&lt;br /&gt;
*left-to-right&lt;br /&gt;
&lt;br /&gt;
=== Fact Variable Assignment ===&lt;br /&gt;
&lt;br /&gt;
Assign operator &amp;lt;vp&amp;gt;:=&amp;lt;/vp&amp;gt; is used to assign a new value for a {{lang2|Facts|Fact_Variable_Declarations|fact variable}} &amp;lt;vpbnf&amp;gt;&amp;lt;FactVariable&amp;gt;&amp;lt;/vpbnf&amp;gt;. The &amp;lt;vpbnf&amp;gt;&amp;lt;Term&amp;gt;&amp;lt;/vpbnf&amp;gt; must be evaluated to a value of suitable type (i.e. the same type as the fact variable, or a subtype).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;FactVariableAssignment&amp;gt;:&lt;br /&gt;
    &amp;lt;FactVariable&amp;gt; := &amp;lt;Term&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Facts ===&lt;br /&gt;
&lt;br /&gt;
A fact database contains a number of fully instantiated (grounded) predicate heads corresponding to the facts from the facts section declaration. The facts can be accessed by a predicate call, using the fact name as the predicate name. The predicate call is matched against each fact in turn; succeeding with a possible backtrack point to the next fact each time the predicate call match the fact. When there are no more facts in the fact database then the predicate call fails.&lt;br /&gt;
&lt;br /&gt;
New facts can be &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;asserted&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; using the predicates {{lang2|Built-in_entities|assert|assert/1}}, {{lang2|Built-in_entities|asserta|asserta/1}}, and {{lang2|Built-in_entities|assertz|assertz/1}}. {{lang2|Built-in_entities|assert|assert/1}} is the same as {{lang2|Built-in_entities|assertz|assertz/1}} and it asserts a new fact to the end of the list of facts, whereas {{lang2|Built-in_entities|asserta|asserta/1}} asserts a new fact to the start of the list.&lt;br /&gt;
&lt;br /&gt;
Existing facts can be &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;retracted&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; with the predicate {{lang2|Built-in_entities|retract|retract/1}} and {{lang2|Built-in_entities|retractall|retractAll/1}}. {{lang2|Built-in_entities|retract|retract/1}} retracts the first fact that match the argument binding variables in the argument and leaving a backtrack point so that more facts will potentially be retracted when backtracking.&lt;br /&gt;
&lt;br /&gt;
{{lang2|Built-in_entities|retractall|retractAll/1}} retracts all facts that matches the arguments and succeeds without any binding.&lt;br /&gt;
&lt;br /&gt;
=== Operators ===&lt;br /&gt;
&lt;br /&gt;
Operators are organized in a precedence hierarchy. In the rule below operators in each group have same precedence, which is higher than those below. I.e. the power operator has higher precedence than unary minus and plus, which in turn has higher precedence than the multiplication operators, etc. Parenthesis can be used to circumvent the precedence (and for clarification).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Operator&amp;gt;: one of&lt;br /&gt;
    &amp;lt;PowerOperator&amp;gt;&lt;br /&gt;
    &amp;lt;UnaryOperator&amp;gt;&lt;br /&gt;
    &amp;lt;MultiplicationOperator&amp;gt;&lt;br /&gt;
    &amp;lt;AdditionOperator&amp;gt;&lt;br /&gt;
    &amp;lt;OtherwiseOperator&amp;gt;&lt;br /&gt;
    &amp;lt;RelationOperator&amp;gt;&lt;br /&gt;
    &amp;lt;MustUnifyOperator&amp;gt;&lt;br /&gt;
    &amp;lt;InOperator&amp;gt;&lt;br /&gt;
    &amp;lt;AndOperator&amp;gt;&lt;br /&gt;
    &amp;lt;OrOperator&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;UnaryOperator&amp;gt;: one of&lt;br /&gt;
    - +&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All operators except the &amp;lt;vpbnf&amp;gt;&amp;lt;UnaryOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;&amp;#039;s are binary.  The power operator is right associative, all other operators are left associative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vpbnf&amp;gt;&amp;lt;RelationOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;, &amp;lt;vpbnf&amp;gt;&amp;lt;MustUnifyOperator&amp;gt;&amp;lt;/vpbnf&amp;gt; and &amp;lt;vpbnf&amp;gt;&amp;lt;InOperator&amp;gt;&amp;lt;/vpbnf&amp;gt; have same precedence.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Notice&amp;#039;&amp;#039;&amp;#039; that the placement &amp;lt;vpbnf&amp;gt;&amp;lt;UnaryOperator&amp;gt;&amp;lt;/vpbnf&amp;gt; is not consistent with mathematics, where these operators are at the same level as the &amp;lt;vpbnf&amp;gt;&amp;lt;AdditionalOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;&amp;#039;s.  The difference has no influence of the calculated value, but it allows writing &amp;lt;vp&amp;gt;2*-2&amp;lt;/vp&amp;gt;, where mathematics would require a parenthesis around the second operator &amp;lt;vp&amp;gt;2*(-2)&amp;lt;/vp&amp;gt;.  It also means that &amp;lt;vp&amp;gt;-2*2&amp;lt;/vp&amp;gt; is mmeans (-2)*2 where it would be &amp;lt;vp&amp;gt;-(2*2)&amp;lt;/vp&amp;gt; in mathematics (the resulting value is the same).&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vp&amp;gt;-2^2&amp;lt;/vp&amp;gt; is the same as &amp;lt;vp&amp;gt;-(2^2)&amp;lt;/vp&amp;gt; because ^ has higher precedence than unary minus.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vp&amp;gt;3^2^2&amp;lt;/vp&amp;gt; is the same as &amp;lt;vp&amp;gt;3^(2^2)&amp;lt;/vp&amp;gt; because ^ is right associative.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vp&amp;gt;-2*-3^-4+5&amp;lt;/vp&amp;gt; is the same as &amp;lt;vp&amp;gt;((-2) * (-(3 ^ (-4)))) + 5&amp;lt;/vp&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example| The following term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;7 + 3 * 5 * 13 + 4 + 3 = X / 6 ; A &amp;lt; 7,  p(X)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
has the same meaning as this term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;((((7 + ((3 * 5) * 13)) + 4) + 3) = (X / 6)) ; ((A &amp;lt; 7) , p(X))&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I.e. at outermost level the term is an &amp;quot;&amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;&amp;quot; of two terms, the first of these is a relational (&amp;lt;vp&amp;gt;=&amp;lt;/vp&amp;gt;) term, the second is an &amp;quot;&amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt;&amp;quot; term, etc.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
&lt;br /&gt;
The arithmetic operators are used for arithmetic operations on numbers. They are expressions, which takes expressions as arguments. They have root types as arguments and return universal types as result. (See {{lang2|Domains|Universal_and_Root_Types|Universal and Root types}}.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;PowerOperator&amp;gt;:&lt;br /&gt;
    ^&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;MultiplicationOperator&amp;gt;: one of&lt;br /&gt;
    * / div mod quot rem&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;AdditionOperator&amp;gt;: one of&lt;br /&gt;
    +  -&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Relational Operators ===&lt;br /&gt;
&lt;br /&gt;
The relational operators are formulas, which takes expressions as arguments. Given this nature they are non-associative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;RelationOperator&amp;gt;: one of&lt;br /&gt;
  =   &amp;gt;   &amp;lt;   &amp;gt;=   &amp;lt;=   &amp;lt;&amp;gt;   &amp;gt;&amp;lt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the left term is evaluated, then the right term is evaluated and then the results are compared.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Notice&amp;#039;&amp;#039;&amp;#039; that &amp;lt;vp&amp;gt;&amp;lt;&amp;gt;&amp;lt;/vp&amp;gt; (different) is not the dual operation of = (equal). &amp;lt;vp&amp;gt;&amp;lt;&amp;gt;&amp;lt;/vp&amp;gt; compares two values, whereas &amp;lt;vp&amp;gt;=&amp;lt;/vp&amp;gt; tries to unify two terms (in the general case at least).&lt;br /&gt;
&lt;br /&gt;
The dual to expression &amp;lt;vp&amp;gt;A = B&amp;lt;/vp&amp;gt; is &amp;lt;vp&amp;gt;not (A = B)&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Must Unify Operator ====&lt;br /&gt;
&lt;br /&gt;
The must unify operator is a procedure, which takes expressions as arguments. It is non-associative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;MustUnifyOperator&amp;gt;:&lt;br /&gt;
  ==&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vpbnf&amp;gt;A == B&amp;lt;/vpbnf&amp;gt; unifies &amp;lt;vpbnf&amp;gt;A&amp;lt;/vpbnf&amp;gt; and &amp;lt;vpbnf&amp;gt;B&amp;lt;/vpbnf&amp;gt;; if the unification fails an exception is raised, otherwise the predicate succeeds.  Therefore &amp;lt;vpbnf&amp;gt;A == B&amp;lt;/vpbnf&amp;gt; always succeeds.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    p(L) :-&lt;br /&gt;
        [H|T] == L,&lt;br /&gt;
        ...&amp;lt;/vip&amp;gt;&lt;br /&gt;
&amp;lt;vp&amp;gt;p&amp;lt;/vp&amp;gt; is a procedure. An exception will be raised if it is called with an empty list, because &amp;lt;vp&amp;gt;[H|T]&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt; cannot unify.}}&lt;br /&gt;
&lt;br /&gt;
=== Logical Operators ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vpbnf&amp;gt;&amp;lt;AndOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;(s) and &amp;lt;vpbnf&amp;gt;&amp;lt;OrOperator&amp;gt;&amp;lt;/vpbnf&amp;gt;(s) are formulas, which takes formulas as arguments. They are all left associative. The &amp;lt;vp&amp;gt;,&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;and &amp;lt;/vp&amp;gt; are synonyms and so are &amp;lt;vp&amp;gt;; &amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;AndOperator&amp;gt;: one of&lt;br /&gt;
 ,   and&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;OrOperator&amp;gt;: one of&lt;br /&gt;
  ;  or orelse&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== and (,) ====&lt;br /&gt;
&lt;br /&gt;
The evaluation of an &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term &amp;lt;vp&amp;gt;A, B&amp;lt;/vp&amp;gt; proceeds as follows. First the left sub-term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is evaluated. If this evaluation fails, the whole &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term fails. If &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds then the right sub-term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is evaluated. If this evaluation fails, the whole &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term fails, otherwise the &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term succeeds.&lt;br /&gt;
&lt;br /&gt;
Thus the second sub-term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is only evaluated, if the first sub-term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp() :-&lt;br /&gt;
       qqq(), rrr().&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is called it will first call &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; and if &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; succeeds, then it will call &amp;lt;vp&amp;gt;rrr&amp;lt;/vp&amp;gt;. If &amp;lt;vp&amp;gt;rrr&amp;lt;/vp&amp;gt; succeeds, then the &amp;lt;vp&amp;gt;and&amp;lt;/vp&amp;gt; term and subsequently the whole clause succeeds.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== or (;) ====&lt;br /&gt;
&lt;br /&gt;
The evaluation of an &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt;; &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; proceeds as follows. First a backtrack point to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is created and then the first term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is evaluated. If the evaluation of the first term succeeds, then the whole &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; term succeeds and is left with a backtrack to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt;. If the evaluation of the first term fails, the backtrack point to the second term is activated.&lt;br /&gt;
&lt;br /&gt;
If the backtrack point to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is activated (either because the first term fails, or because something later in the execution invokes the backtrack point), then the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is evaluated and the whole &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; term will succeed if &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
Thus an &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; term can succeed with a backtrack point and the second sub-term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is only evaluated on backtrack.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp() :-&lt;br /&gt;
       (V = 3 or V = 7), write(V), fail.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we have used the keyword &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;, but you can also use semi-colon &amp;lt;vp&amp;gt;;&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is called we first create a backtrack point to the term &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; and then we evaluate &amp;lt;vp&amp;gt;V = 3&amp;lt;/vp&amp;gt;. Thereby &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; will be bound to &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt; we then continue to the &amp;lt;vp&amp;gt;write(V)&amp;lt;/vp&amp;gt; after &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt; has been written &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; is met. &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; always fails so we effectuate the backtrack point leading us to the term &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Backtracking also undo all bindings made since the backtrack point was created. In this case it means that &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; is unbound.&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; is evaluated and &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; becomes bound to &amp;lt;vp&amp;gt;7&amp;lt;/vp&amp;gt; and er continue to the term &amp;lt;vp&amp;gt;write(V)&amp;lt;/vp&amp;gt;, and then &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; is met again, this time there are no more backtrack points &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; fails.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Using parentheses &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; can be nested deeply in clauses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   p(X) = Y :-&lt;br /&gt;
       (X = 1, !, Z = 3 or Z = 7), Y = 2*Z.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We recommend careful usage of &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;. It is mainly intended for usage in test-conditions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   isOutside(X) :-&lt;br /&gt;
       (X &amp;lt; 10 or X &amp;gt; 90), !.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt; is a nondeterministic construction, but &amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; can be used as a deterministic pendand:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   isOutside(X) :-&lt;br /&gt;
       X &amp;lt; 10 orelse X &amp;gt; 90.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== orelse ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; is a deterministic pendant to the nondeterministic &amp;lt;vp&amp;gt;or&amp;lt;/vp&amp;gt;.  &amp;lt;vp&amp;gt;A orelse B&amp;lt;/vp&amp;gt; will succeed if &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds or if &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; succeeds, but it will &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; leave a backtrack point to &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; if &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
The evaluation of an &amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; term &amp;lt;vp&amp;gt;A orelse B&amp;lt;/vp&amp;gt; proceeds as follows: First a backtrack point to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is created and then the first term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is evaluated. If the evaluation of the first term succeeds then the backtrack to the second term (and any backtrack point within it) &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; are removed again and the whole &amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; term succeeds. If the evaluation of the first term &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; fails, the backtrack point to the second term &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is evaluated.&lt;br /&gt;
&lt;br /&gt;
So an &amp;lt;vp&amp;gt;orelse&amp;lt;/vp&amp;gt; term does not leave a backtrack point.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp(V) :-&lt;br /&gt;
       (V = 3 orelse V = 7), write(V).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is called we first create a backtrack point to the term &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; and then we evaluate the term &amp;lt;vp&amp;gt;V = 3&amp;lt;/vp&amp;gt;, if &amp;lt;vp&amp;gt;V = 3&amp;lt;/vp&amp;gt; succeeds we remove the backtrack point to &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; again and then continue to &amp;lt;vp&amp;gt;write(V)&amp;lt;/vp&amp;gt;.  If &amp;lt;vp&amp;gt;V = 3&amp;lt;/vp&amp;gt; fails the backtrack point to &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; is effectuated.  If &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; succeeds we continue to &amp;lt;vp&amp;gt;write(V)&amp;lt;/vp&amp;gt;, if &amp;lt;vp&amp;gt;V = 7&amp;lt;/vp&amp;gt; fails the entire &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; predicate will fail.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== otherwise ====&lt;br /&gt;
&lt;br /&gt;
{{Template:NonReleased}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;otherwise&amp;lt;/vp&amp;gt; is an expression operator; though it has control flow that makes it resemble the logical operators. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;A otherwise B&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an expression (&amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt;) must be expressions).  If the evaluation of &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds by evaluating to the value VA then &amp;lt;vp&amp;gt;A otherwise B&amp;lt;/vp&amp;gt; evaluates to VA, otherwise (i.e. if the evaluation of &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; fails) then &amp;lt;vp&amp;gt;A otherwise B&amp;lt;/vp&amp;gt; will be trh result of evaluating &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;otherwise&amp;lt;/vp&amp;gt; is right associative:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;A otherwise B otherwise C&lt;br /&gt;
=&amp;gt;&lt;br /&gt;
A otherwise (B otherwise C)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It has lower precedence than all other expression operators, but higher than relational operators:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;V &amp;lt; A + tryGet() otherwise 9&lt;br /&gt;
=&amp;gt;&lt;br /&gt;
V &amp;lt; ((A + tryGet()) otherwise 9)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;core&amp;lt;/vp&amp;gt; have been enriched with a predicate &amp;lt;vp&amp;gt;isSome&amp;lt;/vp&amp;gt; for providing default values for &amp;lt;vp&amp;gt;core::optional&amp;lt;/vp&amp;gt; matching:&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;V = isSome(Optional) otherwise 0&amp;lt;/vip&amp;gt;&lt;br /&gt;
If &amp;lt;vp&amp;gt;Optional&amp;lt;/vp&amp;gt; have the form &amp;lt;vp&amp;gt;some(X)&amp;lt;/vp&amp;gt; then &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; will get the value &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; otherwise &amp;lt;vp&amp;gt;V&amp;lt;/vp&amp;gt; will get the value &amp;lt;vp&amp;gt;0&amp;lt;/vp&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
==== not ====&lt;br /&gt;
&lt;br /&gt;
The {{lang2|Built-in_entities|not|not/1}} takes a term as the argument. The evaluation of &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; first evaluates &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt;. If &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; succeeds, then &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; fails, if &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; fails, then &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
Notice that &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; will never bind any variables, because if &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; succeeds then &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; has failed, and a failed term does not bind anything. If &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; on the other hand fails, it cannot bind any variables either, because then the term itself failed.&lt;br /&gt;
&lt;br /&gt;
Also notice that &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; can never succeed with backtrack points, because if &amp;lt;vp&amp;gt;not(A)&amp;lt;/vp&amp;gt; succeeds then &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; have failed, and a failed term cannot contain any backtrack points. This in turn means that all possibilities of success in &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; have been exhausted.&lt;br /&gt;
&lt;br /&gt;
==== Cut ====&lt;br /&gt;
&lt;br /&gt;
Cut &amp;quot;&amp;lt;vp&amp;gt;!&amp;lt;/vp&amp;gt;&amp;quot; removes all backtrack points created since the entrance to the current predicate, this means all backtrack points to subsequent clauses, plus backtrack points in predicate calls made in the current clause before the &amp;quot;&amp;lt;vp&amp;gt;!&amp;lt;/vp&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Cut&amp;gt;:&lt;br /&gt;
    !&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp(X) :-&lt;br /&gt;
       X &amp;gt; 7,&lt;br /&gt;
       !,&lt;br /&gt;
       write(&amp;quot;Greater than seven&amp;quot;).&lt;br /&gt;
   ppp(_X) :-&lt;br /&gt;
       write(&amp;quot;Not greater than seven&amp;quot;).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is executed, there is first created a backtrack point to the second clause, and then the first clause is executed. If the test &amp;quot;&amp;lt;vp&amp;gt;X &amp;gt; 7&amp;lt;/vp&amp;gt;&amp;quot; succeeds then the cut &amp;quot;&amp;lt;vp&amp;gt;!&amp;lt;/vp&amp;gt;&amp;quot; is reached. This cut &amp;quot;&amp;lt;vp&amp;gt;!&amp;lt;/vp&amp;gt;&amp;quot; will remove the backtrack point to the second clause.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   ppp() :-&lt;br /&gt;
       qqq(X),&lt;br /&gt;
       X &amp;gt; 7,&lt;br /&gt;
       !,&lt;br /&gt;
       write(&amp;quot;Found one&amp;quot;).&lt;br /&gt;
   ppp() :-&lt;br /&gt;
       write(&amp;quot;Did not find one&amp;quot;).&lt;br /&gt;
clauses&lt;br /&gt;
   qqq(3).&lt;br /&gt;
   qqq(12).&lt;br /&gt;
   qqq(13).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; is executed it first creates a backtrack point to the second &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; clause and then &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; is called. The &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; will create a backtrack point to the second &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; clause and execute the first clause, thereby returning the value &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt;. In &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt; variable &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is bound to this value and then compared to &amp;lt;vp&amp;gt;7&amp;lt;/vp&amp;gt;. This test fails and, therefore, the control backtracks to the second clause of &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before executing the second clause a new backtrack point to the third clause of &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; is created and then the second clause returns &amp;lt;vp&amp;gt;12&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This time the test against &amp;lt;vp&amp;gt;7&amp;lt;/vp&amp;gt; succeeds and, therefore, the cut is executed. This cut will remove both the backtrack point left in &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; as well as the backtrack point to the second clause of &amp;lt;vp&amp;gt;ppp&amp;lt;/vp&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== Cut Scopes =====&lt;br /&gt;
&lt;br /&gt;
A cut scope is a scope to which the effect of a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is limited. Meaning that if a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is met within a cut scope then only backtrack points within that scope are discarded, while backtrack points outside (i.e. prior to) the cut scope remains.&lt;br /&gt;
&lt;br /&gt;
The clauses of a predicate is a cut scope. Meeting a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; will (at most) discard the backtrack points that was created after entrance to the predicate.  Backtrack points created before entrance to the predicate will remain.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
   aaa() :- p1_nd(), qqq().&lt;br /&gt;
   qqq() :- p2_nd(), !.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;aaa&amp;lt;/vp&amp;gt; calls &amp;lt;vp&amp;gt;p1_nd&amp;lt;/vp&amp;gt;, which leaves a backtrack point, and then it calls &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt;. &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; calls &amp;lt;vp&amp;gt;p2_nd&amp;lt;/vp&amp;gt;, which also leaves a backtrack point. Then we meet a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt;. This &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is in the &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt;-scope of the &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; predicate, so it is only the backtrack point in &amp;lt;vp&amp;gt;p2_nd&amp;lt;/vp&amp;gt; which is discarded, the one in &amp;lt;vp&amp;gt;p1_nd&amp;lt;/vp&amp;gt; remains.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Several terms introduce cut scopes (see the respective terms: {{lang2|Terms|List_Comprehension|list comprehension}}, {{lang2|Terms|if-then-else|if-then-else}}, {{lang2|Terms|foreach|foreach}}). Here we will use &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; to illustrate the effect of cut scopes.  Consider the schematic &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;if Cond then T1 else T2 end if&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The condition &amp;lt;vp&amp;gt;Cond&amp;lt;/vp&amp;gt; is a cut-scope, meaning that a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; inside &amp;lt;vp&amp;gt;Cond&amp;lt;/vp&amp;gt; will only have effect inside &amp;lt;vp&amp;gt;Cond&amp;lt;/vp&amp;gt;. &amp;lt;vp&amp;gt;Cut&amp;lt;/vp&amp;gt;s inside &amp;lt;vp&amp;gt;T1&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;T2&amp;lt;/vp&amp;gt;, on the other hand, have effect outside the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; statement.&lt;br /&gt;
&lt;br /&gt;
Consider this code fragment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;X = getMember_nd([3,1,2]),&lt;br /&gt;
if X = getMember_nd([3,3]), ! then&lt;br /&gt;
   write(X)&lt;br /&gt;
else&lt;br /&gt;
   !&lt;br /&gt;
end if,&lt;br /&gt;
fail&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt; is a nondeterministic predicate. The evaluation of this code will go as follows. First &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is bound to &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt; leaves a backtrack point (so that &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; can later become &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt; and then even &amp;lt;vp&amp;gt;2&amp;lt;/vp&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Then we evaluate the condition in the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term. The first part of this condition succeeds as &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt; is a member of &amp;lt;vp&amp;gt;[3,3]&amp;lt;/vp&amp;gt;. The first part also leaves a backtrack point, so that it can be examined whether &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is a member several times.&lt;br /&gt;
&lt;br /&gt;
Now we meet a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt;. This &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is inside the condition part of an &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; statement, so it only has local effect, meaning that it only discards the backtrack point in the second &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt;, but leaves the backtrack point in the first &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt; predicate.&lt;br /&gt;
&lt;br /&gt;
The whole condition succeeds and we enter the then-part and write out &amp;quot;&amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
After the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; we meet &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt;, which backtracks us to the first &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt; then binds &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;, and leaves a backtrack point (so that &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; can later become &amp;lt;vp&amp;gt;2&amp;lt;/vp&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Then we evaluate the condition in the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term. The first part of this condition fails as &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt; is not a member of &amp;lt;vp&amp;gt;[3,3]&amp;lt;/vp&amp;gt;. So we enter the &amp;lt;vp&amp;gt;else&amp;lt;/vp&amp;gt;-part.&lt;br /&gt;
&lt;br /&gt;
Here we meet a &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt;. This &amp;lt;vp&amp;gt;cut&amp;lt;/vp&amp;gt; is in the &amp;lt;vp&amp;gt;else&amp;lt;/vp&amp;gt;-part of a conditional term so it has effect outside the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term and subsequently it discards the backtrack point in the first &amp;lt;vp&amp;gt;getMember_nd&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When we meet the &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; after the &amp;lt;vp&amp;gt;if-then-else&amp;lt;/vp&amp;gt; term there are no more backtrack points in the code and it will fail. So all in all &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; never becomes &amp;lt;vp&amp;gt;2&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== fail/0 and succeed/0 ====&lt;br /&gt;
&lt;br /&gt;
{{lang2|Built-in_entities|fail|fail/0}} and {{lang2|Built-in_entities|succeed|succeed/0}} are two built-in nullary predicates. {{lang2|Built-in_entities|fail|fail/0}} always fails and {{lang2|Built-in_entities|succeed|succeed/0}} always succeeds, besides this the predicates have no effect.&lt;br /&gt;
&lt;br /&gt;
=== in ===&lt;br /&gt;
{{:Language Reference/Terms/in}}&lt;br /&gt;
=== List Comprehension ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;ListComprehensionTerm&amp;gt; :&lt;br /&gt;
    [ &amp;lt;Term&amp;gt; || &amp;lt;Term&amp;gt; ]&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list comprehension term is a list expression. Consider this schematic term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;[ Exp || Gen ]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt; is (typically) a &amp;lt;vp&amp;gt;nondeterm&amp;lt;/vp&amp;gt; term. &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt; is evaluated for each solution of &amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt;, and the resulting &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt;&amp;#039;s are collected in a list. The &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt; corresponding to the first solution of &amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt; is the first element in the list, etc. This list is the result of the list comprehension term. &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt; must be procedure (or erroneous). Both &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt; are {{lang2|Terms|Cut_Scopes|cut scopes}}.&lt;br /&gt;
&lt;br /&gt;
The list comprehension (normally) reads: The list of &amp;lt;vp&amp;gt;Exp&amp;lt;/vp&amp;gt;&amp;#039;s such that &amp;lt;vp&amp;gt;Gen&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;[ X || X = getMember_nd(L), X mod 2 = 0 ]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This reads the list of &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt;&amp;#039;s such that &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is in &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is even. So this expression is the even numbers of &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;[ X + 1 || X = getMember_nd(L), X mod 2 = 0 ]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the collected expression is more complex. This makes say the term more awkward:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;the list of (X+1)&amp;#039;s such that ...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This expression again finds the even elements in &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt;, but the resulting list contains all these values incremented.&lt;br /&gt;
&lt;br /&gt;
This term is completely equivalent to this term:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;[ Y || X = getMember_nd(L), X mod 2 = 0 , Y = X+1 ]&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This term is easier to say:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;The list of Y&amp;#039;s such that (there exists an) X which is member of L, and which is even, and Y is X+1.&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Anonymous Predicates ===&lt;br /&gt;
{{:Language Reference/Terms/Anonymous Predicates}}&lt;br /&gt;
=== Object Member Access ===&lt;br /&gt;
&lt;br /&gt;
Whenever we have a reference to an object, we can access the object member predicates of that object.&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;MemberAccess&amp;gt;:&lt;br /&gt;
    &amp;lt;Term&amp;gt; : &amp;lt;Identifier&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Currently, the {{lang|Terms|term}} must be a variable or a fact variable).&lt;br /&gt;
&lt;br /&gt;
The {{lang2|Lexical_Elements|Identifiers|identifier}} must have the type of the {{lang|Terms|term}}.&lt;br /&gt;
&lt;br /&gt;
Inside an implementation object member predicates can be invoked without reference to an object, because &amp;quot;&amp;lt;vp&amp;gt;This&amp;lt;/vp&amp;gt;&amp;quot; is subsumed, see {{lang2|Basic_Concepts|Scoping_&amp;amp;_Visibility|Scoping}}.&lt;br /&gt;
&lt;br /&gt;
=== Domain, Functor, and Constant Access ===&lt;br /&gt;
&lt;br /&gt;
Domains, functors, and constants are all accessed as if they are class members. Even if they are declared in an interface. This means that when they are qualified, then they are always qualified with class/interface name and a double colon.&lt;br /&gt;
&lt;br /&gt;
=== foreach ===&lt;br /&gt;
{{:Language Reference/Terms/Foreach}}&lt;br /&gt;
=== if-then-else ===&lt;br /&gt;
{{:Language Reference/Terms/If-then-else}}&lt;br /&gt;
=== try-catch-finally ===&lt;br /&gt;
{{:Language Reference/Terms/Try-catch-finally}}&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Predicates&amp;diff=4277</id>
		<title>Language Reference/Built-in entities/Predicates</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Predicates&amp;diff=4277"/>
		<updated>2016-04-06T08:58:23Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: /* toBoolean */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;__NOTOC__&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#and_.28.2C.29|and/2]] &amp;lt;br&amp;gt; [[Language_Reference/Terms#and_.28.2C.29|,/2]]&lt;br /&gt;
|Term &amp;quot;and&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[#assert|assert/1]]&lt;br /&gt;
|Insert the specified fact at the end of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#asserta|asserta/1]]&lt;br /&gt;
|Insert a fact at the beginning of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#assertz|assertz/1]]&lt;br /&gt;
|Insert a fact at the end of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#bound|bound/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Test whether the specified variable is bound to a value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#class_name|class_name/0-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;ClassName&amp;#039;&amp;#039; that represents the name of the current interface or class.&lt;br /&gt;
|-&lt;br /&gt;
|[[#compare|compare/2-&amp;gt;]]&lt;br /&gt;
|Returns the result of the variables&amp;#039; comparison.&lt;br /&gt;
|-&lt;br /&gt;
|[[#convert|convert/2-&amp;gt;]]&lt;br /&gt;
|Checked term conversion.&lt;br /&gt;
|-&lt;br /&gt;
|[[#digitsOf|digitsOf/1-&amp;gt;]]&lt;br /&gt;
|Returns precision of the specified floating-point domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#errorExit|errorExit/1]] &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Performs a run-time error with the specified return code &amp;#039;&amp;#039;ErrorNumber&amp;#039;&amp;#039; and sets the internal error information.&lt;br /&gt;
|-&lt;br /&gt;
|[[#fail|fail/0]] &amp;lt;vp&amp;gt;failure&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Invoke backtracking.&lt;br /&gt;
|-&lt;br /&gt;
|[[#free|free/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Check whether a variable is free.&lt;br /&gt;
|-&lt;br /&gt;
|[[#fromEllipsis|fromEllipsis/1-&amp;gt;]]&lt;br /&gt;
|Creates the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; from the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#hasDomain|hasDomain/2]] &amp;lt;br&amp;gt; [[#hasDomain|hasDomain/2-&amp;gt;]]&lt;br /&gt;
|Declares/restricts the type of a variable or value.&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#in|in/2]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt; &amp;lt;br&amp;gt; [[Language_Reference/Terms#in|in/2]] &amp;lt;vp&amp;gt;nondeterm&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Infix operator &amp;quot;in&amp;quot; (in-test and in-iterator).&lt;br /&gt;
|-&lt;br /&gt;
|[[#isErroneous|isErroneous/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Returns the lower bound value of the specified numeric domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#lowerBound|lowerBound/1-&amp;gt;]]&lt;br /&gt;
|Returns the lower bound value of the specified numeric domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#maxDigits|maxDigits/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the value of digits (precision) of the basic domain corresponding to the specified floating-point domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#not|not/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Negate the result (success/fail) of subgoal.&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#or_.28.3B.29|or/2]] &amp;lt;br&amp;gt; [[Language_Reference/Terms#and_.28.3B.29|;/2]]&lt;br /&gt;
|Nondeterministic term &amp;quot;or&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#orelse|orelse]]&lt;br /&gt;
|Deterministic term &amp;quot;or&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[#predicate_fullname|predicate_fullname/1-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;PredicateFullName&amp;#039;&amp;#039; that represent the name of the predicate in which clause body &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; is called. The returned predicate name is qualified with a scope name.&lt;br /&gt;
|-&lt;br /&gt;
|[[#predicate_name|predicate_name/1-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;PredicateName&amp;#039;&amp;#039; that represent the name of the predicate in which clause body &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; is called. The returned predicate name is not qualified with a scope name.&lt;br /&gt;
|-&lt;br /&gt;
|[[#programPoint|programPoint/0-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the &amp;lt;vp&amp;gt;programPoint&amp;lt;/vp&amp;gt; corresponding to the place where it is called.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retract|retract/1]] &amp;lt;vp&amp;gt;nondeterm&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Remove a matched fact from the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retractall|retractall/1]]&lt;br /&gt;
|Remove all matching facts from the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retractFactDb|retractFactDb/1]]&lt;br /&gt;
|Remove all facts from the specified named internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeBitsOf|sizeBitsOf/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bits occupied in memory by an entity of the specified domain &amp;#039;&amp;#039;DomainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeOf|sizeOf/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bytes occupied in memory by the specified term.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeOfDomain|sizeOfDomain/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bytes occupied in memory by the entity of the specified domain &amp;#039;&amp;#039;DomainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_lineno|sourcefile_lineno/0-&amp;gt;]]&lt;br /&gt;
|Returns the current line number in the source file processed by the compiler .&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_name|sourcefile_name/0-&amp;gt;]]&lt;br /&gt;
|Returns the name of the source file processed by the compiler.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_timestamp|sourcefile_timestamp/0-&amp;gt;]]&lt;br /&gt;
|Returns the string representing the date and time of the source file processed by the compiler.&lt;br /&gt;
|-&lt;br /&gt;
|[[#succeed|succeed/0]]&lt;br /&gt;
|The predicate &amp;lt;vp&amp;gt;succeed/0&amp;lt;/vp&amp;gt; will always succeed.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toAny|toAny/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; to the value of the universal term type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toBinary|toBinary/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified Term to the binary representation.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toBoolean|toBoolean/1-&amp;gt;]]&lt;br /&gt;
|The purpose of this meta-predicate is to convert the deterministic call (to a predicate or fact) to the procedure that returns the value of &amp;lt;vp&amp;gt;boolean&amp;lt;/vp&amp;gt; domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toEllipsis|toEllipsis/1-&amp;gt;]]&lt;br /&gt;
|Creates the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; from the list of &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; type values.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toString|toString/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; to the string representation.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toTerm|toTerm/1-&amp;gt;]] &amp;lt;br&amp;gt; [[#toTerm|toTerm/2-&amp;gt;]]&lt;br /&gt;
|Converts the string/binary representation of the specified term &amp;#039;&amp;#039;SrcTerm&amp;#039;&amp;#039; into representation corresponding to the domain of &amp;#039;&amp;#039;PrologTerm&amp;#039;&amp;#039; variable of the return value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#tryToTerm|tryToTerm/1-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt; &amp;lt;br&amp;gt; [[#tryToTerm|tryToTerm/2-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Converts the string/binary representation of the specified term &amp;#039;&amp;#039;SrcTerm&amp;#039;&amp;#039; into representation corresponding to the domain of &amp;#039;&amp;#039;PrologTerm&amp;#039;&amp;#039; variable of the return value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#tryConvert|tryConvert/2-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Checks whether the input term &amp;#039;&amp;#039;InputTerm&amp;#039;&amp;#039; can be strictly converted into the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; and returns the converted term &amp;#039;&amp;#039;ReturnTerm&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]]&lt;br /&gt;
|Unchecked conversion of domains.&lt;br /&gt;
|-&lt;br /&gt;
|[[#upperBound|upperBound/1-&amp;gt;]]&lt;br /&gt;
|Returns the upper bound value of the specified numeric domain.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following predicates are deprecated:&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
| finally/2&lt;br /&gt;
| Use [[Language_Reference/Terms#try-finally| &amp;lt;vp&amp;gt;try-finally&amp;lt;/vp&amp;gt;]] constuction instead.&lt;br /&gt;
|-&lt;br /&gt;
| findall/3&lt;br /&gt;
| Use list comprehension [[Language_Reference/Terms#List_Comprehension| &amp;lt;vp&amp;gt;[ ... || ...  ]&amp;lt;/vp&amp;gt;]] instead&lt;br /&gt;
|-&lt;br /&gt;
| trap/3 &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
| Use [[Language_Reference/Terms#try-catch| &amp;lt;vp&amp;gt;try-catch&amp;lt;/vp&amp;gt;]] constuction instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== and ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#and_.28.2C.29|and (,)]].&lt;br /&gt;
&lt;br /&gt;
==== assert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;assert : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert the specified fact at the end of the matched internal facts database&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;assert(Fact)&amp;lt;/vp&amp;gt; inserts &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; in the matched internal facts database after any other stored facts for the corresponding database predicate. &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; must be a term belonging to the domain of an internal facts database. &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; applied to a single fact changes the existing instance of a fact to the specified one. &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; has the same effect as [[#assertz|assertz/1]]. See also [[#asserta|asserta/1]].&lt;br /&gt;
&lt;br /&gt;
Notice that the combination of [[#retract|retract/1]] and &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; like the following can lead to endless loop:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;loop() :-&lt;br /&gt;
  retract(fct(X)),&lt;br /&gt;
     ...           % creating Y from X&lt;br /&gt;
     assert(fct(Y)),&lt;br /&gt;
  fail.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem is that the retract in first line will eventually retract the fact asserted in the last line, because that fact is inserted &amp;#039;&amp;#039;last&amp;#039;&amp;#039; in the fact chain.&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Attempt to assert a second instance to a fact declared as determ.&lt;br /&gt;
&lt;br /&gt;
==== asserta ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;asserta : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert a fact at the beginning of the matched internal facts database.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;asserta(Fact)&amp;lt;/vp&amp;gt; predicate inserts a &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; in the matched internal facts database before any other stored facts for the corresponding predicate. The &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; must be a term belonging to the domain of an internal facts database. The &amp;lt;vp&amp;gt;asserta/1&amp;lt;/vp&amp;gt; applied to a single fact changes the existing instance of a fact to the specified one. See also [[#assert|assert/1]] and [[#assertz|assertz/1]].&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Attempt to a fact declared as determ, but the fact instance already exists.&lt;br /&gt;
&lt;br /&gt;
==== assertz ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;assertz : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;assertz&amp;lt;/vp&amp;gt; does exactly the same as the [[#assert|assert/1]] predicate.&lt;br /&gt;
&lt;br /&gt;
==== bound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;bound : (&amp;lt;variable&amp;gt; Variable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test whether the specified variable is bound to a value.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;bound(Variable)&amp;lt;/vp&amp;gt; succeeds if &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is bound and fails if it is free. The &amp;lt;vp&amp;gt;bound&amp;lt;/vp&amp;gt; predicate is used to control flow patterns and to check the binding of reference variables. The &amp;lt;vp&amp;gt;bound&amp;lt;/vp&amp;gt; predicate treats the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; as bound if any of it&amp;#039;s part is instantiated.&lt;br /&gt;
&lt;br /&gt;
See also [[#free|free/1]].&lt;br /&gt;
&lt;br /&gt;
==== class_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class_Name : () -&amp;gt; string ClassName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compile time predicate returns the string &amp;lt;vp&amp;gt;ClassName&amp;lt;/vp&amp;gt; that represents the name of the current interface or class.&lt;br /&gt;
&lt;br /&gt;
==== compare ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;compare : (A Left, A Right) -&amp;gt; compareResult CompareResult.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comparison of two terms of the same domain, resturns the value of [[#compareResult|compareResult]] domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;CompareResult&amp;lt;/vp&amp;gt; = compare(&amp;quot;&amp;lt;vp&amp;gt;bar&amp;lt;/vp&amp;gt;&amp;quot;, &amp;quot;&amp;lt;vp&amp;gt;foo&amp;lt;/vp&amp;gt;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== convert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;convert : (&amp;lt;type&amp;gt; Type, Term) -&amp;gt; &amp;lt;type&amp;gt; Converted.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checked term conversion.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; = convert(returnDomain, &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;returnDomain&amp;lt;/vpbnf&amp;gt;: Specifies a domain to which function &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; converts &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be a name of built-in Visual Prolog domain, an interface domain, a name of such user defined domain that is synonym to one of built-in Visual Prolog domains, a numeric domain, binary and pointer domains. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the value that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; is an expression, then it will be evaluated before the conversion.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned parameter &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; type.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;convert&amp;lt;/vp&amp;gt; predicate performs a clean and genuine conversion of the given &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;, returning a new term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; of the specified new domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;. If &amp;lt;vp&amp;gt;convert&amp;lt;/vp&amp;gt; cannot perform the required conversion, it rises errors. The similar functionality is provided by the [[#tryConvert|tryConvert/2-&amp;gt;]] predicate, but &amp;lt;vp&amp;gt;tryConvert-&amp;gt;&amp;lt;/vp&amp;gt; fails and does not produce any runtime errors if it cannot perform the conversion.&lt;br /&gt;
&lt;br /&gt;
===== Allowed conversions =====&lt;br /&gt;
&lt;br /&gt;
* Between numerical domains.&lt;br /&gt;
* Between interface types.&lt;br /&gt;
* Between [[#string|string]] and [[#symbol|symbol]] domains.&lt;br /&gt;
* From [[#binary|binary]] to [[#pointer|pointer]].&lt;br /&gt;
* For synonyms of mentioned domains.&lt;br /&gt;
* Between [http://wiki.visual-prolog.com/index.php?title=How_To_Remove_Reference_Domains_from_a_Project reference] domains and corresponding non-reference domains.&lt;br /&gt;
&lt;br /&gt;
The contrast to these is [[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]] predicate, which performs an unchecked conversion between terms from any domains, which have the same bit-size.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; (or [[#tryConvert|tryConvert/2-&amp;gt;]]) predicate accomplishes a checked explicit conversion, when the source and target domains are statically known during the compilation. The result of an explicit conversion can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ok&amp;#039;&amp;#039;&amp;#039; the successful conversion to the target domain;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;run-time-check&amp;#039;&amp;#039;&amp;#039; the conversion to the target domain with generation of run-time checking for compatibility;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;error&amp;#039;&amp;#039;&amp;#039; the conversion is impossible, error output.&lt;br /&gt;
&lt;br /&gt;
===== Rules of Checked Explicit Conversions =====&lt;br /&gt;
&lt;br /&gt;
* Synonyms of domains are converted using the same rules that are applied to the domains themselves.&lt;br /&gt;
* Numerical domains can be converted to the numerical domains only.&lt;br /&gt;
* Integral constants are the representatives of the anonymous integral domain: &amp;lt;vp&amp;gt;[const .. const]&amp;lt;/vp&amp;gt;.&lt;br /&gt;
* Real constants are the representatives of the anonymous real domain: &amp;lt;vp&amp;gt;digits&amp;lt;/vp&amp;gt; &amp;lt;vp&amp;gt;dig [const .. const]&amp;lt;/vp&amp;gt;, where &amp;lt;vp&amp;gt;dig&amp;lt;/vp&amp;gt; is the number of the digits in mantissa without insignificant zeroes.&lt;br /&gt;
* A value of the symbol domain can be converted to the string domain and vice versa.&lt;br /&gt;
* A value of binary domain can be converted to the pointer domain.&lt;br /&gt;
* The domains that are implicitly introduced for interfaces can be converted only to the interface domains according to the rules specified below.&lt;br /&gt;
* All other domains cannot be converted.&lt;br /&gt;
&lt;br /&gt;
===== Conversions of Numerical Domains =====&lt;br /&gt;
&lt;br /&gt;
* The range is considered first during such conversion. If the ranges of source and target do not intersect, then an error is produced. If the ranges of source and target only partially intersect, then run-time checking is generated. Also, if one of domains is real and another is an integral one, then the integer range is converted to the real range before the comparison.&lt;br /&gt;
* When input term in real and output is integer, then &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; and [[#tryConvert|tryConvert/2-&amp;gt;]] predicates truncate the input value to the nearest integer value, which is nearer to zero.&lt;br /&gt;
&lt;br /&gt;
===== Conversions of Interface Types =====&lt;br /&gt;
&lt;br /&gt;
Predicate &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; allow to convert any object to any interface type. The actual correctness of such conversion is checked at runtime. When object is created, its type is internally stored, therefore when the object is passed as argument it still remember about its original type. This original type is used for checking allowed conversions. The example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface x&lt;br /&gt;
      supports a, b&lt;br /&gt;
end interface x&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If object is created by class, which implements &amp;lt;vp&amp;gt;x&amp;lt;/vp&amp;gt; interface, and then object is passed as parameter of type &amp;lt;vp&amp;gt;a&amp;lt;/vp&amp;gt; to some predicate, then it is allowed to convert the object to &amp;lt;vp&amp;gt;b&amp;lt;/vp&amp;gt; type.&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Check range error.&lt;br /&gt;
* Unsupported interface type.&lt;br /&gt;
&lt;br /&gt;
==== digitsOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;digitsOf : (&amp;lt;real-domain&amp;gt; Domain) -&amp;gt; unsigned.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns precision of the specified floating-point domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Precision = digitsof(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input parameter &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; of this compiling-time predicate is a floating-point domain, it should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable). The predicate returns the number &amp;lt;vpbnf&amp;gt;&amp;lt;Precision&amp;gt;&amp;lt;/vpbnf&amp;gt; that was determined by the &amp;lt;vp&amp;gt;digits&amp;lt;/vp&amp;gt; attribute in the domain declaration.&lt;br /&gt;
&lt;br /&gt;
The compiler guarantees that values of the domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; will have at least &amp;lt;vpbnf&amp;gt;&amp;lt;Precision&amp;gt;&amp;lt;/vpbnf&amp;gt; number of significant decimal digits.&lt;br /&gt;
&lt;br /&gt;
==== errorExit ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;errorExit : (unsigned ErrorNumber) erroneous.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs a run-time error with the specified return code &amp;lt;vp&amp;gt;ErrorNumber&amp;lt;/vp&amp;gt;, which can be used in the [[#try-catch-finally|try-catch-finally]].&lt;br /&gt;
&lt;br /&gt;
==== fail ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;fail : () failure.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; predicate forces failure and, hence, always causes backtracking. A clause that fails (with &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; or for some other reason) cannot bind output arguments.&lt;br /&gt;
&lt;br /&gt;
==== free ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;free : (&amp;lt;variableName&amp;gt; Variable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check whether a variable is free.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;free(Variable)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;free&amp;lt;/vp&amp;gt; predicate succeeds if the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is free and fails if &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is bound. The &amp;lt;vp&amp;gt;free&amp;lt;/vp&amp;gt; predicate treats the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; as bound if any of it&amp;#039;s part are instantiated.&lt;br /&gt;
&lt;br /&gt;
See also [[#bound|bound/1]].&lt;br /&gt;
&lt;br /&gt;
==== fromEllipsis ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;fromEllipsis : (...) -&amp;gt; any* AnyTermList.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate creates the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; from the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039; (i.e. from the special varying parameters block).&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;AnyTermList = fromEllipsis(EllipsisBlock )&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#toEllipsis|toEllipsis/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== hasDomain ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;hasDomain&amp;lt;/vp&amp;gt; is not really a predicate, but more a type declaration/restriction.  It has two forms a non-function for declaring/restricting the type of a variable and a function form for declaring/restricting the type of a value.&lt;br /&gt;
&lt;br /&gt;
The non-function form is called with a type as first parmeter and a variable as second parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;hasDomain : (&amp;lt;type&amp;gt; Type, Type Variable).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only effect of the call is that the &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; will be restricted to the type &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The variable can be free, bound or of some mixed flow and the binding of the variable will not change in any way.&lt;br /&gt;
&lt;br /&gt;
The function form is called with a type as first argument and a value as second argument, and it returns the same value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;hasDomain : (&amp;lt;type&amp;gt; Type, Type Value) -&amp;gt; Type Value.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only effect of the call is to ensure that the &amp;lt;vp&amp;gt;Value&amp;lt;/vp&amp;gt; will be restricted to the type &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== lowerBound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;lowerBound : (&amp;lt;numeric-domain&amp;gt; NumericDomain) -&amp;gt; &amp;lt;numeric-domain&amp;gt; LowerBound.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the lower bound of the specified &amp;lt;vp&amp;gt;NumericDomain&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;LowerBoundValue = lowerBound(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;lowerBound&amp;lt;/vp&amp;gt; is a compiling-time predicate. The &amp;lt;vp&amp;gt;lowerBound&amp;lt;/vp&amp;gt; returns the lower bound value &amp;lt;vp&amp;gt;LowerBoundValue&amp;lt;/vp&amp;gt; of the specified numeric domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The return value &amp;lt;vp&amp;gt;LowerBoundValue&amp;lt;/vp&amp;gt; belongs to the same domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter should be the name of any numerical domain; this domain name should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable). See also [[#upperBound|upperBound/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
It will give a compile time error if the specified domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; is not numeric domain.&lt;br /&gt;
&lt;br /&gt;
==== in ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#in|in/2]].&lt;br /&gt;
&lt;br /&gt;
==== isErroneous ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;isErroneous : (&amp;lt;fact-variable&amp;gt; FactVariable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate succeeds if the specified fact variable is &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;isErroneous(factVariableName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate succeeds if the specified fact variable &amp;lt;vp&amp;gt;factVariableName&amp;lt;/vp&amp;gt; has the &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt; value, otherwise it fails.&lt;br /&gt;
&lt;br /&gt;
==== maxDigits ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;maxDigits : (&amp;lt;real-domain&amp;gt; RealDomain) -&amp;gt; unsigned MaxDigits&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the value of digits (precision) of the basic domain corresponding to the specified floating-point domain &amp;lt;vp&amp;gt;RealDomain&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;MaxDigitsNumber = maxdigits(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The return maximal number of digits &amp;lt;vp&amp;gt;MaxDigitsNumber&amp;lt;/vp&amp;gt; for the &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter, which should be the name of a &amp;lt;vp&amp;gt;real&amp;lt;/vp&amp;gt; domain.&lt;br /&gt;
&lt;br /&gt;
==== not ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#not|not]].&lt;br /&gt;
&lt;br /&gt;
==== or ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#or_.28.3B.29|or (;)]].&lt;br /&gt;
&lt;br /&gt;
==== orelse ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#orelse|orelse]].&lt;br /&gt;
&lt;br /&gt;
==== predicate_fullname ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicate_fullname : () -&amp;gt; string PredicateFullName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;PredicateFullName&amp;lt;/vp&amp;gt; of the predicate in which it is invoked. The returned predicate name is qualified with a scope name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;predicate_fullname&amp;lt;/vp&amp;gt; can only be used inside a clause. Use of &amp;lt;vp&amp;gt;predicate_fullname&amp;lt;/vp&amp;gt; in other places causes a compile time error. See also [[#predicate_name|predicate_name]].&lt;br /&gt;
&lt;br /&gt;
==== predicate_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicate_name : () -&amp;gt; string PredicateName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;PredicateName&amp;lt;/vp&amp;gt; of the predicate in which it is invoked.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; can only be used inside a clause. Use of &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; in other places causes a compile time error. See also [[#predicate_fullname|predicate_fullname]]&lt;br /&gt;
&lt;br /&gt;
==== programPoint ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;programPoint : () -&amp;gt; core::programPoint ProgramPoint.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;programPoint&amp;lt;/vp&amp;gt; corresponding to the place where it is invoked.&lt;br /&gt;
&lt;br /&gt;
==== retract ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract : (&amp;lt;fact-term&amp;gt; FactTerm) nondeterm anyflow.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Successively removes the first matching fact from the facts database.  Fails when no more facts match.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract(FactTemplate)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; should be a fact term. The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate deletes the first fact that matches the &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; in the appropriated facts database. During backtracking, the rest of the matching facts will be deleted.&lt;br /&gt;
&lt;br /&gt;
Notice that &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can have any level of instantiation. The &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; is matched with the facts in the facts database, which means that any free variables will be bound in the call to &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can contain any anonymous variables. That is, variables with names consisting from the single underscore &amp;lt;vp&amp;gt;_&amp;lt;/vp&amp;gt; or a variable with a name starting with an underscore &amp;lt;vp&amp;gt;_AnyValue&amp;lt;/vp&amp;gt; if the variable occurs only once in the clause. For example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract(person(&amp;quot;Hans&amp;quot;, _Age)),&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will retract the first matched person fact that has &amp;quot;&amp;lt;vp&amp;gt;Hans&amp;lt;/vp&amp;gt;&amp;quot; as the first argument and anything as the second argument.&lt;br /&gt;
&lt;br /&gt;
When retracting a fact, which is declared to be determ, the call to &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; will be deterministic.&lt;br /&gt;
&lt;br /&gt;
See also [[#retractall|retractall/1]] and [[#retractFactDb|retractFactDb]].&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate cannot be applied to single facts or fact variables.&lt;br /&gt;
&lt;br /&gt;
Be careful calling &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; with free &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; variable if any single fact is declared in the project current scope. If you retract a single fact, then the run-time error is generated. The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate fails when there are no more matches.&lt;br /&gt;
&lt;br /&gt;
==== retractall ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractall : (&amp;lt;fact-term&amp;gt; FactTerm) .&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove all matching facts from the facts database.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractall(FactTemplate)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; should be a fact term.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt; retracts all facts which match the given &amp;#039;&amp;#039;FactTemplate&amp;#039;&amp;#039;. It always succeeds, even if no facts were retracted.&lt;br /&gt;
&lt;br /&gt;
Attempting to retract a &amp;lt;vp&amp;gt;single&amp;lt;/vp&amp;gt; fact will cause a compile time error.&lt;br /&gt;
&lt;br /&gt;
It is not possible to obtain any output values from &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt;. For this reason, the variables in the call must be bound or be a single underscores (anonymous). Notice that  &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can have any level of instantiation, but free variables must be single underscores (&amp;quot;unconditionally anonymous&amp;quot;). In difference to [[#retract|retract/1]] &amp;quot;conditionally&amp;quot; anonymous variables with names starting from the underscore (like &amp;lt;vp&amp;gt;_AnyValue&amp;lt;/vp&amp;gt;) cannot be used in &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
See also [[#retract|retract/1]] and [[#retractFactDb|retractFactDb/1]].&lt;br /&gt;
&lt;br /&gt;
==== retractFactDb ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractFactDb : (factDB FactDB).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove all facts from the named internal facts database &amp;lt;vp&amp;gt;FactDB&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractFactDb(FactDB)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retractFactDb/1&amp;lt;/vp&amp;gt; removes all facts from the named facts database &amp;lt;vp&amp;gt;FactDB&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Notice, it is impossible to retract &amp;lt;vp&amp;gt;single&amp;lt;/vp&amp;gt; facts and fact variables, so the predicate leaves such ones as they are.&lt;br /&gt;
&lt;br /&gt;
See also [[#retractall|retractall/1]] and [[#retract|retract/1]].&lt;br /&gt;
&lt;br /&gt;
==== retractAll/2 ====&lt;br /&gt;
&lt;br /&gt;
Obsolete predicate! Use [[#retractFactDb|retractFactDb/1]] instead.&lt;br /&gt;
&lt;br /&gt;
==== sizeBitsOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeBitsOf : (&amp;lt;domain&amp;gt; DomainName) -&amp;gt; unsigned BitSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bits occupied in memory by an entity of the specified domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;BitSize = sizeBitsOf(DomainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compiling-time predicate receives the domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt; as input parameter and return the size of memory that is occupied by the entity of the given domain. The result is measured in bits. For the integer domains &amp;lt;vp&amp;gt;sizeBitsOf/1-&amp;gt;&amp;lt;/vp&amp;gt; predicate returns the value that was defined for the size-field in a domain&amp;#039;s declaration.&lt;br /&gt;
&lt;br /&gt;
The following is always true for the integral domains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOfDomain(domain)*8 - 7 &amp;lt;= sizeBitsOf(domain) &amp;lt;= sizeOfDomain(domain)*8&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#sizeOfDomain|sizeOfDomain]]/1-&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== sizeOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOf : (Type Term) -&amp;gt; integer ByteSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bytes occupied in memory by the specified term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ByteSize = sizeOf(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;sizeOf/1-&amp;gt;&amp;lt;/vp&amp;gt; function receives a term as input parameter and returns value &amp;lt;vp&amp;gt;ByteSize&amp;lt;/vp&amp;gt; that specifies the number of bytes occupied in memory by this term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== sizeOfDomain ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOfDomain : (&amp;lt;domain&amp;gt; Domain) -&amp;gt; integer ByteSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bytes occupied in memory by the entity of the specified domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ByteSize = sizeOfDomain(DomainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compiling-time predicate receives the domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt; as input parameter and return the size of memory that is occupied by the entity of the given domain. The result is measured in bytes. The returned value &amp;lt;vp&amp;gt;ByteSize&amp;lt;/vp&amp;gt; belongs to the integer domain. Compare with [[#sizeBitsOf|sizeBitsOf/1-&amp;gt;]], which returns size of a domain measured in bits.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_lineno ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_lineno : () -&amp;gt; unsigned LineNumber.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current line number in the source file processed by the compiler.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_name : () -&amp;gt; string FileName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the name of the source file processed by the compiler.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_timestamp ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_timestamp : () -&amp;gt; string TimeStamp..&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a string that represents the date and time of the currently compiled source file in format &amp;lt;b&amp;gt;YYYY-MM-DD HH:mm:ss&amp;lt;/b&amp;gt;. Where:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;YYYY&amp;lt;/b&amp;gt; - Year.&lt;br /&gt;
* &amp;lt;b&amp;gt;MM&amp;lt;/b&amp;gt; - Month.&lt;br /&gt;
* &amp;lt;b&amp;gt;DD&amp;lt;/b&amp;gt; - Day.&lt;br /&gt;
* &amp;lt;b&amp;gt;HH&amp;lt;/b&amp;gt; - Hour.&lt;br /&gt;
* &amp;lt;b&amp;gt;mm&amp;lt;/b&amp;gt; - Minute.&lt;br /&gt;
* &amp;lt;b&amp;gt;ss&amp;lt;/b&amp;gt; - Second.&lt;br /&gt;
&lt;br /&gt;
==== succeed ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;succeed : ().&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate &amp;lt;vp&amp;gt;succeed/0&amp;lt;/vp&amp;gt; will always succeed.&lt;br /&gt;
&lt;br /&gt;
==== toAny ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toAny : (Term) -&amp;gt; any UniversalTypeValue.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to the value of universal term type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;UniversalTypeValue = toAny(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A term of the &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; domain can be converted back to its original type using the &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicates (see {{lang2|Built-in entities/Predicates|toTerm|toTerm}}).&lt;br /&gt;
&lt;br /&gt;
==== toBinary ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toBinary : (Term) -&amp;gt; binary Serialized.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to [[#binary|binary]] representation.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Serialized = toBinary(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a binary, it can safely be stored in a file or sent over a network to another program. Later the obtained binary value &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; can be converted back to a Visual Prolog term, using [[#toTerm|toTerm/1-&amp;gt;]] function (the domain for the reversed term should be adequate to &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) for the reverse conversion.&lt;br /&gt;
&lt;br /&gt;
==== toBoolean ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toBoolean : (&amp;lt;deterministic_expression&amp;gt; SubGoal) -&amp;gt; boolean Succeed.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of this meta-predicate is to convert an expression to the value of boolean domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this meta-predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;True_or_False = toBoolean(deterministic_expression)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this is equivalent to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;True_or_False = if deterministic_expression then true else false end if&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;toBoolean/1-&amp;gt;&amp;lt;/vp&amp;gt; meta-predicate returns [[#boolean|boolean]] value. The result is &amp;lt;vp&amp;gt;true&amp;lt;/vp&amp;gt; if &amp;#039;&amp;#039;deterministic_call&amp;#039;&amp;#039; succeeds. The result is &amp;lt;vp&amp;gt;false&amp;lt;/vp&amp;gt; if &amp;#039;&amp;#039;deterministic_call&amp;#039;&amp;#039; fails.&lt;br /&gt;
&lt;br /&gt;
==== toEllipsis ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toEllipsis : (any* AnyTermList) -&amp;gt; ....&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate creates &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039; (i.e. the special varying parameters block) from the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;. Such &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; can be later passed to a predicate which expects the varying number of arguments (i.e. is declared with the ellipsis (&amp;#039;&amp;#039;...&amp;#039;&amp;#039;)), like &amp;lt;vp&amp;gt;write/...&amp;lt;/vp&amp;gt;, at the position of the ellipsis (&amp;#039;&amp;#039;...&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;EllipsisBlock = toEllipsis(&amp;lt;any_term_list&amp;gt;), write(EllipsisBlock)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#fromEllipsis|fromEllipsis/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== toString ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toString : (Term) -&amp;gt; string Serialized.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to string representation.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Serialized = toString(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a string, it can safely be stored in a file or sent over a network to another program. Later the obtained string value can be converted back to a Visual Prolog term, using [[#toTerm|toTerm/1-&amp;gt;]] function (the domain of the return value should be adequate to &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) for the reverse conversion.&lt;br /&gt;
&lt;br /&gt;
==== toTerm ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toTerm : (string Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (binary Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (any Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, string Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, binary Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, any Serialized) -&amp;gt; Term.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the string/binary/any representation of the specified term &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; into representation corresponding to the domain of &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; variable of the return value. The domain can be stated explicitly or it can be left to the compiler to determine a suitable domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Term = toTerm(Serialized) % with implicit domain&lt;br /&gt;
Term = toTerm(domainName, Serialized) % with explicit domain, domainName&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the domain is not specified the compiler must be able to determine the domain for the returned value &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; at compile-time. Notice that binary version of &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicate performs almost byte to byte conversion and only checking general compatibility of &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; data with the domain required to the return value &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;. The programmer is wholly responsible for providing binary data of &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; that can be correctly converted to the term of the desired domain. The &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicates are counterparts to predicates [[#toBinary|toBinary/1-&amp;gt;]] and [[#toString|toString/1-&amp;gt;]]. When a &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a binary or string representation &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; (by [[#toBinary|toBinary/1-&amp;gt;]] or [[#toString|toString/1-&amp;gt;]] or [[#toAny|toAny/1-&amp;gt;]] correspondingly), it can safely be stored in a file or sent over a network to another program. Later the corresponding &amp;lt;vp&amp;gt;toTerm/1&amp;lt;/vp&amp;gt;-&amp;gt; function can convert the obtained string/binary value &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; back to a Visual Prolog term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;. For correctness of the reverse conversion the domain of the clause variable &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; should be adequate to the initial domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
See also [[#tryToTerm|tryToTerm]].&lt;br /&gt;
&lt;br /&gt;
It gives a compile time error if the compiler cannot determine the return domain.&lt;br /&gt;
&lt;br /&gt;
Exceptions&lt;br /&gt;
&lt;br /&gt;
* Run time errors are generated when the &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicate cannot convert the string or binary into a term of the specified domain.&lt;br /&gt;
&lt;br /&gt;
==== tryToTerm ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;tryToTerm : (string Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (binary Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (any Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, string Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, binary Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, any Serialized) -&amp;gt; Term.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Converts the string/binary/any representation &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; into a term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;  like [[#toTerm|toTerm]]. The only difference between the predicates is that &amp;lt;vp&amp;gt;tryToTerm&amp;lt;/vp&amp;gt; fails if it cannot convert the string or binary or any into a term of the specified domain whereas toTerm raises an exception.&lt;br /&gt;
&lt;br /&gt;
See also [[#toTerm|toTerm]].&lt;br /&gt;
&lt;br /&gt;
==== tryConvert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;tryConvert : (&amp;lt;type&amp;gt; Type, Value) -&amp;gt; &amp;lt;type&amp;gt; Converted determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the input term &amp;lt;vp&amp;gt;Value&amp;lt;/vp&amp;gt; can be strictly converted into the specified domain &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt; and returns the converted term &amp;lt;vp&amp;gt;Converted&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ReturnTerm = tryConvert(returnDomain, InputTerm)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vp&amp;gt;returnDomain&amp;lt;/vp&amp;gt;: Specifies a domain to which &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate tries to convert the specified &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; can be any domain accessible in the current scope. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the term that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; is an expression, then it will be evaluated before conversion.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; domain.&lt;br /&gt;
&lt;br /&gt;
The conversion rules are the same as of the embedded predicate [[#convert|convert/2-&amp;gt;]], but &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; fails when [[#convert|convert/2-&amp;gt;]] generates conversion errors.&lt;br /&gt;
&lt;br /&gt;
This predicate succeeds if the corresponding conversion succeeds. Otherwise it fails. The &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate tries to perform a clean and genuine conversion of the given &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; into a value of the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;. The &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate will fail if the required conversion cannot be performed. When &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate succeeds, it returns the term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; converted to the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
For allowed conversions and rules of checked explicit conversions see [[#convert|convert/2-&amp;gt;]] predicate.&lt;br /&gt;
&lt;br /&gt;
See also [[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== uncheckedConvert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;uncheckedConvert : (&amp;lt;type&amp;gt; Type, Value) -&amp;gt; &amp;lt;type&amp;gt; Converted.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unchecked conversion of a value to another type.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ReturnTerm = uncheckedConvert(returnDomain, InputTerm)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vp&amp;gt;returnDomain&amp;lt;/vp&amp;gt;: Specifies a domain to which &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; predicate unsafely converts the specified &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; can be any domain accessible in the current scope, the &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; should has the same bit-size as the &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the value that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;#039;&amp;#039;InputTerm&amp;#039;&amp;#039; is an expression, then it will be evaluated before conversion.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned parameter &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; type.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; evaluates &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;, change the type to &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; without any modification of the memory pattern and unifies with &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt;. The &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; predicate performs no runtime checks. It makes only compile time checking of bit-size equality of the converted domains. So almost any term may be quite recklessly converted to any other term. So quite disastrous results may occur if you try to use variables incorrectly converted by &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;. Be extremely careful implementing &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;; we strongly recommend you always, when it is possible, using of [[#convert|convert/2-&amp;gt;]] and [[#tryConvert|tryConvert/2-&amp;gt;]]. But notice that, when an object is returned by COM system it is necessary to convert it by &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;, as Prolog program does not have information about its actual type.&lt;br /&gt;
&lt;br /&gt;
==== upperBound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;upperBound : (&amp;lt;numeric-domain&amp;gt; NumericDomain) -&amp;gt; &amp;lt;number-domain&amp;gt; UpperBound.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the upper bound value of the specified numeric domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;UpperBound = upperBound(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;upperBound&amp;lt;/vp&amp;gt; is a compiling-time predicate. The &amp;lt;vp&amp;gt;upperBound&amp;lt;/vp&amp;gt; returns the upper bound value of the specified numeric domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The return value &amp;lt;vp&amp;gt;UpperBound&amp;lt;/vp&amp;gt; belongs to the same domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter should be the name of any numerical domain; this domain name should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable).&lt;br /&gt;
&lt;br /&gt;
See also [[#lowerBound|lowerBound/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
Will cause a compile time error if the specified domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; is not numeric domain.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{LanguageReferenceSubarticle|Built-in entities/Predicates}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Predicates&amp;diff=4276</id>
		<title>Language Reference/Built-in entities/Predicates</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Predicates&amp;diff=4276"/>
		<updated>2016-04-06T08:47:20Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: /* sourcefile_timestamp */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;__NOTOC__&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#and_.28.2C.29|and/2]] &amp;lt;br&amp;gt; [[Language_Reference/Terms#and_.28.2C.29|,/2]]&lt;br /&gt;
|Term &amp;quot;and&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[#assert|assert/1]]&lt;br /&gt;
|Insert the specified fact at the end of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#asserta|asserta/1]]&lt;br /&gt;
|Insert a fact at the beginning of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#assertz|assertz/1]]&lt;br /&gt;
|Insert a fact at the end of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#bound|bound/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Test whether the specified variable is bound to a value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#class_name|class_name/0-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;ClassName&amp;#039;&amp;#039; that represents the name of the current interface or class.&lt;br /&gt;
|-&lt;br /&gt;
|[[#compare|compare/2-&amp;gt;]]&lt;br /&gt;
|Returns the result of the variables&amp;#039; comparison.&lt;br /&gt;
|-&lt;br /&gt;
|[[#convert|convert/2-&amp;gt;]]&lt;br /&gt;
|Checked term conversion.&lt;br /&gt;
|-&lt;br /&gt;
|[[#digitsOf|digitsOf/1-&amp;gt;]]&lt;br /&gt;
|Returns precision of the specified floating-point domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#errorExit|errorExit/1]] &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Performs a run-time error with the specified return code &amp;#039;&amp;#039;ErrorNumber&amp;#039;&amp;#039; and sets the internal error information.&lt;br /&gt;
|-&lt;br /&gt;
|[[#fail|fail/0]] &amp;lt;vp&amp;gt;failure&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Invoke backtracking.&lt;br /&gt;
|-&lt;br /&gt;
|[[#free|free/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Check whether a variable is free.&lt;br /&gt;
|-&lt;br /&gt;
|[[#fromEllipsis|fromEllipsis/1-&amp;gt;]]&lt;br /&gt;
|Creates the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; from the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#hasDomain|hasDomain/2]] &amp;lt;br&amp;gt; [[#hasDomain|hasDomain/2-&amp;gt;]]&lt;br /&gt;
|Declares/restricts the type of a variable or value.&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#in|in/2]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt; &amp;lt;br&amp;gt; [[Language_Reference/Terms#in|in/2]] &amp;lt;vp&amp;gt;nondeterm&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Infix operator &amp;quot;in&amp;quot; (in-test and in-iterator).&lt;br /&gt;
|-&lt;br /&gt;
|[[#isErroneous|isErroneous/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Returns the lower bound value of the specified numeric domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#lowerBound|lowerBound/1-&amp;gt;]]&lt;br /&gt;
|Returns the lower bound value of the specified numeric domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#maxDigits|maxDigits/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the value of digits (precision) of the basic domain corresponding to the specified floating-point domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#not|not/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Negate the result (success/fail) of subgoal.&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#or_.28.3B.29|or/2]] &amp;lt;br&amp;gt; [[Language_Reference/Terms#and_.28.3B.29|;/2]]&lt;br /&gt;
|Nondeterministic term &amp;quot;or&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#orelse|orelse]]&lt;br /&gt;
|Deterministic term &amp;quot;or&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[#predicate_fullname|predicate_fullname/1-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;PredicateFullName&amp;#039;&amp;#039; that represent the name of the predicate in which clause body &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; is called. The returned predicate name is qualified with a scope name.&lt;br /&gt;
|-&lt;br /&gt;
|[[#predicate_name|predicate_name/1-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;PredicateName&amp;#039;&amp;#039; that represent the name of the predicate in which clause body &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; is called. The returned predicate name is not qualified with a scope name.&lt;br /&gt;
|-&lt;br /&gt;
|[[#programPoint|programPoint/0-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the &amp;lt;vp&amp;gt;programPoint&amp;lt;/vp&amp;gt; corresponding to the place where it is called.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retract|retract/1]] &amp;lt;vp&amp;gt;nondeterm&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Remove a matched fact from the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retractall|retractall/1]]&lt;br /&gt;
|Remove all matching facts from the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retractFactDb|retractFactDb/1]]&lt;br /&gt;
|Remove all facts from the specified named internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeBitsOf|sizeBitsOf/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bits occupied in memory by an entity of the specified domain &amp;#039;&amp;#039;DomainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeOf|sizeOf/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bytes occupied in memory by the specified term.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeOfDomain|sizeOfDomain/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bytes occupied in memory by the entity of the specified domain &amp;#039;&amp;#039;DomainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_lineno|sourcefile_lineno/0-&amp;gt;]]&lt;br /&gt;
|Returns the current line number in the source file processed by the compiler .&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_name|sourcefile_name/0-&amp;gt;]]&lt;br /&gt;
|Returns the name of the source file processed by the compiler.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_timestamp|sourcefile_timestamp/0-&amp;gt;]]&lt;br /&gt;
|Returns the string representing the date and time of the source file processed by the compiler.&lt;br /&gt;
|-&lt;br /&gt;
|[[#succeed|succeed/0]]&lt;br /&gt;
|The predicate &amp;lt;vp&amp;gt;succeed/0&amp;lt;/vp&amp;gt; will always succeed.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toAny|toAny/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; to the value of the universal term type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toBinary|toBinary/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified Term to the binary representation.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toBoolean|toBoolean/1-&amp;gt;]]&lt;br /&gt;
|The purpose of this meta-predicate is to convert the deterministic call (to a predicate or fact) to the procedure that returns the value of &amp;lt;vp&amp;gt;boolean&amp;lt;/vp&amp;gt; domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toEllipsis|toEllipsis/1-&amp;gt;]]&lt;br /&gt;
|Creates the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; from the list of &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; type values.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toString|toString/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; to the string representation.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toTerm|toTerm/1-&amp;gt;]] &amp;lt;br&amp;gt; [[#toTerm|toTerm/2-&amp;gt;]]&lt;br /&gt;
|Converts the string/binary representation of the specified term &amp;#039;&amp;#039;SrcTerm&amp;#039;&amp;#039; into representation corresponding to the domain of &amp;#039;&amp;#039;PrologTerm&amp;#039;&amp;#039; variable of the return value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#tryToTerm|tryToTerm/1-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt; &amp;lt;br&amp;gt; [[#tryToTerm|tryToTerm/2-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Converts the string/binary representation of the specified term &amp;#039;&amp;#039;SrcTerm&amp;#039;&amp;#039; into representation corresponding to the domain of &amp;#039;&amp;#039;PrologTerm&amp;#039;&amp;#039; variable of the return value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#tryConvert|tryConvert/2-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Checks whether the input term &amp;#039;&amp;#039;InputTerm&amp;#039;&amp;#039; can be strictly converted into the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; and returns the converted term &amp;#039;&amp;#039;ReturnTerm&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]]&lt;br /&gt;
|Unchecked conversion of domains.&lt;br /&gt;
|-&lt;br /&gt;
|[[#upperBound|upperBound/1-&amp;gt;]]&lt;br /&gt;
|Returns the upper bound value of the specified numeric domain.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following predicates are deprecated:&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
| finally/2&lt;br /&gt;
| Use [[Language_Reference/Terms#try-finally| &amp;lt;vp&amp;gt;try-finally&amp;lt;/vp&amp;gt;]] constuction instead.&lt;br /&gt;
|-&lt;br /&gt;
| findall/3&lt;br /&gt;
| Use list comprehension [[Language_Reference/Terms#List_Comprehension| &amp;lt;vp&amp;gt;[ ... || ...  ]&amp;lt;/vp&amp;gt;]] instead&lt;br /&gt;
|-&lt;br /&gt;
| trap/3 &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
| Use [[Language_Reference/Terms#try-catch| &amp;lt;vp&amp;gt;try-catch&amp;lt;/vp&amp;gt;]] constuction instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== and ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#and_.28.2C.29|and (,)]].&lt;br /&gt;
&lt;br /&gt;
==== assert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;assert : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert the specified fact at the end of the matched internal facts database&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;assert(Fact)&amp;lt;/vp&amp;gt; inserts &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; in the matched internal facts database after any other stored facts for the corresponding database predicate. &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; must be a term belonging to the domain of an internal facts database. &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; applied to a single fact changes the existing instance of a fact to the specified one. &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; has the same effect as [[#assertz|assertz/1]]. See also [[#asserta|asserta/1]].&lt;br /&gt;
&lt;br /&gt;
Notice that the combination of [[#retract|retract/1]] and &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; like the following can lead to endless loop:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;loop() :-&lt;br /&gt;
  retract(fct(X)),&lt;br /&gt;
     ...           % creating Y from X&lt;br /&gt;
     assert(fct(Y)),&lt;br /&gt;
  fail.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem is that the retract in first line will eventually retract the fact asserted in the last line, because that fact is inserted &amp;#039;&amp;#039;last&amp;#039;&amp;#039; in the fact chain.&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Attempt to assert a second instance to a fact declared as determ.&lt;br /&gt;
&lt;br /&gt;
==== asserta ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;asserta : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert a fact at the beginning of the matched internal facts database.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;asserta(Fact)&amp;lt;/vp&amp;gt; predicate inserts a &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; in the matched internal facts database before any other stored facts for the corresponding predicate. The &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; must be a term belonging to the domain of an internal facts database. The &amp;lt;vp&amp;gt;asserta/1&amp;lt;/vp&amp;gt; applied to a single fact changes the existing instance of a fact to the specified one. See also [[#assert|assert/1]] and [[#assertz|assertz/1]].&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Attempt to a fact declared as determ, but the fact instance already exists.&lt;br /&gt;
&lt;br /&gt;
==== assertz ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;assertz : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;assertz&amp;lt;/vp&amp;gt; does exactly the same as the [[#assert|assert/1]] predicate.&lt;br /&gt;
&lt;br /&gt;
==== bound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;bound : (&amp;lt;variable&amp;gt; Variable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test whether the specified variable is bound to a value.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;bound(Variable)&amp;lt;/vp&amp;gt; succeeds if &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is bound and fails if it is free. The &amp;lt;vp&amp;gt;bound&amp;lt;/vp&amp;gt; predicate is used to control flow patterns and to check the binding of reference variables. The &amp;lt;vp&amp;gt;bound&amp;lt;/vp&amp;gt; predicate treats the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; as bound if any of it&amp;#039;s part is instantiated.&lt;br /&gt;
&lt;br /&gt;
See also [[#free|free/1]].&lt;br /&gt;
&lt;br /&gt;
==== class_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class_Name : () -&amp;gt; string ClassName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compile time predicate returns the string &amp;lt;vp&amp;gt;ClassName&amp;lt;/vp&amp;gt; that represents the name of the current interface or class.&lt;br /&gt;
&lt;br /&gt;
==== compare ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;compare : (A Left, A Right) -&amp;gt; compareResult CompareResult.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comparison of two terms of the same domain, resturns the value of [[#compareResult|compareResult]] domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;CompareResult&amp;lt;/vp&amp;gt; = compare(&amp;quot;&amp;lt;vp&amp;gt;bar&amp;lt;/vp&amp;gt;&amp;quot;, &amp;quot;&amp;lt;vp&amp;gt;foo&amp;lt;/vp&amp;gt;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== convert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;convert : (&amp;lt;type&amp;gt; Type, Term) -&amp;gt; &amp;lt;type&amp;gt; Converted.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checked term conversion.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; = convert(returnDomain, &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;returnDomain&amp;lt;/vpbnf&amp;gt;: Specifies a domain to which function &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; converts &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be a name of built-in Visual Prolog domain, an interface domain, a name of such user defined domain that is synonym to one of built-in Visual Prolog domains, a numeric domain, binary and pointer domains. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the value that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; is an expression, then it will be evaluated before the conversion.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned parameter &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; type.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;convert&amp;lt;/vp&amp;gt; predicate performs a clean and genuine conversion of the given &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;, returning a new term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; of the specified new domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;. If &amp;lt;vp&amp;gt;convert&amp;lt;/vp&amp;gt; cannot perform the required conversion, it rises errors. The similar functionality is provided by the [[#tryConvert|tryConvert/2-&amp;gt;]] predicate, but &amp;lt;vp&amp;gt;tryConvert-&amp;gt;&amp;lt;/vp&amp;gt; fails and does not produce any runtime errors if it cannot perform the conversion.&lt;br /&gt;
&lt;br /&gt;
===== Allowed conversions =====&lt;br /&gt;
&lt;br /&gt;
* Between numerical domains.&lt;br /&gt;
* Between interface types.&lt;br /&gt;
* Between [[#string|string]] and [[#symbol|symbol]] domains.&lt;br /&gt;
* From [[#binary|binary]] to [[#pointer|pointer]].&lt;br /&gt;
* For synonyms of mentioned domains.&lt;br /&gt;
* Between [http://wiki.visual-prolog.com/index.php?title=How_To_Remove_Reference_Domains_from_a_Project reference] domains and corresponding non-reference domains.&lt;br /&gt;
&lt;br /&gt;
The contrast to these is [[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]] predicate, which performs an unchecked conversion between terms from any domains, which have the same bit-size.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; (or [[#tryConvert|tryConvert/2-&amp;gt;]]) predicate accomplishes a checked explicit conversion, when the source and target domains are statically known during the compilation. The result of an explicit conversion can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ok&amp;#039;&amp;#039;&amp;#039; the successful conversion to the target domain;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;run-time-check&amp;#039;&amp;#039;&amp;#039; the conversion to the target domain with generation of run-time checking for compatibility;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;error&amp;#039;&amp;#039;&amp;#039; the conversion is impossible, error output.&lt;br /&gt;
&lt;br /&gt;
===== Rules of Checked Explicit Conversions =====&lt;br /&gt;
&lt;br /&gt;
* Synonyms of domains are converted using the same rules that are applied to the domains themselves.&lt;br /&gt;
* Numerical domains can be converted to the numerical domains only.&lt;br /&gt;
* Integral constants are the representatives of the anonymous integral domain: &amp;lt;vp&amp;gt;[const .. const]&amp;lt;/vp&amp;gt;.&lt;br /&gt;
* Real constants are the representatives of the anonymous real domain: &amp;lt;vp&amp;gt;digits&amp;lt;/vp&amp;gt; &amp;lt;vp&amp;gt;dig [const .. const]&amp;lt;/vp&amp;gt;, where &amp;lt;vp&amp;gt;dig&amp;lt;/vp&amp;gt; is the number of the digits in mantissa without insignificant zeroes.&lt;br /&gt;
* A value of the symbol domain can be converted to the string domain and vice versa.&lt;br /&gt;
* A value of binary domain can be converted to the pointer domain.&lt;br /&gt;
* The domains that are implicitly introduced for interfaces can be converted only to the interface domains according to the rules specified below.&lt;br /&gt;
* All other domains cannot be converted.&lt;br /&gt;
&lt;br /&gt;
===== Conversions of Numerical Domains =====&lt;br /&gt;
&lt;br /&gt;
* The range is considered first during such conversion. If the ranges of source and target do not intersect, then an error is produced. If the ranges of source and target only partially intersect, then run-time checking is generated. Also, if one of domains is real and another is an integral one, then the integer range is converted to the real range before the comparison.&lt;br /&gt;
* When input term in real and output is integer, then &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; and [[#tryConvert|tryConvert/2-&amp;gt;]] predicates truncate the input value to the nearest integer value, which is nearer to zero.&lt;br /&gt;
&lt;br /&gt;
===== Conversions of Interface Types =====&lt;br /&gt;
&lt;br /&gt;
Predicate &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; allow to convert any object to any interface type. The actual correctness of such conversion is checked at runtime. When object is created, its type is internally stored, therefore when the object is passed as argument it still remember about its original type. This original type is used for checking allowed conversions. The example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface x&lt;br /&gt;
      supports a, b&lt;br /&gt;
end interface x&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If object is created by class, which implements &amp;lt;vp&amp;gt;x&amp;lt;/vp&amp;gt; interface, and then object is passed as parameter of type &amp;lt;vp&amp;gt;a&amp;lt;/vp&amp;gt; to some predicate, then it is allowed to convert the object to &amp;lt;vp&amp;gt;b&amp;lt;/vp&amp;gt; type.&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Check range error.&lt;br /&gt;
* Unsupported interface type.&lt;br /&gt;
&lt;br /&gt;
==== digitsOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;digitsOf : (&amp;lt;real-domain&amp;gt; Domain) -&amp;gt; unsigned.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns precision of the specified floating-point domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Precision = digitsof(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input parameter &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; of this compiling-time predicate is a floating-point domain, it should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable). The predicate returns the number &amp;lt;vpbnf&amp;gt;&amp;lt;Precision&amp;gt;&amp;lt;/vpbnf&amp;gt; that was determined by the &amp;lt;vp&amp;gt;digits&amp;lt;/vp&amp;gt; attribute in the domain declaration.&lt;br /&gt;
&lt;br /&gt;
The compiler guarantees that values of the domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; will have at least &amp;lt;vpbnf&amp;gt;&amp;lt;Precision&amp;gt;&amp;lt;/vpbnf&amp;gt; number of significant decimal digits.&lt;br /&gt;
&lt;br /&gt;
==== errorExit ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;errorExit : (unsigned ErrorNumber) erroneous.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs a run-time error with the specified return code &amp;lt;vp&amp;gt;ErrorNumber&amp;lt;/vp&amp;gt;, which can be used in the [[#try-catch-finally|try-catch-finally]].&lt;br /&gt;
&lt;br /&gt;
==== fail ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;fail : () failure.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; predicate forces failure and, hence, always causes backtracking. A clause that fails (with &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; or for some other reason) cannot bind output arguments.&lt;br /&gt;
&lt;br /&gt;
==== free ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;free : (&amp;lt;variableName&amp;gt; Variable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check whether a variable is free.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;free(Variable)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;free&amp;lt;/vp&amp;gt; predicate succeeds if the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is free and fails if &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is bound. The &amp;lt;vp&amp;gt;free&amp;lt;/vp&amp;gt; predicate treats the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; as bound if any of it&amp;#039;s part are instantiated.&lt;br /&gt;
&lt;br /&gt;
See also [[#bound|bound/1]].&lt;br /&gt;
&lt;br /&gt;
==== fromEllipsis ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;fromEllipsis : (...) -&amp;gt; any* AnyTermList.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate creates the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; from the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039; (i.e. from the special varying parameters block).&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;AnyTermList = fromEllipsis(EllipsisBlock )&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#toEllipsis|toEllipsis/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== hasDomain ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;hasDomain&amp;lt;/vp&amp;gt; is not really a predicate, but more a type declaration/restriction.  It has two forms a non-function for declaring/restricting the type of a variable and a function form for declaring/restricting the type of a value.&lt;br /&gt;
&lt;br /&gt;
The non-function form is called with a type as first parmeter and a variable as second parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;hasDomain : (&amp;lt;type&amp;gt; Type, Type Variable).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only effect of the call is that the &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; will be restricted to the type &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The variable can be free, bound or of some mixed flow and the binding of the variable will not change in any way.&lt;br /&gt;
&lt;br /&gt;
The function form is called with a type as first argument and a value as second argument, and it returns the same value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;hasDomain : (&amp;lt;type&amp;gt; Type, Type Value) -&amp;gt; Type Value.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only effect of the call is to ensure that the &amp;lt;vp&amp;gt;Value&amp;lt;/vp&amp;gt; will be restricted to the type &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== lowerBound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;lowerBound : (&amp;lt;numeric-domain&amp;gt; NumericDomain) -&amp;gt; &amp;lt;numeric-domain&amp;gt; LowerBound.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the lower bound of the specified &amp;lt;vp&amp;gt;NumericDomain&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;LowerBoundValue = lowerBound(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;lowerBound&amp;lt;/vp&amp;gt; is a compiling-time predicate. The &amp;lt;vp&amp;gt;lowerBound&amp;lt;/vp&amp;gt; returns the lower bound value &amp;lt;vp&amp;gt;LowerBoundValue&amp;lt;/vp&amp;gt; of the specified numeric domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The return value &amp;lt;vp&amp;gt;LowerBoundValue&amp;lt;/vp&amp;gt; belongs to the same domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter should be the name of any numerical domain; this domain name should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable). See also [[#upperBound|upperBound/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
It will give a compile time error if the specified domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; is not numeric domain.&lt;br /&gt;
&lt;br /&gt;
==== in ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#in|in/2]].&lt;br /&gt;
&lt;br /&gt;
==== isErroneous ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;isErroneous : (&amp;lt;fact-variable&amp;gt; FactVariable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate succeeds if the specified fact variable is &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;isErroneous(factVariableName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate succeeds if the specified fact variable &amp;lt;vp&amp;gt;factVariableName&amp;lt;/vp&amp;gt; has the &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt; value, otherwise it fails.&lt;br /&gt;
&lt;br /&gt;
==== maxDigits ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;maxDigits : (&amp;lt;real-domain&amp;gt; RealDomain) -&amp;gt; unsigned MaxDigits&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the value of digits (precision) of the basic domain corresponding to the specified floating-point domain &amp;lt;vp&amp;gt;RealDomain&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;MaxDigitsNumber = maxdigits(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The return maximal number of digits &amp;lt;vp&amp;gt;MaxDigitsNumber&amp;lt;/vp&amp;gt; for the &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter, which should be the name of a &amp;lt;vp&amp;gt;real&amp;lt;/vp&amp;gt; domain.&lt;br /&gt;
&lt;br /&gt;
==== not ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#not|not]].&lt;br /&gt;
&lt;br /&gt;
==== or ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#or_.28.3B.29|or (;)]].&lt;br /&gt;
&lt;br /&gt;
==== orelse ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#orelse|orelse]].&lt;br /&gt;
&lt;br /&gt;
==== predicate_fullname ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicate_fullname : () -&amp;gt; string PredicateFullName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;PredicateFullName&amp;lt;/vp&amp;gt; of the predicate in which it is invoked. The returned predicate name is qualified with a scope name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;predicate_fullname&amp;lt;/vp&amp;gt; can only be used inside a clause. Use of &amp;lt;vp&amp;gt;predicate_fullname&amp;lt;/vp&amp;gt; in other places causes a compile time error. See also [[#predicate_name|predicate_name]].&lt;br /&gt;
&lt;br /&gt;
==== predicate_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicate_name : () -&amp;gt; string PredicateName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;PredicateName&amp;lt;/vp&amp;gt; of the predicate in which it is invoked.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; can only be used inside a clause. Use of &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; in other places causes a compile time error. See also [[#predicate_fullname|predicate_fullname]]&lt;br /&gt;
&lt;br /&gt;
==== programPoint ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;programPoint : () -&amp;gt; core::programPoint ProgramPoint.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;programPoint&amp;lt;/vp&amp;gt; corresponding to the place where it is invoked.&lt;br /&gt;
&lt;br /&gt;
==== retract ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract : (&amp;lt;fact-term&amp;gt; FactTerm) nondeterm anyflow.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Successively removes the first matching fact from the facts database.  Fails when no more facts match.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract(FactTemplate)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; should be a fact term. The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate deletes the first fact that matches the &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; in the appropriated facts database. During backtracking, the rest of the matching facts will be deleted.&lt;br /&gt;
&lt;br /&gt;
Notice that &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can have any level of instantiation. The &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; is matched with the facts in the facts database, which means that any free variables will be bound in the call to &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can contain any anonymous variables. That is, variables with names consisting from the single underscore &amp;lt;vp&amp;gt;_&amp;lt;/vp&amp;gt; or a variable with a name starting with an underscore &amp;lt;vp&amp;gt;_AnyValue&amp;lt;/vp&amp;gt; if the variable occurs only once in the clause. For example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract(person(&amp;quot;Hans&amp;quot;, _Age)),&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will retract the first matched person fact that has &amp;quot;&amp;lt;vp&amp;gt;Hans&amp;lt;/vp&amp;gt;&amp;quot; as the first argument and anything as the second argument.&lt;br /&gt;
&lt;br /&gt;
When retracting a fact, which is declared to be determ, the call to &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; will be deterministic.&lt;br /&gt;
&lt;br /&gt;
See also [[#retractall|retractall/1]] and [[#retractFactDb|retractFactDb]].&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate cannot be applied to single facts or fact variables.&lt;br /&gt;
&lt;br /&gt;
Be careful calling &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; with free &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; variable if any single fact is declared in the project current scope. If you retract a single fact, then the run-time error is generated. The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate fails when there are no more matches.&lt;br /&gt;
&lt;br /&gt;
==== retractall ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractall : (&amp;lt;fact-term&amp;gt; FactTerm) .&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove all matching facts from the facts database.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractall(FactTemplate)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; should be a fact term.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt; retracts all facts which match the given &amp;#039;&amp;#039;FactTemplate&amp;#039;&amp;#039;. It always succeeds, even if no facts were retracted.&lt;br /&gt;
&lt;br /&gt;
Attempting to retract a &amp;lt;vp&amp;gt;single&amp;lt;/vp&amp;gt; fact will cause a compile time error.&lt;br /&gt;
&lt;br /&gt;
It is not possible to obtain any output values from &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt;. For this reason, the variables in the call must be bound or be a single underscores (anonymous). Notice that  &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can have any level of instantiation, but free variables must be single underscores (&amp;quot;unconditionally anonymous&amp;quot;). In difference to [[#retract|retract/1]] &amp;quot;conditionally&amp;quot; anonymous variables with names starting from the underscore (like &amp;lt;vp&amp;gt;_AnyValue&amp;lt;/vp&amp;gt;) cannot be used in &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
See also [[#retract|retract/1]] and [[#retractFactDb|retractFactDb/1]].&lt;br /&gt;
&lt;br /&gt;
==== retractFactDb ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractFactDb : (factDB FactDB).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove all facts from the named internal facts database &amp;lt;vp&amp;gt;FactDB&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractFactDb(FactDB)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retractFactDb/1&amp;lt;/vp&amp;gt; removes all facts from the named facts database &amp;lt;vp&amp;gt;FactDB&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Notice, it is impossible to retract &amp;lt;vp&amp;gt;single&amp;lt;/vp&amp;gt; facts and fact variables, so the predicate leaves such ones as they are.&lt;br /&gt;
&lt;br /&gt;
See also [[#retractall|retractall/1]] and [[#retract|retract/1]].&lt;br /&gt;
&lt;br /&gt;
==== retractAll/2 ====&lt;br /&gt;
&lt;br /&gt;
Obsolete predicate! Use [[#retractFactDb|retractFactDb/1]] instead.&lt;br /&gt;
&lt;br /&gt;
==== sizeBitsOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeBitsOf : (&amp;lt;domain&amp;gt; DomainName) -&amp;gt; unsigned BitSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bits occupied in memory by an entity of the specified domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;BitSize = sizeBitsOf(DomainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compiling-time predicate receives the domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt; as input parameter and return the size of memory that is occupied by the entity of the given domain. The result is measured in bits. For the integer domains &amp;lt;vp&amp;gt;sizeBitsOf/1-&amp;gt;&amp;lt;/vp&amp;gt; predicate returns the value that was defined for the size-field in a domain&amp;#039;s declaration.&lt;br /&gt;
&lt;br /&gt;
The following is always true for the integral domains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOfDomain(domain)*8 - 7 &amp;lt;= sizeBitsOf(domain) &amp;lt;= sizeOfDomain(domain)*8&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#sizeOfDomain|sizeOfDomain]]/1-&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== sizeOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOf : (Type Term) -&amp;gt; integer ByteSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bytes occupied in memory by the specified term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ByteSize = sizeOf(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;sizeOf/1-&amp;gt;&amp;lt;/vp&amp;gt; function receives a term as input parameter and returns value &amp;lt;vp&amp;gt;ByteSize&amp;lt;/vp&amp;gt; that specifies the number of bytes occupied in memory by this term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== sizeOfDomain ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOfDomain : (&amp;lt;domain&amp;gt; Domain) -&amp;gt; integer ByteSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bytes occupied in memory by the entity of the specified domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ByteSize = sizeOfDomain(DomainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compiling-time predicate receives the domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt; as input parameter and return the size of memory that is occupied by the entity of the given domain. The result is measured in bytes. The returned value &amp;lt;vp&amp;gt;ByteSize&amp;lt;/vp&amp;gt; belongs to the integer domain. Compare with [[#sizeBitsOf|sizeBitsOf/1-&amp;gt;]], which returns size of a domain measured in bits.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_lineno ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_lineno : () -&amp;gt; unsigned LineNumber.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current line number in the source file processed by the compiler.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_name : () -&amp;gt; string FileName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the name of the source file processed by the compiler.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_timestamp ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_timestamp : () -&amp;gt; string TimeStamp..&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a string that represents the date and time of the currently compiled source file in format &amp;lt;b&amp;gt;YYYY-MM-DD HH:mm:ss&amp;lt;/b&amp;gt;. Where:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;YYYY&amp;lt;/b&amp;gt; - Year.&lt;br /&gt;
* &amp;lt;b&amp;gt;MM&amp;lt;/b&amp;gt; - Month.&lt;br /&gt;
* &amp;lt;b&amp;gt;DD&amp;lt;/b&amp;gt; - Day.&lt;br /&gt;
* &amp;lt;b&amp;gt;HH&amp;lt;/b&amp;gt; - Hour.&lt;br /&gt;
* &amp;lt;b&amp;gt;mm&amp;lt;/b&amp;gt; - Minute.&lt;br /&gt;
* &amp;lt;b&amp;gt;ss&amp;lt;/b&amp;gt; - Second.&lt;br /&gt;
&lt;br /&gt;
==== succeed ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;succeed : ().&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate &amp;lt;vp&amp;gt;succeed/0&amp;lt;/vp&amp;gt; will always succeed.&lt;br /&gt;
&lt;br /&gt;
==== toAny ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toAny : (Term) -&amp;gt; any UniversalTypeValue.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to the value of universal term type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;UniversalTypeValue = toAny(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A term of the &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; domain can be converted back to its original type using the &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicates (see {{lang2|Built-in entities/Predicates|toTerm|toTerm}}).&lt;br /&gt;
&lt;br /&gt;
==== toBinary ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toBinary : (Term) -&amp;gt; binary Serialized.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to [[#binary|binary]] representation.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Serialized = toBinary(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a binary, it can safely be stored in a file or sent over a network to another program. Later the obtained binary value &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; can be converted back to a Visual Prolog term, using [[#toTerm|toTerm/1-&amp;gt;]] function (the domain for the reversed term should be adequate to &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) for the reverse conversion.&lt;br /&gt;
&lt;br /&gt;
==== toBoolean ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toBoolean : (&amp;lt;term&amp;gt; SubGoal) -&amp;gt; boolean Succeed.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of this meta-predicate is to convert the deterministic call (to a predicate or fact) to the procedure that returns the value of [[#boolean|boolean]] domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this meta-predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;True_or_False = toBoolean(deterministic_call)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;toBoolean/1-&amp;gt;&amp;lt;/vp&amp;gt; meta-predicate returns [[#boolean|boolean]] value. The result is &amp;lt;vp&amp;gt;true&amp;lt;/vp&amp;gt; if &amp;#039;&amp;#039;deterministic_call&amp;#039;&amp;#039; succeeds. The result is &amp;lt;vp&amp;gt;false&amp;lt;/vp&amp;gt; if &amp;#039;&amp;#039;deterministic_call&amp;#039;&amp;#039; fails.&lt;br /&gt;
&lt;br /&gt;
==== toEllipsis ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toEllipsis : (any* AnyTermList) -&amp;gt; ....&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate creates &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039; (i.e. the special varying parameters block) from the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;. Such &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; can be later passed to a predicate which expects the varying number of arguments (i.e. is declared with the ellipsis (&amp;#039;&amp;#039;...&amp;#039;&amp;#039;)), like &amp;lt;vp&amp;gt;write/...&amp;lt;/vp&amp;gt;, at the position of the ellipsis (&amp;#039;&amp;#039;...&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;EllipsisBlock = toEllipsis(&amp;lt;any_term_list&amp;gt;), write(EllipsisBlock)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#fromEllipsis|fromEllipsis/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== toString ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toString : (Term) -&amp;gt; string Serialized.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to string representation.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Serialized = toString(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a string, it can safely be stored in a file or sent over a network to another program. Later the obtained string value can be converted back to a Visual Prolog term, using [[#toTerm|toTerm/1-&amp;gt;]] function (the domain of the return value should be adequate to &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) for the reverse conversion.&lt;br /&gt;
&lt;br /&gt;
==== toTerm ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toTerm : (string Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (binary Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (any Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, string Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, binary Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, any Serialized) -&amp;gt; Term.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the string/binary/any representation of the specified term &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; into representation corresponding to the domain of &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; variable of the return value. The domain can be stated explicitly or it can be left to the compiler to determine a suitable domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Term = toTerm(Serialized) % with implicit domain&lt;br /&gt;
Term = toTerm(domainName, Serialized) % with explicit domain, domainName&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the domain is not specified the compiler must be able to determine the domain for the returned value &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; at compile-time. Notice that binary version of &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicate performs almost byte to byte conversion and only checking general compatibility of &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; data with the domain required to the return value &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;. The programmer is wholly responsible for providing binary data of &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; that can be correctly converted to the term of the desired domain. The &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicates are counterparts to predicates [[#toBinary|toBinary/1-&amp;gt;]] and [[#toString|toString/1-&amp;gt;]]. When a &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a binary or string representation &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; (by [[#toBinary|toBinary/1-&amp;gt;]] or [[#toString|toString/1-&amp;gt;]] or [[#toAny|toAny/1-&amp;gt;]] correspondingly), it can safely be stored in a file or sent over a network to another program. Later the corresponding &amp;lt;vp&amp;gt;toTerm/1&amp;lt;/vp&amp;gt;-&amp;gt; function can convert the obtained string/binary value &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; back to a Visual Prolog term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;. For correctness of the reverse conversion the domain of the clause variable &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; should be adequate to the initial domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
See also [[#tryToTerm|tryToTerm]].&lt;br /&gt;
&lt;br /&gt;
It gives a compile time error if the compiler cannot determine the return domain.&lt;br /&gt;
&lt;br /&gt;
Exceptions&lt;br /&gt;
&lt;br /&gt;
* Run time errors are generated when the &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicate cannot convert the string or binary into a term of the specified domain.&lt;br /&gt;
&lt;br /&gt;
==== tryToTerm ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;tryToTerm : (string Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (binary Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (any Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, string Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, binary Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, any Serialized) -&amp;gt; Term.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Converts the string/binary/any representation &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; into a term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;  like [[#toTerm|toTerm]]. The only difference between the predicates is that &amp;lt;vp&amp;gt;tryToTerm&amp;lt;/vp&amp;gt; fails if it cannot convert the string or binary or any into a term of the specified domain whereas toTerm raises an exception.&lt;br /&gt;
&lt;br /&gt;
See also [[#toTerm|toTerm]].&lt;br /&gt;
&lt;br /&gt;
==== tryConvert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;tryConvert : (&amp;lt;type&amp;gt; Type, Value) -&amp;gt; &amp;lt;type&amp;gt; Converted determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the input term &amp;lt;vp&amp;gt;Value&amp;lt;/vp&amp;gt; can be strictly converted into the specified domain &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt; and returns the converted term &amp;lt;vp&amp;gt;Converted&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ReturnTerm = tryConvert(returnDomain, InputTerm)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vp&amp;gt;returnDomain&amp;lt;/vp&amp;gt;: Specifies a domain to which &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate tries to convert the specified &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; can be any domain accessible in the current scope. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the term that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; is an expression, then it will be evaluated before conversion.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; domain.&lt;br /&gt;
&lt;br /&gt;
The conversion rules are the same as of the embedded predicate [[#convert|convert/2-&amp;gt;]], but &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; fails when [[#convert|convert/2-&amp;gt;]] generates conversion errors.&lt;br /&gt;
&lt;br /&gt;
This predicate succeeds if the corresponding conversion succeeds. Otherwise it fails. The &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate tries to perform a clean and genuine conversion of the given &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; into a value of the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;. The &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate will fail if the required conversion cannot be performed. When &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate succeeds, it returns the term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; converted to the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
For allowed conversions and rules of checked explicit conversions see [[#convert|convert/2-&amp;gt;]] predicate.&lt;br /&gt;
&lt;br /&gt;
See also [[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== uncheckedConvert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;uncheckedConvert : (&amp;lt;type&amp;gt; Type, Value) -&amp;gt; &amp;lt;type&amp;gt; Converted.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unchecked conversion of a value to another type.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ReturnTerm = uncheckedConvert(returnDomain, InputTerm)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vp&amp;gt;returnDomain&amp;lt;/vp&amp;gt;: Specifies a domain to which &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; predicate unsafely converts the specified &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; can be any domain accessible in the current scope, the &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; should has the same bit-size as the &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the value that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;#039;&amp;#039;InputTerm&amp;#039;&amp;#039; is an expression, then it will be evaluated before conversion.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned parameter &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; type.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; evaluates &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;, change the type to &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; without any modification of the memory pattern and unifies with &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt;. The &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; predicate performs no runtime checks. It makes only compile time checking of bit-size equality of the converted domains. So almost any term may be quite recklessly converted to any other term. So quite disastrous results may occur if you try to use variables incorrectly converted by &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;. Be extremely careful implementing &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;; we strongly recommend you always, when it is possible, using of [[#convert|convert/2-&amp;gt;]] and [[#tryConvert|tryConvert/2-&amp;gt;]]. But notice that, when an object is returned by COM system it is necessary to convert it by &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;, as Prolog program does not have information about its actual type.&lt;br /&gt;
&lt;br /&gt;
==== upperBound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;upperBound : (&amp;lt;numeric-domain&amp;gt; NumericDomain) -&amp;gt; &amp;lt;number-domain&amp;gt; UpperBound.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the upper bound value of the specified numeric domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;UpperBound = upperBound(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;upperBound&amp;lt;/vp&amp;gt; is a compiling-time predicate. The &amp;lt;vp&amp;gt;upperBound&amp;lt;/vp&amp;gt; returns the upper bound value of the specified numeric domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The return value &amp;lt;vp&amp;gt;UpperBound&amp;lt;/vp&amp;gt; belongs to the same domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter should be the name of any numerical domain; this domain name should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable).&lt;br /&gt;
&lt;br /&gt;
See also [[#lowerBound|lowerBound/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
Will cause a compile time error if the specified domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; is not numeric domain.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{LanguageReferenceSubarticle|Built-in entities/Predicates}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Predicates&amp;diff=4275</id>
		<title>Language Reference/Built-in entities/Predicates</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Predicates&amp;diff=4275"/>
		<updated>2016-04-06T08:45:28Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: /* sourcefile_timestamp */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;__NOTOC__&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#and_.28.2C.29|and/2]] &amp;lt;br&amp;gt; [[Language_Reference/Terms#and_.28.2C.29|,/2]]&lt;br /&gt;
|Term &amp;quot;and&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[#assert|assert/1]]&lt;br /&gt;
|Insert the specified fact at the end of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#asserta|asserta/1]]&lt;br /&gt;
|Insert a fact at the beginning of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#assertz|assertz/1]]&lt;br /&gt;
|Insert a fact at the end of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#bound|bound/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Test whether the specified variable is bound to a value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#class_name|class_name/0-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;ClassName&amp;#039;&amp;#039; that represents the name of the current interface or class.&lt;br /&gt;
|-&lt;br /&gt;
|[[#compare|compare/2-&amp;gt;]]&lt;br /&gt;
|Returns the result of the variables&amp;#039; comparison.&lt;br /&gt;
|-&lt;br /&gt;
|[[#convert|convert/2-&amp;gt;]]&lt;br /&gt;
|Checked term conversion.&lt;br /&gt;
|-&lt;br /&gt;
|[[#digitsOf|digitsOf/1-&amp;gt;]]&lt;br /&gt;
|Returns precision of the specified floating-point domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#errorExit|errorExit/1]] &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Performs a run-time error with the specified return code &amp;#039;&amp;#039;ErrorNumber&amp;#039;&amp;#039; and sets the internal error information.&lt;br /&gt;
|-&lt;br /&gt;
|[[#fail|fail/0]] &amp;lt;vp&amp;gt;failure&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Invoke backtracking.&lt;br /&gt;
|-&lt;br /&gt;
|[[#free|free/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Check whether a variable is free.&lt;br /&gt;
|-&lt;br /&gt;
|[[#fromEllipsis|fromEllipsis/1-&amp;gt;]]&lt;br /&gt;
|Creates the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; from the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#hasDomain|hasDomain/2]] &amp;lt;br&amp;gt; [[#hasDomain|hasDomain/2-&amp;gt;]]&lt;br /&gt;
|Declares/restricts the type of a variable or value.&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#in|in/2]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt; &amp;lt;br&amp;gt; [[Language_Reference/Terms#in|in/2]] &amp;lt;vp&amp;gt;nondeterm&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Infix operator &amp;quot;in&amp;quot; (in-test and in-iterator).&lt;br /&gt;
|-&lt;br /&gt;
|[[#isErroneous|isErroneous/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Returns the lower bound value of the specified numeric domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#lowerBound|lowerBound/1-&amp;gt;]]&lt;br /&gt;
|Returns the lower bound value of the specified numeric domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#maxDigits|maxDigits/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the value of digits (precision) of the basic domain corresponding to the specified floating-point domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#not|not/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Negate the result (success/fail) of subgoal.&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#or_.28.3B.29|or/2]] &amp;lt;br&amp;gt; [[Language_Reference/Terms#and_.28.3B.29|;/2]]&lt;br /&gt;
|Nondeterministic term &amp;quot;or&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#orelse|orelse]]&lt;br /&gt;
|Deterministic term &amp;quot;or&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[#predicate_fullname|predicate_fullname/1-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;PredicateFullName&amp;#039;&amp;#039; that represent the name of the predicate in which clause body &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; is called. The returned predicate name is qualified with a scope name.&lt;br /&gt;
|-&lt;br /&gt;
|[[#predicate_name|predicate_name/1-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;PredicateName&amp;#039;&amp;#039; that represent the name of the predicate in which clause body &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; is called. The returned predicate name is not qualified with a scope name.&lt;br /&gt;
|-&lt;br /&gt;
|[[#programPoint|programPoint/0-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the &amp;lt;vp&amp;gt;programPoint&amp;lt;/vp&amp;gt; corresponding to the place where it is called.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retract|retract/1]] &amp;lt;vp&amp;gt;nondeterm&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Remove a matched fact from the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retractall|retractall/1]]&lt;br /&gt;
|Remove all matching facts from the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retractFactDb|retractFactDb/1]]&lt;br /&gt;
|Remove all facts from the specified named internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeBitsOf|sizeBitsOf/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bits occupied in memory by an entity of the specified domain &amp;#039;&amp;#039;DomainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeOf|sizeOf/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bytes occupied in memory by the specified term.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeOfDomain|sizeOfDomain/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bytes occupied in memory by the entity of the specified domain &amp;#039;&amp;#039;DomainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_lineno|sourcefile_lineno/0-&amp;gt;]]&lt;br /&gt;
|Returns the current line number in the source file processed by the compiler .&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_name|sourcefile_name/0-&amp;gt;]]&lt;br /&gt;
|Returns the name of the source file processed by the compiler.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_timestamp|sourcefile_timestamp/0-&amp;gt;]]&lt;br /&gt;
|Returns the string representing the date and time of the source file processed by the compiler.&lt;br /&gt;
|-&lt;br /&gt;
|[[#succeed|succeed/0]]&lt;br /&gt;
|The predicate &amp;lt;vp&amp;gt;succeed/0&amp;lt;/vp&amp;gt; will always succeed.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toAny|toAny/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; to the value of the universal term type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toBinary|toBinary/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified Term to the binary representation.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toBoolean|toBoolean/1-&amp;gt;]]&lt;br /&gt;
|The purpose of this meta-predicate is to convert the deterministic call (to a predicate or fact) to the procedure that returns the value of &amp;lt;vp&amp;gt;boolean&amp;lt;/vp&amp;gt; domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toEllipsis|toEllipsis/1-&amp;gt;]]&lt;br /&gt;
|Creates the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; from the list of &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; type values.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toString|toString/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; to the string representation.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toTerm|toTerm/1-&amp;gt;]] &amp;lt;br&amp;gt; [[#toTerm|toTerm/2-&amp;gt;]]&lt;br /&gt;
|Converts the string/binary representation of the specified term &amp;#039;&amp;#039;SrcTerm&amp;#039;&amp;#039; into representation corresponding to the domain of &amp;#039;&amp;#039;PrologTerm&amp;#039;&amp;#039; variable of the return value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#tryToTerm|tryToTerm/1-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt; &amp;lt;br&amp;gt; [[#tryToTerm|tryToTerm/2-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Converts the string/binary representation of the specified term &amp;#039;&amp;#039;SrcTerm&amp;#039;&amp;#039; into representation corresponding to the domain of &amp;#039;&amp;#039;PrologTerm&amp;#039;&amp;#039; variable of the return value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#tryConvert|tryConvert/2-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Checks whether the input term &amp;#039;&amp;#039;InputTerm&amp;#039;&amp;#039; can be strictly converted into the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; and returns the converted term &amp;#039;&amp;#039;ReturnTerm&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]]&lt;br /&gt;
|Unchecked conversion of domains.&lt;br /&gt;
|-&lt;br /&gt;
|[[#upperBound|upperBound/1-&amp;gt;]]&lt;br /&gt;
|Returns the upper bound value of the specified numeric domain.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following predicates are deprecated:&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
| finally/2&lt;br /&gt;
| Use [[Language_Reference/Terms#try-finally| &amp;lt;vp&amp;gt;try-finally&amp;lt;/vp&amp;gt;]] constuction instead.&lt;br /&gt;
|-&lt;br /&gt;
| findall/3&lt;br /&gt;
| Use list comprehension [[Language_Reference/Terms#List_Comprehension| &amp;lt;vp&amp;gt;[ ... || ...  ]&amp;lt;/vp&amp;gt;]] instead&lt;br /&gt;
|-&lt;br /&gt;
| trap/3 &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
| Use [[Language_Reference/Terms#try-catch| &amp;lt;vp&amp;gt;try-catch&amp;lt;/vp&amp;gt;]] constuction instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== and ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#and_.28.2C.29|and (,)]].&lt;br /&gt;
&lt;br /&gt;
==== assert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;assert : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert the specified fact at the end of the matched internal facts database&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;assert(Fact)&amp;lt;/vp&amp;gt; inserts &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; in the matched internal facts database after any other stored facts for the corresponding database predicate. &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; must be a term belonging to the domain of an internal facts database. &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; applied to a single fact changes the existing instance of a fact to the specified one. &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; has the same effect as [[#assertz|assertz/1]]. See also [[#asserta|asserta/1]].&lt;br /&gt;
&lt;br /&gt;
Notice that the combination of [[#retract|retract/1]] and &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; like the following can lead to endless loop:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;loop() :-&lt;br /&gt;
  retract(fct(X)),&lt;br /&gt;
     ...           % creating Y from X&lt;br /&gt;
     assert(fct(Y)),&lt;br /&gt;
  fail.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem is that the retract in first line will eventually retract the fact asserted in the last line, because that fact is inserted &amp;#039;&amp;#039;last&amp;#039;&amp;#039; in the fact chain.&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Attempt to assert a second instance to a fact declared as determ.&lt;br /&gt;
&lt;br /&gt;
==== asserta ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;asserta : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert a fact at the beginning of the matched internal facts database.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;asserta(Fact)&amp;lt;/vp&amp;gt; predicate inserts a &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; in the matched internal facts database before any other stored facts for the corresponding predicate. The &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; must be a term belonging to the domain of an internal facts database. The &amp;lt;vp&amp;gt;asserta/1&amp;lt;/vp&amp;gt; applied to a single fact changes the existing instance of a fact to the specified one. See also [[#assert|assert/1]] and [[#assertz|assertz/1]].&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Attempt to a fact declared as determ, but the fact instance already exists.&lt;br /&gt;
&lt;br /&gt;
==== assertz ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;assertz : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;assertz&amp;lt;/vp&amp;gt; does exactly the same as the [[#assert|assert/1]] predicate.&lt;br /&gt;
&lt;br /&gt;
==== bound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;bound : (&amp;lt;variable&amp;gt; Variable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test whether the specified variable is bound to a value.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;bound(Variable)&amp;lt;/vp&amp;gt; succeeds if &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is bound and fails if it is free. The &amp;lt;vp&amp;gt;bound&amp;lt;/vp&amp;gt; predicate is used to control flow patterns and to check the binding of reference variables. The &amp;lt;vp&amp;gt;bound&amp;lt;/vp&amp;gt; predicate treats the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; as bound if any of it&amp;#039;s part is instantiated.&lt;br /&gt;
&lt;br /&gt;
See also [[#free|free/1]].&lt;br /&gt;
&lt;br /&gt;
==== class_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class_Name : () -&amp;gt; string ClassName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compile time predicate returns the string &amp;lt;vp&amp;gt;ClassName&amp;lt;/vp&amp;gt; that represents the name of the current interface or class.&lt;br /&gt;
&lt;br /&gt;
==== compare ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;compare : (A Left, A Right) -&amp;gt; compareResult CompareResult.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comparison of two terms of the same domain, resturns the value of [[#compareResult|compareResult]] domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;CompareResult&amp;lt;/vp&amp;gt; = compare(&amp;quot;&amp;lt;vp&amp;gt;bar&amp;lt;/vp&amp;gt;&amp;quot;, &amp;quot;&amp;lt;vp&amp;gt;foo&amp;lt;/vp&amp;gt;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== convert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;convert : (&amp;lt;type&amp;gt; Type, Term) -&amp;gt; &amp;lt;type&amp;gt; Converted.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checked term conversion.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; = convert(returnDomain, &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;returnDomain&amp;lt;/vpbnf&amp;gt;: Specifies a domain to which function &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; converts &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be a name of built-in Visual Prolog domain, an interface domain, a name of such user defined domain that is synonym to one of built-in Visual Prolog domains, a numeric domain, binary and pointer domains. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the value that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; is an expression, then it will be evaluated before the conversion.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned parameter &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; type.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;convert&amp;lt;/vp&amp;gt; predicate performs a clean and genuine conversion of the given &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;, returning a new term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; of the specified new domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;. If &amp;lt;vp&amp;gt;convert&amp;lt;/vp&amp;gt; cannot perform the required conversion, it rises errors. The similar functionality is provided by the [[#tryConvert|tryConvert/2-&amp;gt;]] predicate, but &amp;lt;vp&amp;gt;tryConvert-&amp;gt;&amp;lt;/vp&amp;gt; fails and does not produce any runtime errors if it cannot perform the conversion.&lt;br /&gt;
&lt;br /&gt;
===== Allowed conversions =====&lt;br /&gt;
&lt;br /&gt;
* Between numerical domains.&lt;br /&gt;
* Between interface types.&lt;br /&gt;
* Between [[#string|string]] and [[#symbol|symbol]] domains.&lt;br /&gt;
* From [[#binary|binary]] to [[#pointer|pointer]].&lt;br /&gt;
* For synonyms of mentioned domains.&lt;br /&gt;
* Between [http://wiki.visual-prolog.com/index.php?title=How_To_Remove_Reference_Domains_from_a_Project reference] domains and corresponding non-reference domains.&lt;br /&gt;
&lt;br /&gt;
The contrast to these is [[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]] predicate, which performs an unchecked conversion between terms from any domains, which have the same bit-size.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; (or [[#tryConvert|tryConvert/2-&amp;gt;]]) predicate accomplishes a checked explicit conversion, when the source and target domains are statically known during the compilation. The result of an explicit conversion can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ok&amp;#039;&amp;#039;&amp;#039; the successful conversion to the target domain;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;run-time-check&amp;#039;&amp;#039;&amp;#039; the conversion to the target domain with generation of run-time checking for compatibility;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;error&amp;#039;&amp;#039;&amp;#039; the conversion is impossible, error output.&lt;br /&gt;
&lt;br /&gt;
===== Rules of Checked Explicit Conversions =====&lt;br /&gt;
&lt;br /&gt;
* Synonyms of domains are converted using the same rules that are applied to the domains themselves.&lt;br /&gt;
* Numerical domains can be converted to the numerical domains only.&lt;br /&gt;
* Integral constants are the representatives of the anonymous integral domain: &amp;lt;vp&amp;gt;[const .. const]&amp;lt;/vp&amp;gt;.&lt;br /&gt;
* Real constants are the representatives of the anonymous real domain: &amp;lt;vp&amp;gt;digits&amp;lt;/vp&amp;gt; &amp;lt;vp&amp;gt;dig [const .. const]&amp;lt;/vp&amp;gt;, where &amp;lt;vp&amp;gt;dig&amp;lt;/vp&amp;gt; is the number of the digits in mantissa without insignificant zeroes.&lt;br /&gt;
* A value of the symbol domain can be converted to the string domain and vice versa.&lt;br /&gt;
* A value of binary domain can be converted to the pointer domain.&lt;br /&gt;
* The domains that are implicitly introduced for interfaces can be converted only to the interface domains according to the rules specified below.&lt;br /&gt;
* All other domains cannot be converted.&lt;br /&gt;
&lt;br /&gt;
===== Conversions of Numerical Domains =====&lt;br /&gt;
&lt;br /&gt;
* The range is considered first during such conversion. If the ranges of source and target do not intersect, then an error is produced. If the ranges of source and target only partially intersect, then run-time checking is generated. Also, if one of domains is real and another is an integral one, then the integer range is converted to the real range before the comparison.&lt;br /&gt;
* When input term in real and output is integer, then &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; and [[#tryConvert|tryConvert/2-&amp;gt;]] predicates truncate the input value to the nearest integer value, which is nearer to zero.&lt;br /&gt;
&lt;br /&gt;
===== Conversions of Interface Types =====&lt;br /&gt;
&lt;br /&gt;
Predicate &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; allow to convert any object to any interface type. The actual correctness of such conversion is checked at runtime. When object is created, its type is internally stored, therefore when the object is passed as argument it still remember about its original type. This original type is used for checking allowed conversions. The example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface x&lt;br /&gt;
      supports a, b&lt;br /&gt;
end interface x&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If object is created by class, which implements &amp;lt;vp&amp;gt;x&amp;lt;/vp&amp;gt; interface, and then object is passed as parameter of type &amp;lt;vp&amp;gt;a&amp;lt;/vp&amp;gt; to some predicate, then it is allowed to convert the object to &amp;lt;vp&amp;gt;b&amp;lt;/vp&amp;gt; type.&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Check range error.&lt;br /&gt;
* Unsupported interface type.&lt;br /&gt;
&lt;br /&gt;
==== digitsOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;digitsOf : (&amp;lt;real-domain&amp;gt; Domain) -&amp;gt; unsigned.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns precision of the specified floating-point domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Precision = digitsof(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input parameter &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; of this compiling-time predicate is a floating-point domain, it should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable). The predicate returns the number &amp;lt;vpbnf&amp;gt;&amp;lt;Precision&amp;gt;&amp;lt;/vpbnf&amp;gt; that was determined by the &amp;lt;vp&amp;gt;digits&amp;lt;/vp&amp;gt; attribute in the domain declaration.&lt;br /&gt;
&lt;br /&gt;
The compiler guarantees that values of the domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; will have at least &amp;lt;vpbnf&amp;gt;&amp;lt;Precision&amp;gt;&amp;lt;/vpbnf&amp;gt; number of significant decimal digits.&lt;br /&gt;
&lt;br /&gt;
==== errorExit ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;errorExit : (unsigned ErrorNumber) erroneous.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs a run-time error with the specified return code &amp;lt;vp&amp;gt;ErrorNumber&amp;lt;/vp&amp;gt;, which can be used in the [[#try-catch-finally|try-catch-finally]].&lt;br /&gt;
&lt;br /&gt;
==== fail ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;fail : () failure.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; predicate forces failure and, hence, always causes backtracking. A clause that fails (with &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; or for some other reason) cannot bind output arguments.&lt;br /&gt;
&lt;br /&gt;
==== free ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;free : (&amp;lt;variableName&amp;gt; Variable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check whether a variable is free.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;free(Variable)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;free&amp;lt;/vp&amp;gt; predicate succeeds if the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is free and fails if &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is bound. The &amp;lt;vp&amp;gt;free&amp;lt;/vp&amp;gt; predicate treats the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; as bound if any of it&amp;#039;s part are instantiated.&lt;br /&gt;
&lt;br /&gt;
See also [[#bound|bound/1]].&lt;br /&gt;
&lt;br /&gt;
==== fromEllipsis ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;fromEllipsis : (...) -&amp;gt; any* AnyTermList.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate creates the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; from the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039; (i.e. from the special varying parameters block).&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;AnyTermList = fromEllipsis(EllipsisBlock )&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#toEllipsis|toEllipsis/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== hasDomain ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;hasDomain&amp;lt;/vp&amp;gt; is not really a predicate, but more a type declaration/restriction.  It has two forms a non-function for declaring/restricting the type of a variable and a function form for declaring/restricting the type of a value.&lt;br /&gt;
&lt;br /&gt;
The non-function form is called with a type as first parmeter and a variable as second parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;hasDomain : (&amp;lt;type&amp;gt; Type, Type Variable).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only effect of the call is that the &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; will be restricted to the type &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The variable can be free, bound or of some mixed flow and the binding of the variable will not change in any way.&lt;br /&gt;
&lt;br /&gt;
The function form is called with a type as first argument and a value as second argument, and it returns the same value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;hasDomain : (&amp;lt;type&amp;gt; Type, Type Value) -&amp;gt; Type Value.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only effect of the call is to ensure that the &amp;lt;vp&amp;gt;Value&amp;lt;/vp&amp;gt; will be restricted to the type &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== lowerBound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;lowerBound : (&amp;lt;numeric-domain&amp;gt; NumericDomain) -&amp;gt; &amp;lt;numeric-domain&amp;gt; LowerBound.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the lower bound of the specified &amp;lt;vp&amp;gt;NumericDomain&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;LowerBoundValue = lowerBound(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;lowerBound&amp;lt;/vp&amp;gt; is a compiling-time predicate. The &amp;lt;vp&amp;gt;lowerBound&amp;lt;/vp&amp;gt; returns the lower bound value &amp;lt;vp&amp;gt;LowerBoundValue&amp;lt;/vp&amp;gt; of the specified numeric domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The return value &amp;lt;vp&amp;gt;LowerBoundValue&amp;lt;/vp&amp;gt; belongs to the same domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter should be the name of any numerical domain; this domain name should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable). See also [[#upperBound|upperBound/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
It will give a compile time error if the specified domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; is not numeric domain.&lt;br /&gt;
&lt;br /&gt;
==== in ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#in|in/2]].&lt;br /&gt;
&lt;br /&gt;
==== isErroneous ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;isErroneous : (&amp;lt;fact-variable&amp;gt; FactVariable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate succeeds if the specified fact variable is &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;isErroneous(factVariableName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate succeeds if the specified fact variable &amp;lt;vp&amp;gt;factVariableName&amp;lt;/vp&amp;gt; has the &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt; value, otherwise it fails.&lt;br /&gt;
&lt;br /&gt;
==== maxDigits ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;maxDigits : (&amp;lt;real-domain&amp;gt; RealDomain) -&amp;gt; unsigned MaxDigits&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the value of digits (precision) of the basic domain corresponding to the specified floating-point domain &amp;lt;vp&amp;gt;RealDomain&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;MaxDigitsNumber = maxdigits(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The return maximal number of digits &amp;lt;vp&amp;gt;MaxDigitsNumber&amp;lt;/vp&amp;gt; for the &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter, which should be the name of a &amp;lt;vp&amp;gt;real&amp;lt;/vp&amp;gt; domain.&lt;br /&gt;
&lt;br /&gt;
==== not ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#not|not]].&lt;br /&gt;
&lt;br /&gt;
==== or ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#or_.28.3B.29|or (;)]].&lt;br /&gt;
&lt;br /&gt;
==== orelse ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#orelse|orelse]].&lt;br /&gt;
&lt;br /&gt;
==== predicate_fullname ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicate_fullname : () -&amp;gt; string PredicateFullName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;PredicateFullName&amp;lt;/vp&amp;gt; of the predicate in which it is invoked. The returned predicate name is qualified with a scope name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;predicate_fullname&amp;lt;/vp&amp;gt; can only be used inside a clause. Use of &amp;lt;vp&amp;gt;predicate_fullname&amp;lt;/vp&amp;gt; in other places causes a compile time error. See also [[#predicate_name|predicate_name]].&lt;br /&gt;
&lt;br /&gt;
==== predicate_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicate_name : () -&amp;gt; string PredicateName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;PredicateName&amp;lt;/vp&amp;gt; of the predicate in which it is invoked.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; can only be used inside a clause. Use of &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; in other places causes a compile time error. See also [[#predicate_fullname|predicate_fullname]]&lt;br /&gt;
&lt;br /&gt;
==== programPoint ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;programPoint : () -&amp;gt; core::programPoint ProgramPoint.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;programPoint&amp;lt;/vp&amp;gt; corresponding to the place where it is invoked.&lt;br /&gt;
&lt;br /&gt;
==== retract ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract : (&amp;lt;fact-term&amp;gt; FactTerm) nondeterm anyflow.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Successively removes the first matching fact from the facts database.  Fails when no more facts match.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract(FactTemplate)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; should be a fact term. The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate deletes the first fact that matches the &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; in the appropriated facts database. During backtracking, the rest of the matching facts will be deleted.&lt;br /&gt;
&lt;br /&gt;
Notice that &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can have any level of instantiation. The &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; is matched with the facts in the facts database, which means that any free variables will be bound in the call to &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can contain any anonymous variables. That is, variables with names consisting from the single underscore &amp;lt;vp&amp;gt;_&amp;lt;/vp&amp;gt; or a variable with a name starting with an underscore &amp;lt;vp&amp;gt;_AnyValue&amp;lt;/vp&amp;gt; if the variable occurs only once in the clause. For example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract(person(&amp;quot;Hans&amp;quot;, _Age)),&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will retract the first matched person fact that has &amp;quot;&amp;lt;vp&amp;gt;Hans&amp;lt;/vp&amp;gt;&amp;quot; as the first argument and anything as the second argument.&lt;br /&gt;
&lt;br /&gt;
When retracting a fact, which is declared to be determ, the call to &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; will be deterministic.&lt;br /&gt;
&lt;br /&gt;
See also [[#retractall|retractall/1]] and [[#retractFactDb|retractFactDb]].&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate cannot be applied to single facts or fact variables.&lt;br /&gt;
&lt;br /&gt;
Be careful calling &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; with free &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; variable if any single fact is declared in the project current scope. If you retract a single fact, then the run-time error is generated. The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate fails when there are no more matches.&lt;br /&gt;
&lt;br /&gt;
==== retractall ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractall : (&amp;lt;fact-term&amp;gt; FactTerm) .&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove all matching facts from the facts database.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractall(FactTemplate)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; should be a fact term.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt; retracts all facts which match the given &amp;#039;&amp;#039;FactTemplate&amp;#039;&amp;#039;. It always succeeds, even if no facts were retracted.&lt;br /&gt;
&lt;br /&gt;
Attempting to retract a &amp;lt;vp&amp;gt;single&amp;lt;/vp&amp;gt; fact will cause a compile time error.&lt;br /&gt;
&lt;br /&gt;
It is not possible to obtain any output values from &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt;. For this reason, the variables in the call must be bound or be a single underscores (anonymous). Notice that  &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can have any level of instantiation, but free variables must be single underscores (&amp;quot;unconditionally anonymous&amp;quot;). In difference to [[#retract|retract/1]] &amp;quot;conditionally&amp;quot; anonymous variables with names starting from the underscore (like &amp;lt;vp&amp;gt;_AnyValue&amp;lt;/vp&amp;gt;) cannot be used in &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
See also [[#retract|retract/1]] and [[#retractFactDb|retractFactDb/1]].&lt;br /&gt;
&lt;br /&gt;
==== retractFactDb ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractFactDb : (factDB FactDB).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove all facts from the named internal facts database &amp;lt;vp&amp;gt;FactDB&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractFactDb(FactDB)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retractFactDb/1&amp;lt;/vp&amp;gt; removes all facts from the named facts database &amp;lt;vp&amp;gt;FactDB&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Notice, it is impossible to retract &amp;lt;vp&amp;gt;single&amp;lt;/vp&amp;gt; facts and fact variables, so the predicate leaves such ones as they are.&lt;br /&gt;
&lt;br /&gt;
See also [[#retractall|retractall/1]] and [[#retract|retract/1]].&lt;br /&gt;
&lt;br /&gt;
==== retractAll/2 ====&lt;br /&gt;
&lt;br /&gt;
Obsolete predicate! Use [[#retractFactDb|retractFactDb/1]] instead.&lt;br /&gt;
&lt;br /&gt;
==== sizeBitsOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeBitsOf : (&amp;lt;domain&amp;gt; DomainName) -&amp;gt; unsigned BitSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bits occupied in memory by an entity of the specified domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;BitSize = sizeBitsOf(DomainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compiling-time predicate receives the domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt; as input parameter and return the size of memory that is occupied by the entity of the given domain. The result is measured in bits. For the integer domains &amp;lt;vp&amp;gt;sizeBitsOf/1-&amp;gt;&amp;lt;/vp&amp;gt; predicate returns the value that was defined for the size-field in a domain&amp;#039;s declaration.&lt;br /&gt;
&lt;br /&gt;
The following is always true for the integral domains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOfDomain(domain)*8 - 7 &amp;lt;= sizeBitsOf(domain) &amp;lt;= sizeOfDomain(domain)*8&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#sizeOfDomain|sizeOfDomain]]/1-&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== sizeOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOf : (Type Term) -&amp;gt; integer ByteSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bytes occupied in memory by the specified term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ByteSize = sizeOf(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;sizeOf/1-&amp;gt;&amp;lt;/vp&amp;gt; function receives a term as input parameter and returns value &amp;lt;vp&amp;gt;ByteSize&amp;lt;/vp&amp;gt; that specifies the number of bytes occupied in memory by this term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== sizeOfDomain ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOfDomain : (&amp;lt;domain&amp;gt; Domain) -&amp;gt; integer ByteSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bytes occupied in memory by the entity of the specified domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ByteSize = sizeOfDomain(DomainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compiling-time predicate receives the domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt; as input parameter and return the size of memory that is occupied by the entity of the given domain. The result is measured in bytes. The returned value &amp;lt;vp&amp;gt;ByteSize&amp;lt;/vp&amp;gt; belongs to the integer domain. Compare with [[#sizeBitsOf|sizeBitsOf/1-&amp;gt;]], which returns size of a domain measured in bits.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_lineno ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_lineno : () -&amp;gt; unsigned LineNumber.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current line number in the source file processed by the compiler.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_name : () -&amp;gt; string FileName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the name of the source file processed by the compiler.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_timestamp ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_timestamp : () -&amp;gt; string TimeStamp..&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a string that represents the date and time of the currently compiled source file in format &amp;lt;vp&amp;gt;YYYY-MM-DD&amp;lt;/vp&amp;gt; &amp;lt;vp&amp;gt;HH:mm:ss&amp;lt;/vp&amp;gt;. Where:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vp&amp;gt;YYYY&amp;lt;/vp&amp;gt; - Year.&lt;br /&gt;
* &amp;lt;vp&amp;gt;MM&amp;lt;/vp&amp;gt; - Month.&lt;br /&gt;
* &amp;lt;vp&amp;gt;DD&amp;lt;/vp&amp;gt; - Day.&lt;br /&gt;
* &amp;lt;vp&amp;gt;HH&amp;lt;/vp&amp;gt; - Hour.&lt;br /&gt;
* &amp;lt;vp&amp;gt;mm&amp;lt;/vp&amp;gt; - Minute.&lt;br /&gt;
* &amp;lt;vp&amp;gt;ssS&amp;lt;/vp&amp;gt; - Second.&lt;br /&gt;
&lt;br /&gt;
==== succeed ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;succeed : ().&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate &amp;lt;vp&amp;gt;succeed/0&amp;lt;/vp&amp;gt; will always succeed.&lt;br /&gt;
&lt;br /&gt;
==== toAny ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toAny : (Term) -&amp;gt; any UniversalTypeValue.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to the value of universal term type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;UniversalTypeValue = toAny(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A term of the &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; domain can be converted back to its original type using the &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicates (see {{lang2|Built-in entities/Predicates|toTerm|toTerm}}).&lt;br /&gt;
&lt;br /&gt;
==== toBinary ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toBinary : (Term) -&amp;gt; binary Serialized.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to [[#binary|binary]] representation.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Serialized = toBinary(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a binary, it can safely be stored in a file or sent over a network to another program. Later the obtained binary value &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; can be converted back to a Visual Prolog term, using [[#toTerm|toTerm/1-&amp;gt;]] function (the domain for the reversed term should be adequate to &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) for the reverse conversion.&lt;br /&gt;
&lt;br /&gt;
==== toBoolean ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toBoolean : (&amp;lt;term&amp;gt; SubGoal) -&amp;gt; boolean Succeed.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of this meta-predicate is to convert the deterministic call (to a predicate or fact) to the procedure that returns the value of [[#boolean|boolean]] domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this meta-predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;True_or_False = toBoolean(deterministic_call)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;toBoolean/1-&amp;gt;&amp;lt;/vp&amp;gt; meta-predicate returns [[#boolean|boolean]] value. The result is &amp;lt;vp&amp;gt;true&amp;lt;/vp&amp;gt; if &amp;#039;&amp;#039;deterministic_call&amp;#039;&amp;#039; succeeds. The result is &amp;lt;vp&amp;gt;false&amp;lt;/vp&amp;gt; if &amp;#039;&amp;#039;deterministic_call&amp;#039;&amp;#039; fails.&lt;br /&gt;
&lt;br /&gt;
==== toEllipsis ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toEllipsis : (any* AnyTermList) -&amp;gt; ....&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate creates &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039; (i.e. the special varying parameters block) from the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;. Such &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; can be later passed to a predicate which expects the varying number of arguments (i.e. is declared with the ellipsis (&amp;#039;&amp;#039;...&amp;#039;&amp;#039;)), like &amp;lt;vp&amp;gt;write/...&amp;lt;/vp&amp;gt;, at the position of the ellipsis (&amp;#039;&amp;#039;...&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;EllipsisBlock = toEllipsis(&amp;lt;any_term_list&amp;gt;), write(EllipsisBlock)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#fromEllipsis|fromEllipsis/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== toString ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toString : (Term) -&amp;gt; string Serialized.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to string representation.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Serialized = toString(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a string, it can safely be stored in a file or sent over a network to another program. Later the obtained string value can be converted back to a Visual Prolog term, using [[#toTerm|toTerm/1-&amp;gt;]] function (the domain of the return value should be adequate to &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) for the reverse conversion.&lt;br /&gt;
&lt;br /&gt;
==== toTerm ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toTerm : (string Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (binary Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (any Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, string Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, binary Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, any Serialized) -&amp;gt; Term.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the string/binary/any representation of the specified term &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; into representation corresponding to the domain of &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; variable of the return value. The domain can be stated explicitly or it can be left to the compiler to determine a suitable domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Term = toTerm(Serialized) % with implicit domain&lt;br /&gt;
Term = toTerm(domainName, Serialized) % with explicit domain, domainName&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the domain is not specified the compiler must be able to determine the domain for the returned value &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; at compile-time. Notice that binary version of &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicate performs almost byte to byte conversion and only checking general compatibility of &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; data with the domain required to the return value &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;. The programmer is wholly responsible for providing binary data of &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; that can be correctly converted to the term of the desired domain. The &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicates are counterparts to predicates [[#toBinary|toBinary/1-&amp;gt;]] and [[#toString|toString/1-&amp;gt;]]. When a &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a binary or string representation &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; (by [[#toBinary|toBinary/1-&amp;gt;]] or [[#toString|toString/1-&amp;gt;]] or [[#toAny|toAny/1-&amp;gt;]] correspondingly), it can safely be stored in a file or sent over a network to another program. Later the corresponding &amp;lt;vp&amp;gt;toTerm/1&amp;lt;/vp&amp;gt;-&amp;gt; function can convert the obtained string/binary value &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; back to a Visual Prolog term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;. For correctness of the reverse conversion the domain of the clause variable &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; should be adequate to the initial domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
See also [[#tryToTerm|tryToTerm]].&lt;br /&gt;
&lt;br /&gt;
It gives a compile time error if the compiler cannot determine the return domain.&lt;br /&gt;
&lt;br /&gt;
Exceptions&lt;br /&gt;
&lt;br /&gt;
* Run time errors are generated when the &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicate cannot convert the string or binary into a term of the specified domain.&lt;br /&gt;
&lt;br /&gt;
==== tryToTerm ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;tryToTerm : (string Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (binary Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (any Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, string Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, binary Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, any Serialized) -&amp;gt; Term.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Converts the string/binary/any representation &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; into a term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;  like [[#toTerm|toTerm]]. The only difference between the predicates is that &amp;lt;vp&amp;gt;tryToTerm&amp;lt;/vp&amp;gt; fails if it cannot convert the string or binary or any into a term of the specified domain whereas toTerm raises an exception.&lt;br /&gt;
&lt;br /&gt;
See also [[#toTerm|toTerm]].&lt;br /&gt;
&lt;br /&gt;
==== tryConvert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;tryConvert : (&amp;lt;type&amp;gt; Type, Value) -&amp;gt; &amp;lt;type&amp;gt; Converted determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the input term &amp;lt;vp&amp;gt;Value&amp;lt;/vp&amp;gt; can be strictly converted into the specified domain &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt; and returns the converted term &amp;lt;vp&amp;gt;Converted&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ReturnTerm = tryConvert(returnDomain, InputTerm)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vp&amp;gt;returnDomain&amp;lt;/vp&amp;gt;: Specifies a domain to which &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate tries to convert the specified &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; can be any domain accessible in the current scope. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the term that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; is an expression, then it will be evaluated before conversion.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; domain.&lt;br /&gt;
&lt;br /&gt;
The conversion rules are the same as of the embedded predicate [[#convert|convert/2-&amp;gt;]], but &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; fails when [[#convert|convert/2-&amp;gt;]] generates conversion errors.&lt;br /&gt;
&lt;br /&gt;
This predicate succeeds if the corresponding conversion succeeds. Otherwise it fails. The &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate tries to perform a clean and genuine conversion of the given &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; into a value of the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;. The &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate will fail if the required conversion cannot be performed. When &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate succeeds, it returns the term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; converted to the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
For allowed conversions and rules of checked explicit conversions see [[#convert|convert/2-&amp;gt;]] predicate.&lt;br /&gt;
&lt;br /&gt;
See also [[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== uncheckedConvert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;uncheckedConvert : (&amp;lt;type&amp;gt; Type, Value) -&amp;gt; &amp;lt;type&amp;gt; Converted.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unchecked conversion of a value to another type.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ReturnTerm = uncheckedConvert(returnDomain, InputTerm)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vp&amp;gt;returnDomain&amp;lt;/vp&amp;gt;: Specifies a domain to which &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; predicate unsafely converts the specified &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; can be any domain accessible in the current scope, the &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; should has the same bit-size as the &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the value that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;#039;&amp;#039;InputTerm&amp;#039;&amp;#039; is an expression, then it will be evaluated before conversion.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned parameter &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; type.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; evaluates &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;, change the type to &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; without any modification of the memory pattern and unifies with &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt;. The &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; predicate performs no runtime checks. It makes only compile time checking of bit-size equality of the converted domains. So almost any term may be quite recklessly converted to any other term. So quite disastrous results may occur if you try to use variables incorrectly converted by &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;. Be extremely careful implementing &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;; we strongly recommend you always, when it is possible, using of [[#convert|convert/2-&amp;gt;]] and [[#tryConvert|tryConvert/2-&amp;gt;]]. But notice that, when an object is returned by COM system it is necessary to convert it by &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;, as Prolog program does not have information about its actual type.&lt;br /&gt;
&lt;br /&gt;
==== upperBound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;upperBound : (&amp;lt;numeric-domain&amp;gt; NumericDomain) -&amp;gt; &amp;lt;number-domain&amp;gt; UpperBound.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the upper bound value of the specified numeric domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;UpperBound = upperBound(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;upperBound&amp;lt;/vp&amp;gt; is a compiling-time predicate. The &amp;lt;vp&amp;gt;upperBound&amp;lt;/vp&amp;gt; returns the upper bound value of the specified numeric domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The return value &amp;lt;vp&amp;gt;UpperBound&amp;lt;/vp&amp;gt; belongs to the same domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter should be the name of any numerical domain; this domain name should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable).&lt;br /&gt;
&lt;br /&gt;
See also [[#lowerBound|lowerBound/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
Will cause a compile time error if the specified domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; is not numeric domain.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{LanguageReferenceSubarticle|Built-in entities/Predicates}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Predicates&amp;diff=4274</id>
		<title>Language Reference/Built-in entities/Predicates</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Predicates&amp;diff=4274"/>
		<updated>2016-04-06T08:41:59Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: /* toEllipsis */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;__NOTOC__&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#and_.28.2C.29|and/2]] &amp;lt;br&amp;gt; [[Language_Reference/Terms#and_.28.2C.29|,/2]]&lt;br /&gt;
|Term &amp;quot;and&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[#assert|assert/1]]&lt;br /&gt;
|Insert the specified fact at the end of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#asserta|asserta/1]]&lt;br /&gt;
|Insert a fact at the beginning of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#assertz|assertz/1]]&lt;br /&gt;
|Insert a fact at the end of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#bound|bound/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Test whether the specified variable is bound to a value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#class_name|class_name/0-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;ClassName&amp;#039;&amp;#039; that represents the name of the current interface or class.&lt;br /&gt;
|-&lt;br /&gt;
|[[#compare|compare/2-&amp;gt;]]&lt;br /&gt;
|Returns the result of the variables&amp;#039; comparison.&lt;br /&gt;
|-&lt;br /&gt;
|[[#convert|convert/2-&amp;gt;]]&lt;br /&gt;
|Checked term conversion.&lt;br /&gt;
|-&lt;br /&gt;
|[[#digitsOf|digitsOf/1-&amp;gt;]]&lt;br /&gt;
|Returns precision of the specified floating-point domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#errorExit|errorExit/1]] &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Performs a run-time error with the specified return code &amp;#039;&amp;#039;ErrorNumber&amp;#039;&amp;#039; and sets the internal error information.&lt;br /&gt;
|-&lt;br /&gt;
|[[#fail|fail/0]] &amp;lt;vp&amp;gt;failure&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Invoke backtracking.&lt;br /&gt;
|-&lt;br /&gt;
|[[#free|free/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Check whether a variable is free.&lt;br /&gt;
|-&lt;br /&gt;
|[[#fromEllipsis|fromEllipsis/1-&amp;gt;]]&lt;br /&gt;
|Creates the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; from the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#hasDomain|hasDomain/2]] &amp;lt;br&amp;gt; [[#hasDomain|hasDomain/2-&amp;gt;]]&lt;br /&gt;
|Declares/restricts the type of a variable or value.&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#in|in/2]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt; &amp;lt;br&amp;gt; [[Language_Reference/Terms#in|in/2]] &amp;lt;vp&amp;gt;nondeterm&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Infix operator &amp;quot;in&amp;quot; (in-test and in-iterator).&lt;br /&gt;
|-&lt;br /&gt;
|[[#isErroneous|isErroneous/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Returns the lower bound value of the specified numeric domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#lowerBound|lowerBound/1-&amp;gt;]]&lt;br /&gt;
|Returns the lower bound value of the specified numeric domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#maxDigits|maxDigits/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the value of digits (precision) of the basic domain corresponding to the specified floating-point domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#not|not/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Negate the result (success/fail) of subgoal.&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#or_.28.3B.29|or/2]] &amp;lt;br&amp;gt; [[Language_Reference/Terms#and_.28.3B.29|;/2]]&lt;br /&gt;
|Nondeterministic term &amp;quot;or&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#orelse|orelse]]&lt;br /&gt;
|Deterministic term &amp;quot;or&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[#predicate_fullname|predicate_fullname/1-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;PredicateFullName&amp;#039;&amp;#039; that represent the name of the predicate in which clause body &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; is called. The returned predicate name is qualified with a scope name.&lt;br /&gt;
|-&lt;br /&gt;
|[[#predicate_name|predicate_name/1-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;PredicateName&amp;#039;&amp;#039; that represent the name of the predicate in which clause body &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; is called. The returned predicate name is not qualified with a scope name.&lt;br /&gt;
|-&lt;br /&gt;
|[[#programPoint|programPoint/0-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the &amp;lt;vp&amp;gt;programPoint&amp;lt;/vp&amp;gt; corresponding to the place where it is called.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retract|retract/1]] &amp;lt;vp&amp;gt;nondeterm&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Remove a matched fact from the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retractall|retractall/1]]&lt;br /&gt;
|Remove all matching facts from the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retractFactDb|retractFactDb/1]]&lt;br /&gt;
|Remove all facts from the specified named internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeBitsOf|sizeBitsOf/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bits occupied in memory by an entity of the specified domain &amp;#039;&amp;#039;DomainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeOf|sizeOf/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bytes occupied in memory by the specified term.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeOfDomain|sizeOfDomain/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bytes occupied in memory by the entity of the specified domain &amp;#039;&amp;#039;DomainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_lineno|sourcefile_lineno/0-&amp;gt;]]&lt;br /&gt;
|Returns the current line number in the source file processed by the compiler .&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_name|sourcefile_name/0-&amp;gt;]]&lt;br /&gt;
|Returns the name of the source file processed by the compiler.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_timestamp|sourcefile_timestamp/0-&amp;gt;]]&lt;br /&gt;
|Returns the string representing the date and time of the source file processed by the compiler.&lt;br /&gt;
|-&lt;br /&gt;
|[[#succeed|succeed/0]]&lt;br /&gt;
|The predicate &amp;lt;vp&amp;gt;succeed/0&amp;lt;/vp&amp;gt; will always succeed.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toAny|toAny/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; to the value of the universal term type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toBinary|toBinary/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified Term to the binary representation.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toBoolean|toBoolean/1-&amp;gt;]]&lt;br /&gt;
|The purpose of this meta-predicate is to convert the deterministic call (to a predicate or fact) to the procedure that returns the value of &amp;lt;vp&amp;gt;boolean&amp;lt;/vp&amp;gt; domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toEllipsis|toEllipsis/1-&amp;gt;]]&lt;br /&gt;
|Creates the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; from the list of &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; type values.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toString|toString/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; to the string representation.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toTerm|toTerm/1-&amp;gt;]] &amp;lt;br&amp;gt; [[#toTerm|toTerm/2-&amp;gt;]]&lt;br /&gt;
|Converts the string/binary representation of the specified term &amp;#039;&amp;#039;SrcTerm&amp;#039;&amp;#039; into representation corresponding to the domain of &amp;#039;&amp;#039;PrologTerm&amp;#039;&amp;#039; variable of the return value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#tryToTerm|tryToTerm/1-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt; &amp;lt;br&amp;gt; [[#tryToTerm|tryToTerm/2-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Converts the string/binary representation of the specified term &amp;#039;&amp;#039;SrcTerm&amp;#039;&amp;#039; into representation corresponding to the domain of &amp;#039;&amp;#039;PrologTerm&amp;#039;&amp;#039; variable of the return value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#tryConvert|tryConvert/2-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Checks whether the input term &amp;#039;&amp;#039;InputTerm&amp;#039;&amp;#039; can be strictly converted into the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; and returns the converted term &amp;#039;&amp;#039;ReturnTerm&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]]&lt;br /&gt;
|Unchecked conversion of domains.&lt;br /&gt;
|-&lt;br /&gt;
|[[#upperBound|upperBound/1-&amp;gt;]]&lt;br /&gt;
|Returns the upper bound value of the specified numeric domain.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following predicates are deprecated:&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
| finally/2&lt;br /&gt;
| Use [[Language_Reference/Terms#try-finally| &amp;lt;vp&amp;gt;try-finally&amp;lt;/vp&amp;gt;]] constuction instead.&lt;br /&gt;
|-&lt;br /&gt;
| findall/3&lt;br /&gt;
| Use list comprehension [[Language_Reference/Terms#List_Comprehension| &amp;lt;vp&amp;gt;[ ... || ...  ]&amp;lt;/vp&amp;gt;]] instead&lt;br /&gt;
|-&lt;br /&gt;
| trap/3 &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
| Use [[Language_Reference/Terms#try-catch| &amp;lt;vp&amp;gt;try-catch&amp;lt;/vp&amp;gt;]] constuction instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== and ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#and_.28.2C.29|and (,)]].&lt;br /&gt;
&lt;br /&gt;
==== assert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;assert : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert the specified fact at the end of the matched internal facts database&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;assert(Fact)&amp;lt;/vp&amp;gt; inserts &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; in the matched internal facts database after any other stored facts for the corresponding database predicate. &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; must be a term belonging to the domain of an internal facts database. &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; applied to a single fact changes the existing instance of a fact to the specified one. &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; has the same effect as [[#assertz|assertz/1]]. See also [[#asserta|asserta/1]].&lt;br /&gt;
&lt;br /&gt;
Notice that the combination of [[#retract|retract/1]] and &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; like the following can lead to endless loop:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;loop() :-&lt;br /&gt;
  retract(fct(X)),&lt;br /&gt;
     ...           % creating Y from X&lt;br /&gt;
     assert(fct(Y)),&lt;br /&gt;
  fail.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem is that the retract in first line will eventually retract the fact asserted in the last line, because that fact is inserted &amp;#039;&amp;#039;last&amp;#039;&amp;#039; in the fact chain.&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Attempt to assert a second instance to a fact declared as determ.&lt;br /&gt;
&lt;br /&gt;
==== asserta ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;asserta : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert a fact at the beginning of the matched internal facts database.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;asserta(Fact)&amp;lt;/vp&amp;gt; predicate inserts a &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; in the matched internal facts database before any other stored facts for the corresponding predicate. The &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; must be a term belonging to the domain of an internal facts database. The &amp;lt;vp&amp;gt;asserta/1&amp;lt;/vp&amp;gt; applied to a single fact changes the existing instance of a fact to the specified one. See also [[#assert|assert/1]] and [[#assertz|assertz/1]].&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Attempt to a fact declared as determ, but the fact instance already exists.&lt;br /&gt;
&lt;br /&gt;
==== assertz ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;assertz : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;assertz&amp;lt;/vp&amp;gt; does exactly the same as the [[#assert|assert/1]] predicate.&lt;br /&gt;
&lt;br /&gt;
==== bound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;bound : (&amp;lt;variable&amp;gt; Variable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test whether the specified variable is bound to a value.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;bound(Variable)&amp;lt;/vp&amp;gt; succeeds if &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is bound and fails if it is free. The &amp;lt;vp&amp;gt;bound&amp;lt;/vp&amp;gt; predicate is used to control flow patterns and to check the binding of reference variables. The &amp;lt;vp&amp;gt;bound&amp;lt;/vp&amp;gt; predicate treats the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; as bound if any of it&amp;#039;s part is instantiated.&lt;br /&gt;
&lt;br /&gt;
See also [[#free|free/1]].&lt;br /&gt;
&lt;br /&gt;
==== class_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class_Name : () -&amp;gt; string ClassName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compile time predicate returns the string &amp;lt;vp&amp;gt;ClassName&amp;lt;/vp&amp;gt; that represents the name of the current interface or class.&lt;br /&gt;
&lt;br /&gt;
==== compare ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;compare : (A Left, A Right) -&amp;gt; compareResult CompareResult.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comparison of two terms of the same domain, resturns the value of [[#compareResult|compareResult]] domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;CompareResult&amp;lt;/vp&amp;gt; = compare(&amp;quot;&amp;lt;vp&amp;gt;bar&amp;lt;/vp&amp;gt;&amp;quot;, &amp;quot;&amp;lt;vp&amp;gt;foo&amp;lt;/vp&amp;gt;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== convert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;convert : (&amp;lt;type&amp;gt; Type, Term) -&amp;gt; &amp;lt;type&amp;gt; Converted.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checked term conversion.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; = convert(returnDomain, &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;returnDomain&amp;lt;/vpbnf&amp;gt;: Specifies a domain to which function &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; converts &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be a name of built-in Visual Prolog domain, an interface domain, a name of such user defined domain that is synonym to one of built-in Visual Prolog domains, a numeric domain, binary and pointer domains. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the value that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; is an expression, then it will be evaluated before the conversion.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned parameter &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; type.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;convert&amp;lt;/vp&amp;gt; predicate performs a clean and genuine conversion of the given &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;, returning a new term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; of the specified new domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;. If &amp;lt;vp&amp;gt;convert&amp;lt;/vp&amp;gt; cannot perform the required conversion, it rises errors. The similar functionality is provided by the [[#tryConvert|tryConvert/2-&amp;gt;]] predicate, but &amp;lt;vp&amp;gt;tryConvert-&amp;gt;&amp;lt;/vp&amp;gt; fails and does not produce any runtime errors if it cannot perform the conversion.&lt;br /&gt;
&lt;br /&gt;
===== Allowed conversions =====&lt;br /&gt;
&lt;br /&gt;
* Between numerical domains.&lt;br /&gt;
* Between interface types.&lt;br /&gt;
* Between [[#string|string]] and [[#symbol|symbol]] domains.&lt;br /&gt;
* From [[#binary|binary]] to [[#pointer|pointer]].&lt;br /&gt;
* For synonyms of mentioned domains.&lt;br /&gt;
* Between [http://wiki.visual-prolog.com/index.php?title=How_To_Remove_Reference_Domains_from_a_Project reference] domains and corresponding non-reference domains.&lt;br /&gt;
&lt;br /&gt;
The contrast to these is [[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]] predicate, which performs an unchecked conversion between terms from any domains, which have the same bit-size.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; (or [[#tryConvert|tryConvert/2-&amp;gt;]]) predicate accomplishes a checked explicit conversion, when the source and target domains are statically known during the compilation. The result of an explicit conversion can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ok&amp;#039;&amp;#039;&amp;#039; the successful conversion to the target domain;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;run-time-check&amp;#039;&amp;#039;&amp;#039; the conversion to the target domain with generation of run-time checking for compatibility;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;error&amp;#039;&amp;#039;&amp;#039; the conversion is impossible, error output.&lt;br /&gt;
&lt;br /&gt;
===== Rules of Checked Explicit Conversions =====&lt;br /&gt;
&lt;br /&gt;
* Synonyms of domains are converted using the same rules that are applied to the domains themselves.&lt;br /&gt;
* Numerical domains can be converted to the numerical domains only.&lt;br /&gt;
* Integral constants are the representatives of the anonymous integral domain: &amp;lt;vp&amp;gt;[const .. const]&amp;lt;/vp&amp;gt;.&lt;br /&gt;
* Real constants are the representatives of the anonymous real domain: &amp;lt;vp&amp;gt;digits&amp;lt;/vp&amp;gt; &amp;lt;vp&amp;gt;dig [const .. const]&amp;lt;/vp&amp;gt;, where &amp;lt;vp&amp;gt;dig&amp;lt;/vp&amp;gt; is the number of the digits in mantissa without insignificant zeroes.&lt;br /&gt;
* A value of the symbol domain can be converted to the string domain and vice versa.&lt;br /&gt;
* A value of binary domain can be converted to the pointer domain.&lt;br /&gt;
* The domains that are implicitly introduced for interfaces can be converted only to the interface domains according to the rules specified below.&lt;br /&gt;
* All other domains cannot be converted.&lt;br /&gt;
&lt;br /&gt;
===== Conversions of Numerical Domains =====&lt;br /&gt;
&lt;br /&gt;
* The range is considered first during such conversion. If the ranges of source and target do not intersect, then an error is produced. If the ranges of source and target only partially intersect, then run-time checking is generated. Also, if one of domains is real and another is an integral one, then the integer range is converted to the real range before the comparison.&lt;br /&gt;
* When input term in real and output is integer, then &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; and [[#tryConvert|tryConvert/2-&amp;gt;]] predicates truncate the input value to the nearest integer value, which is nearer to zero.&lt;br /&gt;
&lt;br /&gt;
===== Conversions of Interface Types =====&lt;br /&gt;
&lt;br /&gt;
Predicate &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; allow to convert any object to any interface type. The actual correctness of such conversion is checked at runtime. When object is created, its type is internally stored, therefore when the object is passed as argument it still remember about its original type. This original type is used for checking allowed conversions. The example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface x&lt;br /&gt;
      supports a, b&lt;br /&gt;
end interface x&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If object is created by class, which implements &amp;lt;vp&amp;gt;x&amp;lt;/vp&amp;gt; interface, and then object is passed as parameter of type &amp;lt;vp&amp;gt;a&amp;lt;/vp&amp;gt; to some predicate, then it is allowed to convert the object to &amp;lt;vp&amp;gt;b&amp;lt;/vp&amp;gt; type.&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Check range error.&lt;br /&gt;
* Unsupported interface type.&lt;br /&gt;
&lt;br /&gt;
==== digitsOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;digitsOf : (&amp;lt;real-domain&amp;gt; Domain) -&amp;gt; unsigned.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns precision of the specified floating-point domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Precision = digitsof(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input parameter &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; of this compiling-time predicate is a floating-point domain, it should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable). The predicate returns the number &amp;lt;vpbnf&amp;gt;&amp;lt;Precision&amp;gt;&amp;lt;/vpbnf&amp;gt; that was determined by the &amp;lt;vp&amp;gt;digits&amp;lt;/vp&amp;gt; attribute in the domain declaration.&lt;br /&gt;
&lt;br /&gt;
The compiler guarantees that values of the domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; will have at least &amp;lt;vpbnf&amp;gt;&amp;lt;Precision&amp;gt;&amp;lt;/vpbnf&amp;gt; number of significant decimal digits.&lt;br /&gt;
&lt;br /&gt;
==== errorExit ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;errorExit : (unsigned ErrorNumber) erroneous.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs a run-time error with the specified return code &amp;lt;vp&amp;gt;ErrorNumber&amp;lt;/vp&amp;gt;, which can be used in the [[#try-catch-finally|try-catch-finally]].&lt;br /&gt;
&lt;br /&gt;
==== fail ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;fail : () failure.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; predicate forces failure and, hence, always causes backtracking. A clause that fails (with &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; or for some other reason) cannot bind output arguments.&lt;br /&gt;
&lt;br /&gt;
==== free ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;free : (&amp;lt;variableName&amp;gt; Variable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check whether a variable is free.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;free(Variable)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;free&amp;lt;/vp&amp;gt; predicate succeeds if the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is free and fails if &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is bound. The &amp;lt;vp&amp;gt;free&amp;lt;/vp&amp;gt; predicate treats the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; as bound if any of it&amp;#039;s part are instantiated.&lt;br /&gt;
&lt;br /&gt;
See also [[#bound|bound/1]].&lt;br /&gt;
&lt;br /&gt;
==== fromEllipsis ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;fromEllipsis : (...) -&amp;gt; any* AnyTermList.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate creates the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; from the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039; (i.e. from the special varying parameters block).&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;AnyTermList = fromEllipsis(EllipsisBlock )&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#toEllipsis|toEllipsis/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== hasDomain ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;hasDomain&amp;lt;/vp&amp;gt; is not really a predicate, but more a type declaration/restriction.  It has two forms a non-function for declaring/restricting the type of a variable and a function form for declaring/restricting the type of a value.&lt;br /&gt;
&lt;br /&gt;
The non-function form is called with a type as first parmeter and a variable as second parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;hasDomain : (&amp;lt;type&amp;gt; Type, Type Variable).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only effect of the call is that the &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; will be restricted to the type &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The variable can be free, bound or of some mixed flow and the binding of the variable will not change in any way.&lt;br /&gt;
&lt;br /&gt;
The function form is called with a type as first argument and a value as second argument, and it returns the same value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;hasDomain : (&amp;lt;type&amp;gt; Type, Type Value) -&amp;gt; Type Value.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only effect of the call is to ensure that the &amp;lt;vp&amp;gt;Value&amp;lt;/vp&amp;gt; will be restricted to the type &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== lowerBound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;lowerBound : (&amp;lt;numeric-domain&amp;gt; NumericDomain) -&amp;gt; &amp;lt;numeric-domain&amp;gt; LowerBound.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the lower bound of the specified &amp;lt;vp&amp;gt;NumericDomain&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;LowerBoundValue = lowerBound(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;lowerBound&amp;lt;/vp&amp;gt; is a compiling-time predicate. The &amp;lt;vp&amp;gt;lowerBound&amp;lt;/vp&amp;gt; returns the lower bound value &amp;lt;vp&amp;gt;LowerBoundValue&amp;lt;/vp&amp;gt; of the specified numeric domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The return value &amp;lt;vp&amp;gt;LowerBoundValue&amp;lt;/vp&amp;gt; belongs to the same domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter should be the name of any numerical domain; this domain name should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable). See also [[#upperBound|upperBound/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
It will give a compile time error if the specified domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; is not numeric domain.&lt;br /&gt;
&lt;br /&gt;
==== in ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#in|in/2]].&lt;br /&gt;
&lt;br /&gt;
==== isErroneous ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;isErroneous : (&amp;lt;fact-variable&amp;gt; FactVariable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate succeeds if the specified fact variable is &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;isErroneous(factVariableName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate succeeds if the specified fact variable &amp;lt;vp&amp;gt;factVariableName&amp;lt;/vp&amp;gt; has the &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt; value, otherwise it fails.&lt;br /&gt;
&lt;br /&gt;
==== maxDigits ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;maxDigits : (&amp;lt;real-domain&amp;gt; RealDomain) -&amp;gt; unsigned MaxDigits&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the value of digits (precision) of the basic domain corresponding to the specified floating-point domain &amp;lt;vp&amp;gt;RealDomain&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;MaxDigitsNumber = maxdigits(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The return maximal number of digits &amp;lt;vp&amp;gt;MaxDigitsNumber&amp;lt;/vp&amp;gt; for the &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter, which should be the name of a &amp;lt;vp&amp;gt;real&amp;lt;/vp&amp;gt; domain.&lt;br /&gt;
&lt;br /&gt;
==== not ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#not|not]].&lt;br /&gt;
&lt;br /&gt;
==== or ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#or_.28.3B.29|or (;)]].&lt;br /&gt;
&lt;br /&gt;
==== orelse ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#orelse|orelse]].&lt;br /&gt;
&lt;br /&gt;
==== predicate_fullname ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicate_fullname : () -&amp;gt; string PredicateFullName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;PredicateFullName&amp;lt;/vp&amp;gt; of the predicate in which it is invoked. The returned predicate name is qualified with a scope name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;predicate_fullname&amp;lt;/vp&amp;gt; can only be used inside a clause. Use of &amp;lt;vp&amp;gt;predicate_fullname&amp;lt;/vp&amp;gt; in other places causes a compile time error. See also [[#predicate_name|predicate_name]].&lt;br /&gt;
&lt;br /&gt;
==== predicate_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicate_name : () -&amp;gt; string PredicateName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;PredicateName&amp;lt;/vp&amp;gt; of the predicate in which it is invoked.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; can only be used inside a clause. Use of &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; in other places causes a compile time error. See also [[#predicate_fullname|predicate_fullname]]&lt;br /&gt;
&lt;br /&gt;
==== programPoint ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;programPoint : () -&amp;gt; core::programPoint ProgramPoint.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;programPoint&amp;lt;/vp&amp;gt; corresponding to the place where it is invoked.&lt;br /&gt;
&lt;br /&gt;
==== retract ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract : (&amp;lt;fact-term&amp;gt; FactTerm) nondeterm anyflow.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Successively removes the first matching fact from the facts database.  Fails when no more facts match.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract(FactTemplate)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; should be a fact term. The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate deletes the first fact that matches the &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; in the appropriated facts database. During backtracking, the rest of the matching facts will be deleted.&lt;br /&gt;
&lt;br /&gt;
Notice that &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can have any level of instantiation. The &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; is matched with the facts in the facts database, which means that any free variables will be bound in the call to &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can contain any anonymous variables. That is, variables with names consisting from the single underscore &amp;lt;vp&amp;gt;_&amp;lt;/vp&amp;gt; or a variable with a name starting with an underscore &amp;lt;vp&amp;gt;_AnyValue&amp;lt;/vp&amp;gt; if the variable occurs only once in the clause. For example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract(person(&amp;quot;Hans&amp;quot;, _Age)),&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will retract the first matched person fact that has &amp;quot;&amp;lt;vp&amp;gt;Hans&amp;lt;/vp&amp;gt;&amp;quot; as the first argument and anything as the second argument.&lt;br /&gt;
&lt;br /&gt;
When retracting a fact, which is declared to be determ, the call to &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; will be deterministic.&lt;br /&gt;
&lt;br /&gt;
See also [[#retractall|retractall/1]] and [[#retractFactDb|retractFactDb]].&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate cannot be applied to single facts or fact variables.&lt;br /&gt;
&lt;br /&gt;
Be careful calling &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; with free &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; variable if any single fact is declared in the project current scope. If you retract a single fact, then the run-time error is generated. The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate fails when there are no more matches.&lt;br /&gt;
&lt;br /&gt;
==== retractall ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractall : (&amp;lt;fact-term&amp;gt; FactTerm) .&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove all matching facts from the facts database.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractall(FactTemplate)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; should be a fact term.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt; retracts all facts which match the given &amp;#039;&amp;#039;FactTemplate&amp;#039;&amp;#039;. It always succeeds, even if no facts were retracted.&lt;br /&gt;
&lt;br /&gt;
Attempting to retract a &amp;lt;vp&amp;gt;single&amp;lt;/vp&amp;gt; fact will cause a compile time error.&lt;br /&gt;
&lt;br /&gt;
It is not possible to obtain any output values from &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt;. For this reason, the variables in the call must be bound or be a single underscores (anonymous). Notice that  &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can have any level of instantiation, but free variables must be single underscores (&amp;quot;unconditionally anonymous&amp;quot;). In difference to [[#retract|retract/1]] &amp;quot;conditionally&amp;quot; anonymous variables with names starting from the underscore (like &amp;lt;vp&amp;gt;_AnyValue&amp;lt;/vp&amp;gt;) cannot be used in &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
See also [[#retract|retract/1]] and [[#retractFactDb|retractFactDb/1]].&lt;br /&gt;
&lt;br /&gt;
==== retractFactDb ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractFactDb : (factDB FactDB).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove all facts from the named internal facts database &amp;lt;vp&amp;gt;FactDB&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractFactDb(FactDB)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retractFactDb/1&amp;lt;/vp&amp;gt; removes all facts from the named facts database &amp;lt;vp&amp;gt;FactDB&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Notice, it is impossible to retract &amp;lt;vp&amp;gt;single&amp;lt;/vp&amp;gt; facts and fact variables, so the predicate leaves such ones as they are.&lt;br /&gt;
&lt;br /&gt;
See also [[#retractall|retractall/1]] and [[#retract|retract/1]].&lt;br /&gt;
&lt;br /&gt;
==== retractAll/2 ====&lt;br /&gt;
&lt;br /&gt;
Obsolete predicate! Use [[#retractFactDb|retractFactDb/1]] instead.&lt;br /&gt;
&lt;br /&gt;
==== sizeBitsOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeBitsOf : (&amp;lt;domain&amp;gt; DomainName) -&amp;gt; unsigned BitSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bits occupied in memory by an entity of the specified domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;BitSize = sizeBitsOf(DomainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compiling-time predicate receives the domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt; as input parameter and return the size of memory that is occupied by the entity of the given domain. The result is measured in bits. For the integer domains &amp;lt;vp&amp;gt;sizeBitsOf/1-&amp;gt;&amp;lt;/vp&amp;gt; predicate returns the value that was defined for the size-field in a domain&amp;#039;s declaration.&lt;br /&gt;
&lt;br /&gt;
The following is always true for the integral domains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOfDomain(domain)*8 - 7 &amp;lt;= sizeBitsOf(domain) &amp;lt;= sizeOfDomain(domain)*8&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#sizeOfDomain|sizeOfDomain]]/1-&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== sizeOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOf : (Type Term) -&amp;gt; integer ByteSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bytes occupied in memory by the specified term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ByteSize = sizeOf(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;sizeOf/1-&amp;gt;&amp;lt;/vp&amp;gt; function receives a term as input parameter and returns value &amp;lt;vp&amp;gt;ByteSize&amp;lt;/vp&amp;gt; that specifies the number of bytes occupied in memory by this term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== sizeOfDomain ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOfDomain : (&amp;lt;domain&amp;gt; Domain) -&amp;gt; integer ByteSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bytes occupied in memory by the entity of the specified domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ByteSize = sizeOfDomain(DomainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compiling-time predicate receives the domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt; as input parameter and return the size of memory that is occupied by the entity of the given domain. The result is measured in bytes. The returned value &amp;lt;vp&amp;gt;ByteSize&amp;lt;/vp&amp;gt; belongs to the integer domain. Compare with [[#sizeBitsOf|sizeBitsOf/1-&amp;gt;]], which returns size of a domain measured in bits.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_lineno ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_lineno : () -&amp;gt; unsigned LineNumber.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current line number in the source file processed by the compiler.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_name : () -&amp;gt; string FileName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the name of the source file processed by the compiler.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_timestamp ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_timestamp : () -&amp;gt; string TimeStamp..&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a string that represents the date and time of the currently compiled source file in format &amp;lt;vp&amp;gt;YYYY-MM-DD&amp;lt;/vp&amp;gt; &amp;lt;vp&amp;gt;HH:MM:SS&amp;lt;/vp&amp;gt;. Where:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vp&amp;gt;YYYY&amp;lt;/vp&amp;gt; - Year.&lt;br /&gt;
* &amp;lt;vp&amp;gt;MM&amp;lt;/vp&amp;gt; - Month.&lt;br /&gt;
* &amp;lt;vp&amp;gt;DD&amp;lt;/vp&amp;gt; - Day.&lt;br /&gt;
* &amp;lt;vp&amp;gt;HH&amp;lt;/vp&amp;gt; - Hour.&lt;br /&gt;
* &amp;lt;vp&amp;gt;MM&amp;lt;/vp&amp;gt; - Minute.&lt;br /&gt;
* &amp;lt;vp&amp;gt;SS&amp;lt;/vp&amp;gt; - Second.&lt;br /&gt;
&lt;br /&gt;
==== succeed ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;succeed : ().&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate &amp;lt;vp&amp;gt;succeed/0&amp;lt;/vp&amp;gt; will always succeed.&lt;br /&gt;
&lt;br /&gt;
==== toAny ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toAny : (Term) -&amp;gt; any UniversalTypeValue.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to the value of universal term type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;UniversalTypeValue = toAny(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A term of the &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; domain can be converted back to its original type using the &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicates (see {{lang2|Built-in entities/Predicates|toTerm|toTerm}}).&lt;br /&gt;
&lt;br /&gt;
==== toBinary ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toBinary : (Term) -&amp;gt; binary Serialized.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to [[#binary|binary]] representation.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Serialized = toBinary(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a binary, it can safely be stored in a file or sent over a network to another program. Later the obtained binary value &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; can be converted back to a Visual Prolog term, using [[#toTerm|toTerm/1-&amp;gt;]] function (the domain for the reversed term should be adequate to &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) for the reverse conversion.&lt;br /&gt;
&lt;br /&gt;
==== toBoolean ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toBoolean : (&amp;lt;term&amp;gt; SubGoal) -&amp;gt; boolean Succeed.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of this meta-predicate is to convert the deterministic call (to a predicate or fact) to the procedure that returns the value of [[#boolean|boolean]] domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this meta-predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;True_or_False = toBoolean(deterministic_call)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;toBoolean/1-&amp;gt;&amp;lt;/vp&amp;gt; meta-predicate returns [[#boolean|boolean]] value. The result is &amp;lt;vp&amp;gt;true&amp;lt;/vp&amp;gt; if &amp;#039;&amp;#039;deterministic_call&amp;#039;&amp;#039; succeeds. The result is &amp;lt;vp&amp;gt;false&amp;lt;/vp&amp;gt; if &amp;#039;&amp;#039;deterministic_call&amp;#039;&amp;#039; fails.&lt;br /&gt;
&lt;br /&gt;
==== toEllipsis ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toEllipsis : (any* AnyTermList) -&amp;gt; ....&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate creates &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039; (i.e. the special varying parameters block) from the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;. Such &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; can be later passed to a predicate which expects the varying number of arguments (i.e. is declared with the ellipsis (&amp;#039;&amp;#039;...&amp;#039;&amp;#039;)), like &amp;lt;vp&amp;gt;write/...&amp;lt;/vp&amp;gt;, at the position of the ellipsis (&amp;#039;&amp;#039;...&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;EllipsisBlock = toEllipsis(&amp;lt;any_term_list&amp;gt;), write(EllipsisBlock)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#fromEllipsis|fromEllipsis/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== toString ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toString : (Term) -&amp;gt; string Serialized.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to string representation.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Serialized = toString(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a string, it can safely be stored in a file or sent over a network to another program. Later the obtained string value can be converted back to a Visual Prolog term, using [[#toTerm|toTerm/1-&amp;gt;]] function (the domain of the return value should be adequate to &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) for the reverse conversion.&lt;br /&gt;
&lt;br /&gt;
==== toTerm ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toTerm : (string Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (binary Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (any Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, string Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, binary Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, any Serialized) -&amp;gt; Term.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the string/binary/any representation of the specified term &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; into representation corresponding to the domain of &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; variable of the return value. The domain can be stated explicitly or it can be left to the compiler to determine a suitable domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Term = toTerm(Serialized) % with implicit domain&lt;br /&gt;
Term = toTerm(domainName, Serialized) % with explicit domain, domainName&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the domain is not specified the compiler must be able to determine the domain for the returned value &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; at compile-time. Notice that binary version of &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicate performs almost byte to byte conversion and only checking general compatibility of &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; data with the domain required to the return value &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;. The programmer is wholly responsible for providing binary data of &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; that can be correctly converted to the term of the desired domain. The &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicates are counterparts to predicates [[#toBinary|toBinary/1-&amp;gt;]] and [[#toString|toString/1-&amp;gt;]]. When a &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a binary or string representation &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; (by [[#toBinary|toBinary/1-&amp;gt;]] or [[#toString|toString/1-&amp;gt;]] or [[#toAny|toAny/1-&amp;gt;]] correspondingly), it can safely be stored in a file or sent over a network to another program. Later the corresponding &amp;lt;vp&amp;gt;toTerm/1&amp;lt;/vp&amp;gt;-&amp;gt; function can convert the obtained string/binary value &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; back to a Visual Prolog term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;. For correctness of the reverse conversion the domain of the clause variable &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; should be adequate to the initial domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
See also [[#tryToTerm|tryToTerm]].&lt;br /&gt;
&lt;br /&gt;
It gives a compile time error if the compiler cannot determine the return domain.&lt;br /&gt;
&lt;br /&gt;
Exceptions&lt;br /&gt;
&lt;br /&gt;
* Run time errors are generated when the &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicate cannot convert the string or binary into a term of the specified domain.&lt;br /&gt;
&lt;br /&gt;
==== tryToTerm ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;tryToTerm : (string Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (binary Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (any Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, string Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, binary Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, any Serialized) -&amp;gt; Term.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Converts the string/binary/any representation &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; into a term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;  like [[#toTerm|toTerm]]. The only difference between the predicates is that &amp;lt;vp&amp;gt;tryToTerm&amp;lt;/vp&amp;gt; fails if it cannot convert the string or binary or any into a term of the specified domain whereas toTerm raises an exception.&lt;br /&gt;
&lt;br /&gt;
See also [[#toTerm|toTerm]].&lt;br /&gt;
&lt;br /&gt;
==== tryConvert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;tryConvert : (&amp;lt;type&amp;gt; Type, Value) -&amp;gt; &amp;lt;type&amp;gt; Converted determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the input term &amp;lt;vp&amp;gt;Value&amp;lt;/vp&amp;gt; can be strictly converted into the specified domain &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt; and returns the converted term &amp;lt;vp&amp;gt;Converted&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ReturnTerm = tryConvert(returnDomain, InputTerm)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vp&amp;gt;returnDomain&amp;lt;/vp&amp;gt;: Specifies a domain to which &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate tries to convert the specified &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; can be any domain accessible in the current scope. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the term that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; is an expression, then it will be evaluated before conversion.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; domain.&lt;br /&gt;
&lt;br /&gt;
The conversion rules are the same as of the embedded predicate [[#convert|convert/2-&amp;gt;]], but &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; fails when [[#convert|convert/2-&amp;gt;]] generates conversion errors.&lt;br /&gt;
&lt;br /&gt;
This predicate succeeds if the corresponding conversion succeeds. Otherwise it fails. The &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate tries to perform a clean and genuine conversion of the given &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; into a value of the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;. The &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate will fail if the required conversion cannot be performed. When &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate succeeds, it returns the term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; converted to the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
For allowed conversions and rules of checked explicit conversions see [[#convert|convert/2-&amp;gt;]] predicate.&lt;br /&gt;
&lt;br /&gt;
See also [[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== uncheckedConvert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;uncheckedConvert : (&amp;lt;type&amp;gt; Type, Value) -&amp;gt; &amp;lt;type&amp;gt; Converted.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unchecked conversion of a value to another type.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ReturnTerm = uncheckedConvert(returnDomain, InputTerm)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vp&amp;gt;returnDomain&amp;lt;/vp&amp;gt;: Specifies a domain to which &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; predicate unsafely converts the specified &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; can be any domain accessible in the current scope, the &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; should has the same bit-size as the &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the value that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;#039;&amp;#039;InputTerm&amp;#039;&amp;#039; is an expression, then it will be evaluated before conversion.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned parameter &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; type.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; evaluates &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;, change the type to &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; without any modification of the memory pattern and unifies with &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt;. The &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; predicate performs no runtime checks. It makes only compile time checking of bit-size equality of the converted domains. So almost any term may be quite recklessly converted to any other term. So quite disastrous results may occur if you try to use variables incorrectly converted by &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;. Be extremely careful implementing &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;; we strongly recommend you always, when it is possible, using of [[#convert|convert/2-&amp;gt;]] and [[#tryConvert|tryConvert/2-&amp;gt;]]. But notice that, when an object is returned by COM system it is necessary to convert it by &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;, as Prolog program does not have information about its actual type.&lt;br /&gt;
&lt;br /&gt;
==== upperBound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;upperBound : (&amp;lt;numeric-domain&amp;gt; NumericDomain) -&amp;gt; &amp;lt;number-domain&amp;gt; UpperBound.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the upper bound value of the specified numeric domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;UpperBound = upperBound(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;upperBound&amp;lt;/vp&amp;gt; is a compiling-time predicate. The &amp;lt;vp&amp;gt;upperBound&amp;lt;/vp&amp;gt; returns the upper bound value of the specified numeric domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The return value &amp;lt;vp&amp;gt;UpperBound&amp;lt;/vp&amp;gt; belongs to the same domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter should be the name of any numerical domain; this domain name should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable).&lt;br /&gt;
&lt;br /&gt;
See also [[#lowerBound|lowerBound/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
Will cause a compile time error if the specified domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; is not numeric domain.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{LanguageReferenceSubarticle|Built-in entities/Predicates}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Logging&amp;diff=4193</id>
		<title>Logging</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Logging&amp;diff=4193"/>
		<updated>2015-11-19T13:44:20Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Logging in Prolog currently supports logging to console, file, event log, database table, PDC notification log (to be done). Logging is thread safe and even supported for several processes that are writing to the same log. Application can also simultaneously log to several logs including logging to several files and/or database tables. Logging performance does not depend on log type. It is very fast operation and done asynchronously meaning that logging message placed into the message queue, which is processed in background thread. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Log configuration=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Log configuration file (has .XML format) defines where applications logs the information. &lt;br /&gt;
Here is the log configuration file example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=xml&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;LogConfigurations&amp;gt;&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ConfigName0&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName0&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
				&amp;lt;Type&amp;gt;console&amp;lt;/Type&amp;gt;&lt;br /&gt;
				&amp;lt;PatternLayout&amp;gt;%username: %thread - %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&amp;lt;/Appender&amp;gt;		&lt;br /&gt;
&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ConfigName1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;event&amp;lt;/Type&amp;gt; &lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Target&amp;gt;Helpdeskdashboard&amp;lt;/Target&amp;gt; &lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;\[%lineno\] %userid %proc:%thread %datetime %msg&lt;br /&gt;
                     &amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName2&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;file&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Target&amp;gt;log.txt&amp;lt;/Target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;\[%lineno\] %userid(%username) \[%callerClassName/%callerPredicateName/%callerCursor\]%newline %proc:%thread time=%time dt=%datetime %msg(%msglevel)&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;dbtable&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;%userid %proc:%thread %datetime %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName4&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;console&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;%userid %proc:%thread %datetime %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ODBCTable&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName4&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;odbcAsync&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Target&amp;gt;wwLogging&amp;lt;/Target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;ConnectionString&amp;gt;Driver=\{SQL Server\};Server=WEB1.dmz.hc\SQLEXPRESS;Database=Helpdesk_test;UID=xxx;PWD=yyy;app=HelpdeskDashboard&amp;lt;/ConnectionString&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;ColumnInfo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;level&amp;quot; attribute=&amp;quot;msglevel&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;linenumber&amp;quot; attribute =&amp;quot;lineno&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;username&amp;quot; attribute =&amp;quot;username&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;userID&amp;quot; attribute =&amp;quot;userid&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;procid&amp;quot; attribute =&amp;quot;proc&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;thread&amp;quot; attribute =&amp;quot;thread&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;datetime&amp;quot; attribute =&amp;quot;datetime&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;time&amp;quot; attribute =&amp;quot;datetime&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerClassNameElem&amp;quot; attribute =&amp;quot;callerclassname&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerPredicateNameElem&amp;quot; attribute =&amp;quot;callerpredicatename&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerCursorElem&amp;quot; attribute =&amp;quot;callercursor&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;msg&amp;quot; attribute =&amp;quot;msg&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;/ColumnInfo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;DBTable&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;dbTableAsync&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;PDCNotification&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName6&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;service&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;PatternLayout&amp;gt;%thread - %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/LogConfigurations&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Log configuration file may contain one or more named configurations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;LogConfig name=&amp;quot;ConfigName0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each configuration contains one or more appenders. Appender defines the log target and has the following parameters: &amp;#039;&amp;#039;&amp;#039;LogLevel, Type, Target, PatternLayout, Filter, ConnectionString, ColumnInfo&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Loglevel&amp;gt;&amp;#039;&amp;#039;&amp;#039; can be one of the following: &lt;br /&gt;
* all&lt;br /&gt;
* debug	&lt;br /&gt;
* info&lt;br /&gt;
* warn&lt;br /&gt;
* error&lt;br /&gt;
* fatal&lt;br /&gt;
* off&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Type&amp;gt;&amp;#039;&amp;#039;&amp;#039; can be one of the following:&lt;br /&gt;
* console				logging to console&lt;br /&gt;
* event				logging to the event log&lt;br /&gt;
* file or fileAsync			logging to file synchronously or asynchronously&lt;br /&gt;
* dbTable or dbTableAsync	logging errors to the internal database synchronously or            asynchronously&lt;br /&gt;
* odbc or odbcAsync		logging to the database synchronously or asynchronously&lt;br /&gt;
* service				logging to the PDC Notification log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Target&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines where to log for every log &amp;lt;Type&amp;gt; and has the following values:&lt;br /&gt;
* &amp;lt;EventSource&amp;gt; if logging to the event log. Event source is usually application name&lt;br /&gt;
* &amp;lt;file name&amp;gt; if logging to a file (environment variable allowed, ex: %TEMP%\my.log).&lt;br /&gt;
* &amp;lt;table name&amp;gt; if logging to the ODBC db.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;Target&amp;gt; parameter may be omitted for everything else.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;PatternLayout&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter defines message-formatting rules. It can contain the following keys:&lt;br /&gt;
* %lineno		Line number of logged message (starts from zero)&lt;br /&gt;
* %userid		user ID (unknown if not logged in)&lt;br /&gt;
* %username	user name (unknown if not logged in)&lt;br /&gt;
* %proc		Process ID&lt;br /&gt;
* %thread	Thread ID&lt;br /&gt;
* %time		Time stamp&lt;br /&gt;
* %datetime	Date/time stamp&lt;br /&gt;
* %msg		Message itself&lt;br /&gt;
* %msglevel	Message level&lt;br /&gt;
* %newline	New line&lt;br /&gt;
* %callerClassName	Caller class name&lt;br /&gt;
* %callerPredicateName	Caller predicate name&lt;br /&gt;
* %callerCursor		Caller module name with line/position values&lt;br /&gt;
&lt;br /&gt;
For example: &amp;lt;PatternLayout&amp;gt;%userid(%username) \[%callerClassName/%callerPredicateName/%callerCursor\]%newline %proc:%thread time=%time dt=%datetime %msg(%msglevel)&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
Logged message (2 lines):&lt;br /&gt;
145(Test User) \[0x600260 &amp;quot;serviceLog&amp;quot;/anonymous$o0$1$setproc_name/2np$serviceLog/sourceCursor(&amp;quot;tools\\dashboard\\common\\Service.pro&amp;quot;, 14, 17)\]&lt;br /&gt;
&lt;br /&gt;
 18244:4660 time=16:35:51.935 dt=2015/08/06 - 16:35:51.935 Call: workspace_GetDefaultDirContent(\{\})(debug)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Filter&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines what messages will be filtered out (excluded) from the log. It can contain zero or more class names and/or zero or more method names separated by semicolon: &amp;#039;&amp;#039;&amp;#039;class:&amp;lt;class name&amp;gt;;method:&amp;lt;method name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
For example: &lt;br /&gt;
if filter is defined as following class:entityModel;method:getList all logging for class &amp;#039;&amp;#039;&amp;#039;entityModel&amp;#039;&amp;#039;&amp;#039; and method &amp;#039;&amp;#039;&amp;#039;getList&amp;#039;&amp;#039;&amp;#039; (no matter from which class) will be skipped.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;ConnectionString&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines connection string for ODBC logging.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;ColumnInfo&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines set of columns where to log some information. The &amp;#039;&amp;#039;&amp;#039;Name&amp;#039;&amp;#039;&amp;#039; attribute defines column name, the &amp;#039;&amp;#039;&amp;#039;Attribute&amp;#039;&amp;#039;&amp;#039; defines what to log. Attributes can have the same values described in &amp;#039;&amp;#039;&amp;#039;&amp;lt;PatternLayout&amp;gt;&amp;#039;&amp;#039;&amp;#039; section, except for skipped percentage sign (%) in the beginning.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Notes:===&lt;br /&gt;
* Log configuration file can have more than one appender that logs to a file or database table. Of course, in this case file names/database table names should be different. For example, critical errors can be logged to separate file and/or database table.&lt;br /&gt;
&lt;br /&gt;
=Activating pfc\log from command line=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To use log package it is enough to specify one of the command lines parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-LogConfig &amp;lt;Log Configuration File Name&amp;gt; &amp;lt;Configuration Name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
For example: -LogConfig LogConfig.xml ConfigName1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pfc\log programmatically=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Loading log configuration file&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;==&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Make the following calls:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;logConfig::loadConfig(ConfigFileName, ConfigName).&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where: &lt;br /&gt;
ConfigFileName: log configuration file;&lt;br /&gt;
ConfigName: configuration name define in log configuration;&lt;br /&gt;
&lt;br /&gt;
If it is necessary to pass connection string (for db/odbc appenders) it is enough to enumerate activated appenders by name and set the connection string (in this example connection string is set for pfc\log\dbTable appender):&lt;br /&gt;
&lt;br /&gt;
LogAppenders = log::getAcivatedAppenders(@&amp;quot;pfc\log\dbTableAppender&amp;quot;),&lt;br /&gt;
foreach LogAppender in LogAppenders do&lt;br /&gt;
    LogAppender:connectionString := db_connectionString&lt;br /&gt;
end foreach&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==&lt;br /&gt;
Logging messages==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===&lt;br /&gt;
Use &amp;#039;&amp;#039;&amp;#039;log::write(level Level, ...)&amp;#039;&amp;#039;&amp;#039; and/or &amp;#039;&amp;#039;&amp;#039;log::writef(level Level, string Format &amp;#039;&amp;#039;&amp;#039;\[&amp;#039;&amp;#039;&amp;#039;formatString&amp;#039;&amp;#039;&amp;#039;\]&amp;#039;&amp;#039;&amp;#039;, ...)&amp;#039;&amp;#039;&amp;#039; predicates to log messages.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
Log message &amp;quot;Start&amp;quot; with log level &amp;quot;all&amp;quot;:&lt;br /&gt;
log::write(log::all, &amp;quot;Start&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Log fatal error using formatted log:&lt;br /&gt;
log::writef(log::fatal, &amp;quot;SQL ERROR during startup: %&amp;quot;, NativeMessage).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Using log programmatically without log configuration file&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of using ODBC appender:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;===&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
        ODBC = odbcAppender::new(),	&amp;lt;-- constructor&lt;br /&gt;
        ODBC:loglevel := log::all, 		&amp;lt;-- log level&lt;br /&gt;
        ODBC:columninfo := \[tuple(&amp;quot;username&amp;quot;, &amp;quot;username&amp;quot;), tuple(&amp;quot;msg&amp;quot;, &amp;quot;msg&amp;quot;)\], &amp;lt;-- column info (write &amp;#039;username&amp;#039; to the &amp;#039;username&amp;#039; column, write &amp;#039;msg&amp;#039; to the &amp;#039;msg&amp;#039; column,&lt;br /&gt;
        ODBC:connectionString := @&amp;quot;Driver=\{SQL Server\};Server=WEB1.dmz.hc\SQLEXPRESS;Database=Helpdesk_test;UID=leo;PWD=PdcPdcPdc1;app=HelpdeskDashboard&amp;quot;,&lt;br /&gt;
        log::activateAppender(true, ODBC), &amp;lt;-- activate appender&lt;br /&gt;
        log::write(log::debug, &amp;quot;Example&amp;quot;),	&amp;lt;-- log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=List of ideas=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* For critical errors - when we want to call PDC notification log, then we do also need:&lt;br /&gt;
%siteURL                                               (URL of the service)&lt;br /&gt;
%applicationName&lt;br /&gt;
%projectName&lt;br /&gt;
%programVersion&lt;br /&gt;
%customerName&lt;br /&gt;
%machineName&lt;br /&gt;
&lt;br /&gt;
* Expressions: In log4j, there are a number of filtering facilities: [http://logging.apache.org/log4j/2.x/log4j-users-guide.pdf http://logging.apache.org/log4j/2.x/log4j-users-guide.pdf] &lt;br /&gt;
I guess we should implement an expression is logging should be done, something like&lt;br /&gt;
UserName in \[&amp;quot;Leo&amp;quot;,&amp;quot;Alexander&amp;quot;\] and Time&amp;gt;17:00 or Level&amp;gt;info or Message %= &amp;quot;dfhj&amp;quot;&lt;br /&gt;
 - Where the Upper case names refer to the Variable.&lt;br /&gt;
&lt;br /&gt;
* Reload log configuration from UI (App settings/utility/etc.) &amp;#039;&amp;#039;&amp;#039;\[DONE\]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* PDC Notification Log: &amp;#039;&amp;#039;&amp;#039;\[DONE\]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
- analyze;&lt;br /&gt;
&lt;br /&gt;
* Also I think there should be a state variable something like:&lt;br /&gt;
&lt;br /&gt;
Enablelogging_if User=&amp;quot;Leo&amp;quot; and Message contains &amp;quot;login&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Disablelogging_if User=&amp;quot;Leo&amp;quot; and Message contains &amp;quot;logout&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is not precise; I just thought it is needed with a mechanism to start and stop logging based on  logical condition...&lt;br /&gt;
&lt;br /&gt;
*&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Logging&amp;diff=4192</id>
		<title>Logging</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Logging&amp;diff=4192"/>
		<updated>2015-11-19T13:42:51Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: /* Log configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Logging in Prolog currently supports logging to console, file, event log, database table, PDC notification log (to be done). Logging is thread safe and even supported for several processes that are writing to the same log. Application can also simultaneously log to several logs including logging to several files and/or database tables. Logging performance does not depend on log type. It is very fast operation and done asynchronously meaning that logging message placed into the message queue, which is processed in background thread. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Log configuration=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Log configuration file (has .XML format) defines where applications logs the information. &lt;br /&gt;
Here is the log configuration file example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;LogConfigurations&amp;gt;&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ConfigName0&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName0&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
				&amp;lt;Type&amp;gt;console&amp;lt;/Type&amp;gt;&lt;br /&gt;
				&amp;lt;PatternLayout&amp;gt;%username: %thread - %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&amp;lt;/Appender&amp;gt;		&lt;br /&gt;
&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ConfigName1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;event&amp;lt;/Type&amp;gt; &lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Target&amp;gt;Helpdeskdashboard&amp;lt;/Target&amp;gt; &lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;\[%lineno\] %userid %proc:%thread %datetime %msg&lt;br /&gt;
                     &amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName2&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;file&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Target&amp;gt;log.txt&amp;lt;/Target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;\[%lineno\] %userid(%username) \[%callerClassName/%callerPredicateName/%callerCursor\]%newline %proc:%thread time=%time dt=%datetime %msg(%msglevel)&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;dbtable&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;%userid %proc:%thread %datetime %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName4&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;console&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;%userid %proc:%thread %datetime %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ODBCTable&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName4&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;odbcAsync&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Target&amp;gt;wwLogging&amp;lt;/Target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;ConnectionString&amp;gt;Driver=\{SQL Server\};Server=WEB1.dmz.hc\SQLEXPRESS;Database=Helpdesk_test;UID=xxx;PWD=yyy;app=HelpdeskDashboard&amp;lt;/ConnectionString&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;ColumnInfo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;level&amp;quot; attribute=&amp;quot;msglevel&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;linenumber&amp;quot; attribute =&amp;quot;lineno&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;username&amp;quot; attribute =&amp;quot;username&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;userID&amp;quot; attribute =&amp;quot;userid&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;procid&amp;quot; attribute =&amp;quot;proc&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;thread&amp;quot; attribute =&amp;quot;thread&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;datetime&amp;quot; attribute =&amp;quot;datetime&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;time&amp;quot; attribute =&amp;quot;datetime&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerClassNameElem&amp;quot; attribute =&amp;quot;callerclassname&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerPredicateNameElem&amp;quot; attribute =&amp;quot;callerpredicatename&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerCursorElem&amp;quot; attribute =&amp;quot;callercursor&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;msg&amp;quot; attribute =&amp;quot;msg&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;/ColumnInfo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;DBTable&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;dbTableAsync&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;PDCNotification&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName6&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;service&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;PatternLayout&amp;gt;%thread - %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/LogConfigurations&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Log configuration file may contain one or more named configurations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;LogConfig name=&amp;quot;ConfigName0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each configuration contains one or more appenders. Appender defines the log target and has the following parameters: &amp;#039;&amp;#039;&amp;#039;LogLevel, Type, Target, PatternLayout, Filter, ConnectionString, ColumnInfo&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Loglevel&amp;gt;&amp;#039;&amp;#039;&amp;#039; can be one of the following: &lt;br /&gt;
* all&lt;br /&gt;
* debug	&lt;br /&gt;
* info&lt;br /&gt;
* warn&lt;br /&gt;
* error&lt;br /&gt;
* fatal&lt;br /&gt;
* off&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Type&amp;gt;&amp;#039;&amp;#039;&amp;#039; can be one of the following:&lt;br /&gt;
* console				logging to console&lt;br /&gt;
* event				logging to the event log&lt;br /&gt;
* file or fileAsync			logging to file synchronously or asynchronously&lt;br /&gt;
* dbTable or dbTableAsync	logging errors to the internal database synchronously or            asynchronously&lt;br /&gt;
* odbc or odbcAsync		logging to the database synchronously or asynchronously&lt;br /&gt;
* service				logging to the PDC Notification log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Target&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines where to log for every log &amp;lt;Type&amp;gt; and has the following values:&lt;br /&gt;
* &amp;lt;EventSource&amp;gt; if logging to the event log. Event source is usually application name&lt;br /&gt;
* &amp;lt;file name&amp;gt; if logging to a file (environment variable allowed, ex: %TEMP%\my.log).&lt;br /&gt;
* &amp;lt;table name&amp;gt; if logging to the ODBC db.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;Target&amp;gt; parameter may be omitted for everything else.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;PatternLayout&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter defines message-formatting rules. It can contain the following keys:&lt;br /&gt;
* %lineno		Line number of logged message (starts from zero)&lt;br /&gt;
* %userid		user ID (unknown if not logged in)&lt;br /&gt;
* %username	user name (unknown if not logged in)&lt;br /&gt;
* %proc		Process ID&lt;br /&gt;
* %thread	Thread ID&lt;br /&gt;
* %time		Time stamp&lt;br /&gt;
* %datetime	Date/time stamp&lt;br /&gt;
* %msg		Message itself&lt;br /&gt;
* %msglevel	Message level&lt;br /&gt;
* %newline	New line&lt;br /&gt;
* %callerClassName	Caller class name&lt;br /&gt;
* %callerPredicateName	Caller predicate name&lt;br /&gt;
* %callerCursor		Caller module name with line/position values&lt;br /&gt;
&lt;br /&gt;
For example: &amp;lt;PatternLayout&amp;gt;%userid(%username) \[%callerClassName/%callerPredicateName/%callerCursor\]%newline %proc:%thread time=%time dt=%datetime %msg(%msglevel)&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
Logged message (2 lines):&lt;br /&gt;
145(Test User) \[0x600260 &amp;quot;serviceLog&amp;quot;/anonymous$o0$1$setproc_name/2np$serviceLog/sourceCursor(&amp;quot;tools\\dashboard\\common\\Service.pro&amp;quot;, 14, 17)\]&lt;br /&gt;
&lt;br /&gt;
 18244:4660 time=16:35:51.935 dt=2015/08/06 - 16:35:51.935 Call: workspace_GetDefaultDirContent(\{\})(debug)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Filter&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines what messages will be filtered out (excluded) from the log. It can contain zero or more class names and/or zero or more method names separated by semicolon: &amp;#039;&amp;#039;&amp;#039;class:&amp;lt;class name&amp;gt;;method:&amp;lt;method name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
For example: &lt;br /&gt;
if filter is defined as following class:entityModel;method:getList all logging for class &amp;#039;&amp;#039;&amp;#039;entityModel&amp;#039;&amp;#039;&amp;#039; and method &amp;#039;&amp;#039;&amp;#039;getList&amp;#039;&amp;#039;&amp;#039; (no matter from which class) will be skipped.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;ConnectionString&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines connection string for ODBC logging.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;ColumnInfo&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines set of columns where to log some information. The &amp;#039;&amp;#039;&amp;#039;Name&amp;#039;&amp;#039;&amp;#039; attribute defines column name, the &amp;#039;&amp;#039;&amp;#039;Attribute&amp;#039;&amp;#039;&amp;#039; defines what to log. Attributes can have the same values described in &amp;#039;&amp;#039;&amp;#039;&amp;lt;PatternLayout&amp;gt;&amp;#039;&amp;#039;&amp;#039; section, except for skipped percentage sign (%) in the beginning.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Notes:===&lt;br /&gt;
* Log configuration file can have more than one appender that logs to a file or database table. Of course, in this case file names/database table names should be different. For example, critical errors can be logged to separate file and/or database table.&lt;br /&gt;
&lt;br /&gt;
=Activating pfc\log from command line=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To use log package it is enough to specify one of the command lines parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-LogConfig &amp;lt;Log Configuration File Name&amp;gt; &amp;lt;Configuration Name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
For example: -LogConfig LogConfig.xml ConfigName1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pfc\log programmatically=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Loading log configuration file&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;==&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Make the following calls:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;logConfig::loadConfig(ConfigFileName, ConfigName).&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where: &lt;br /&gt;
ConfigFileName: log configuration file;&lt;br /&gt;
ConfigName: configuration name define in log configuration;&lt;br /&gt;
&lt;br /&gt;
If it is necessary to pass connection string (for db/odbc appenders) it is enough to enumerate activated appenders by name and set the connection string (in this example connection string is set for pfc\log\dbTable appender):&lt;br /&gt;
&lt;br /&gt;
LogAppenders = log::getAcivatedAppenders(@&amp;quot;pfc\log\dbTableAppender&amp;quot;),&lt;br /&gt;
foreach LogAppender in LogAppenders do&lt;br /&gt;
    LogAppender:connectionString := db_connectionString&lt;br /&gt;
end foreach&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==&lt;br /&gt;
Logging messages==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===&lt;br /&gt;
Use &amp;#039;&amp;#039;&amp;#039;log::write(level Level, ...)&amp;#039;&amp;#039;&amp;#039; and/or &amp;#039;&amp;#039;&amp;#039;log::writef(level Level, string Format &amp;#039;&amp;#039;&amp;#039;\[&amp;#039;&amp;#039;&amp;#039;formatString&amp;#039;&amp;#039;&amp;#039;\]&amp;#039;&amp;#039;&amp;#039;, ...)&amp;#039;&amp;#039;&amp;#039; predicates to log messages.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
Log message &amp;quot;Start&amp;quot; with log level &amp;quot;all&amp;quot;:&lt;br /&gt;
log::write(log::all, &amp;quot;Start&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Log fatal error using formatted log:&lt;br /&gt;
log::writef(log::fatal, &amp;quot;SQL ERROR during startup: %&amp;quot;, NativeMessage).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Using log programmatically without log configuration file&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of using ODBC appender:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;===&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
        ODBC = odbcAppender::new(),	&amp;lt;-- constructor&lt;br /&gt;
        ODBC:loglevel := log::all, 		&amp;lt;-- log level&lt;br /&gt;
        ODBC:columninfo := \[tuple(&amp;quot;username&amp;quot;, &amp;quot;username&amp;quot;), tuple(&amp;quot;msg&amp;quot;, &amp;quot;msg&amp;quot;)\], &amp;lt;-- column info (write &amp;#039;username&amp;#039; to the &amp;#039;username&amp;#039; column, write &amp;#039;msg&amp;#039; to the &amp;#039;msg&amp;#039; column,&lt;br /&gt;
        ODBC:connectionString := @&amp;quot;Driver=\{SQL Server\};Server=WEB1.dmz.hc\SQLEXPRESS;Database=Helpdesk_test;UID=leo;PWD=PdcPdcPdc1;app=HelpdeskDashboard&amp;quot;,&lt;br /&gt;
        log::activateAppender(true, ODBC), &amp;lt;-- activate appender&lt;br /&gt;
        log::write(log::debug, &amp;quot;Example&amp;quot;),	&amp;lt;-- log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=List of ideas=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* For critical errors - when we want to call PDC notification log, then we do also need:&lt;br /&gt;
%siteURL                                               (URL of the service)&lt;br /&gt;
%applicationName&lt;br /&gt;
%projectName&lt;br /&gt;
%programVersion&lt;br /&gt;
%customerName&lt;br /&gt;
%machineName&lt;br /&gt;
&lt;br /&gt;
* Expressions: In log4j, there are a number of filtering facilities: [http://logging.apache.org/log4j/2.x/log4j-users-guide.pdf http://logging.apache.org/log4j/2.x/log4j-users-guide.pdf] &lt;br /&gt;
I guess we should implement an expression is logging should be done, something like&lt;br /&gt;
UserName in \[&amp;quot;Leo&amp;quot;,&amp;quot;Alexander&amp;quot;\] and Time&amp;gt;17:00 or Level&amp;gt;info or Message %= &amp;quot;dfhj&amp;quot;&lt;br /&gt;
 - Where the Upper case names refer to the Variable.&lt;br /&gt;
&lt;br /&gt;
* Reload log configuration from UI (App settings/utility/etc.) &amp;#039;&amp;#039;&amp;#039;\[DONE\]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* PDC Notification Log: &amp;#039;&amp;#039;&amp;#039;\[DONE\]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
- analyze;&lt;br /&gt;
&lt;br /&gt;
* Also I think there should be a state variable something like:&lt;br /&gt;
&lt;br /&gt;
Enablelogging_if User=&amp;quot;Leo&amp;quot; and Message contains &amp;quot;login&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Disablelogging_if User=&amp;quot;Leo&amp;quot; and Message contains &amp;quot;logout&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is not precise; I just thought it is needed with a mechanism to start and stop logging based on  logical condition...&lt;br /&gt;
&lt;br /&gt;
* &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Logging&amp;diff=4191</id>
		<title>Logging</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Logging&amp;diff=4191"/>
		<updated>2015-11-19T13:36:39Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Logging in Prolog currently supports logging to console, file, event log, database table, PDC notification log (to be done). Logging is thread safe and even supported for several processes that are writing to the same log. Application can also simultaneously log to several logs including logging to several files and/or database tables. Logging performance does not depend on log type. It is very fast operation and done asynchronously meaning that logging message placed into the message queue, which is processed in background thread. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Log configuration=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Log configuration file (has .XML format) defines where applications logs the information. &lt;br /&gt;
Here is the log configuration file example:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;LogConfigurations&amp;gt;&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ConfigName0&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName0&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
				&amp;lt;Type&amp;gt;console&amp;lt;/Type&amp;gt;&lt;br /&gt;
				&amp;lt;PatternLayout&amp;gt;%username: %thread - %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&amp;lt;/Appender&amp;gt;		&lt;br /&gt;
&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ConfigName1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;event&amp;lt;/Type&amp;gt; &lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Target&amp;gt;Helpdeskdashboard&amp;lt;/Target&amp;gt; &lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;\[%lineno\] %userid %proc:%thread %datetime %msg&lt;br /&gt;
                     &amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName2&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;file&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Target&amp;gt;log.txt&amp;lt;/Target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;\[%lineno\] %userid(%username) \[%callerClassName/%callerPredicateName/%callerCursor\]%newline %proc:%thread time=%time dt=%datetime %msg(%msglevel)&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;dbtable&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;%userid %proc:%thread %datetime %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName4&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;console&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;%userid %proc:%thread %datetime %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ODBCTable&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName4&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;odbcAsync&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Target&amp;gt;wwLogging&amp;lt;/Target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;ConnectionString&amp;gt;Driver=\{SQL Server\};Server=WEB1.dmz.hc\SQLEXPRESS;Database=Helpdesk_test;UID=xxx;PWD=yyy;app=HelpdeskDashboard&amp;lt;/ConnectionString&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;ColumnInfo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;level&amp;quot; attribute=&amp;quot;msglevel&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;linenumber&amp;quot; attribute =&amp;quot;lineno&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;username&amp;quot; attribute =&amp;quot;username&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;userID&amp;quot; attribute =&amp;quot;userid&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;procid&amp;quot; attribute =&amp;quot;proc&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;thread&amp;quot; attribute =&amp;quot;thread&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;datetime&amp;quot; attribute =&amp;quot;datetime&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;time&amp;quot; attribute =&amp;quot;datetime&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerClassNameElem&amp;quot; attribute =&amp;quot;callerclassname&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerPredicateNameElem&amp;quot; attribute =&amp;quot;callerpredicatename&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerCursorElem&amp;quot; attribute =&amp;quot;callercursor&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;msg&amp;quot; attribute =&amp;quot;msg&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;/ColumnInfo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;DBTable&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;dbTableAsync&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;PDCNotification&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName6&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;service&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;PatternLayout&amp;gt;%thread - %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/LogConfigurations&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Log configuration file may contain one or more named configurations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;LogConfig name=&amp;quot;ConfigName0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each configuration contains one or more appenders. Appender defines the log target and has the following parameters: &amp;#039;&amp;#039;&amp;#039;LogLevel, Type, Target, PatternLayout, Filter, ConnectionString, ColumnInfo&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Loglevel&amp;gt;&amp;#039;&amp;#039;&amp;#039; can be one of the following: &lt;br /&gt;
* all&lt;br /&gt;
* debug	&lt;br /&gt;
* info&lt;br /&gt;
* warn&lt;br /&gt;
* error&lt;br /&gt;
* fatal&lt;br /&gt;
* off&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Type&amp;gt;&amp;#039;&amp;#039;&amp;#039; can be one of the following:&lt;br /&gt;
* console				logging to console&lt;br /&gt;
* event				logging to the event log&lt;br /&gt;
* file or fileAsync			logging to file synchronously or asynchronously&lt;br /&gt;
* dbTable or dbTableAsync	logging errors to the internal database synchronously or            asynchronously&lt;br /&gt;
* odbc or odbcAsync		logging to the database synchronously or asynchronously&lt;br /&gt;
* service				logging to the PDC Notification log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Target&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines where to log for every log &amp;lt;Type&amp;gt; and has the following values:&lt;br /&gt;
* &amp;lt;EventSource&amp;gt; if logging to the event log. Event source is usually application name&lt;br /&gt;
* &amp;lt;file name&amp;gt; if logging to a file (environment variable allowed, ex: %TEMP%\my.log).&lt;br /&gt;
* &amp;lt;table name&amp;gt; if logging to the ODBC db.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;Target&amp;gt; parameter may be omitted for everything else.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;PatternLayout&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter defines message-formatting rules. It can contain the following keys:&lt;br /&gt;
* %lineno		Line number of logged message (starts from zero)&lt;br /&gt;
* %userid		user ID (unknown if not logged in)&lt;br /&gt;
* %username	user name (unknown if not logged in)&lt;br /&gt;
* %proc		Process ID&lt;br /&gt;
* %thread	Thread ID&lt;br /&gt;
* %time		Time stamp&lt;br /&gt;
* %datetime	Date/time stamp&lt;br /&gt;
* %msg		Message itself&lt;br /&gt;
* %msglevel	Message level&lt;br /&gt;
* %newline	New line&lt;br /&gt;
* %callerClassName	Caller class name&lt;br /&gt;
* %callerPredicateName	Caller predicate name&lt;br /&gt;
* %callerCursor		Caller module name with line/position values&lt;br /&gt;
&lt;br /&gt;
For example: &amp;lt;PatternLayout&amp;gt;%userid(%username) \[%callerClassName/%callerPredicateName/%callerCursor\]%newline %proc:%thread time=%time dt=%datetime %msg(%msglevel)&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
Logged message (2 lines):&lt;br /&gt;
145(Test User) \[0x600260 &amp;quot;serviceLog&amp;quot;/anonymous$o0$1$setproc_name/2np$serviceLog/sourceCursor(&amp;quot;tools\\dashboard\\common\\Service.pro&amp;quot;, 14, 17)\]&lt;br /&gt;
&lt;br /&gt;
 18244:4660 time=16:35:51.935 dt=2015/08/06 - 16:35:51.935 Call: workspace_GetDefaultDirContent(\{\})(debug)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Filter&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines what messages will be filtered out (excluded) from the log. It can contain zero or more class names and/or zero or more method names separated by semicolon: &amp;#039;&amp;#039;&amp;#039;class:&amp;lt;class name&amp;gt;;method:&amp;lt;method name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
For example: &lt;br /&gt;
if filter is defined as following class:entityModel;method:getList all logging for class &amp;#039;&amp;#039;&amp;#039;entityModel&amp;#039;&amp;#039;&amp;#039; and method &amp;#039;&amp;#039;&amp;#039;getList&amp;#039;&amp;#039;&amp;#039; (no matter from which class) will be skipped.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;ConnectionString&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines connection string for ODBC logging.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;ColumnInfo&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines set of columns where to log some information. The &amp;#039;&amp;#039;&amp;#039;Name&amp;#039;&amp;#039;&amp;#039; attribute defines column name, the &amp;#039;&amp;#039;&amp;#039;Attribute&amp;#039;&amp;#039;&amp;#039; defines what to log. Attributes can have the same values described in &amp;#039;&amp;#039;&amp;#039;&amp;lt;PatternLayout&amp;gt;&amp;#039;&amp;#039;&amp;#039; section, except for skipped percentage sign (%) in the beginning.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Notes:===&lt;br /&gt;
* Log configuration file can have more than one appender that logs to a file or database table. Of course, in this case file names/database table names should be different. For example, critical errors can be logged to separate file and/or database table.&lt;br /&gt;
&lt;br /&gt;
=Activating pfc\log from command line=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To use log package it is enough to specify one of the command lines parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-LogConfig &amp;lt;Log Configuration File Name&amp;gt; &amp;lt;Configuration Name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
For example: -LogConfig LogConfig.xml ConfigName1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pfc\log programmatically=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Loading log configuration file&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;==&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Make the following calls:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;logConfig::loadConfig(ConfigFileName, ConfigName).&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where: &lt;br /&gt;
ConfigFileName: log configuration file;&lt;br /&gt;
ConfigName: configuration name define in log configuration;&lt;br /&gt;
&lt;br /&gt;
If it is necessary to pass connection string (for db/odbc appenders) it is enough to enumerate activated appenders by name and set the connection string (in this example connection string is set for pfc\log\dbTable appender):&lt;br /&gt;
&lt;br /&gt;
LogAppenders = log::getAcivatedAppenders(@&amp;quot;pfc\log\dbTableAppender&amp;quot;),&lt;br /&gt;
foreach LogAppender in LogAppenders do&lt;br /&gt;
    LogAppender:connectionString := db_connectionString&lt;br /&gt;
end foreach&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==&lt;br /&gt;
Logging messages==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===&lt;br /&gt;
Use &amp;#039;&amp;#039;&amp;#039;log::write(level Level, ...)&amp;#039;&amp;#039;&amp;#039; and/or &amp;#039;&amp;#039;&amp;#039;log::writef(level Level, string Format &amp;#039;&amp;#039;&amp;#039;\[&amp;#039;&amp;#039;&amp;#039;formatString&amp;#039;&amp;#039;&amp;#039;\]&amp;#039;&amp;#039;&amp;#039;, ...)&amp;#039;&amp;#039;&amp;#039; predicates to log messages.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
Log message &amp;quot;Start&amp;quot; with log level &amp;quot;all&amp;quot;:&lt;br /&gt;
log::write(log::all, &amp;quot;Start&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Log fatal error using formatted log:&lt;br /&gt;
log::writef(log::fatal, &amp;quot;SQL ERROR during startup: %&amp;quot;, NativeMessage).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Using log programmatically without log configuration file&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of using ODBC appender:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;===&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
        ODBC = odbcAppender::new(),	&amp;lt;-- constructor&lt;br /&gt;
        ODBC:loglevel := log::all, 		&amp;lt;-- log level&lt;br /&gt;
        ODBC:columninfo := \[tuple(&amp;quot;username&amp;quot;, &amp;quot;username&amp;quot;), tuple(&amp;quot;msg&amp;quot;, &amp;quot;msg&amp;quot;)\], &amp;lt;-- column info (write &amp;#039;username&amp;#039; to the &amp;#039;username&amp;#039; column, write &amp;#039;msg&amp;#039; to the &amp;#039;msg&amp;#039; column,&lt;br /&gt;
        ODBC:connectionString := @&amp;quot;Driver=\{SQL Server\};Server=WEB1.dmz.hc\SQLEXPRESS;Database=Helpdesk_test;UID=leo;PWD=PdcPdcPdc1;app=HelpdeskDashboard&amp;quot;,&lt;br /&gt;
        log::activateAppender(true, ODBC), &amp;lt;-- activate appender&lt;br /&gt;
        log::write(log::debug, &amp;quot;Example&amp;quot;),	&amp;lt;-- log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=List of ideas=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* For critical errors - when we want to call PDC notification log, then we do also need:&lt;br /&gt;
%siteURL                                               (URL of the service)&lt;br /&gt;
%applicationName&lt;br /&gt;
%projectName&lt;br /&gt;
%programVersion&lt;br /&gt;
%customerName&lt;br /&gt;
%machineName&lt;br /&gt;
&lt;br /&gt;
* Expressions: In log4j, there are a number of filtering facilities: [http://logging.apache.org/log4j/2.x/log4j-users-guide.pdf http://logging.apache.org/log4j/2.x/log4j-users-guide.pdf] &lt;br /&gt;
I guess we should implement an expression is logging should be done, something like&lt;br /&gt;
UserName in \[&amp;quot;Leo&amp;quot;,&amp;quot;Alexander&amp;quot;\] and Time&amp;gt;17:00 or Level&amp;gt;info or Message %= &amp;quot;dfhj&amp;quot;&lt;br /&gt;
 - Where the Upper case names refer to the Variable.&lt;br /&gt;
&lt;br /&gt;
* Reload log configuration from UI (App settings/utility/etc.) &amp;#039;&amp;#039;&amp;#039;\[DONE\]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* PDC Notification Log: &amp;#039;&amp;#039;&amp;#039;\[DONE\]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
- analyze;&lt;br /&gt;
&lt;br /&gt;
* Also I think there should be a state variable something like:&lt;br /&gt;
&lt;br /&gt;
Enablelogging_if User=&amp;quot;Leo&amp;quot; and Message contains &amp;quot;login&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Disablelogging_if User=&amp;quot;Leo&amp;quot; and Message contains &amp;quot;logout&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is not precise; I just thought it is needed with a mechanism to start and stop logging based on  logical condition...&lt;br /&gt;
&lt;br /&gt;
* &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Logging&amp;diff=4190</id>
		<title>Logging</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Logging&amp;diff=4190"/>
		<updated>2015-11-19T13:36:12Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: /* Log configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Logging in Prolog currently supports logging to console, file, event log, database table, PDC notification log (to be done). Logging is thread safe and even supported for several processes that are writing to the same log. Application can also simultaneously log to several logs including logging to several files and/or database tables. Logging performance does not depend on log type. It is very fast operation and done asynchronously meaning that logging message placed into the message queue, which is processed in background thread. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Log configuration=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Log configuration file (has .XML format) defines where applications logs the information. &lt;br /&gt;
Here is the log configuration file example:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;LogConfigurations&amp;gt;&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ConfigName0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;console&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;PatternLayout&amp;gt;%username: %thread - %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Appender&amp;gt;		&lt;br /&gt;
&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ConfigName1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;event&amp;lt;/Type&amp;gt; &lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Target&amp;gt;Helpdeskdashboard&amp;lt;/Target&amp;gt; &lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;\[%lineno\] %userid %proc:%thread %datetime %msg&lt;br /&gt;
                     &amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName2&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;file&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Target&amp;gt;log.txt&amp;lt;/Target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;\[%lineno\] %userid(%username) \[%callerClassName/%callerPredicateName/%callerCursor\]%newline %proc:%thread time=%time dt=%datetime %msg(%msglevel)&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;dbtable&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;%userid %proc:%thread %datetime %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName4&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;console&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;%userid %proc:%thread %datetime %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ODBCTable&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName4&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;odbcAsync&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Target&amp;gt;wwLogging&amp;lt;/Target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;ConnectionString&amp;gt;Driver=\{SQL Server\};Server=WEB1.dmz.hc\SQLEXPRESS;Database=Helpdesk_test;UID=xxx;PWD=yyy;app=HelpdeskDashboard&amp;lt;/ConnectionString&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;ColumnInfo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;level&amp;quot; attribute=&amp;quot;msglevel&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;linenumber&amp;quot; attribute =&amp;quot;lineno&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;username&amp;quot; attribute =&amp;quot;username&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;userID&amp;quot; attribute =&amp;quot;userid&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;procid&amp;quot; attribute =&amp;quot;proc&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;thread&amp;quot; attribute =&amp;quot;thread&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;datetime&amp;quot; attribute =&amp;quot;datetime&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;time&amp;quot; attribute =&amp;quot;datetime&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerClassNameElem&amp;quot; attribute =&amp;quot;callerclassname&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerPredicateNameElem&amp;quot; attribute =&amp;quot;callerpredicatename&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerCursorElem&amp;quot; attribute =&amp;quot;callercursor&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;msg&amp;quot; attribute =&amp;quot;msg&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;/ColumnInfo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;DBTable&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;dbTableAsync&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;PDCNotification&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName6&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;service&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;PatternLayout&amp;gt;%thread - %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/LogConfigurations&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Log configuration file may contain one or more named configurations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;LogConfig name=&amp;quot;ConfigName0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each configuration contains one or more appenders. Appender defines the log target and has the following parameters: &amp;#039;&amp;#039;&amp;#039;LogLevel, Type, Target, PatternLayout, Filter, ConnectionString, ColumnInfo&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Loglevel&amp;gt;&amp;#039;&amp;#039;&amp;#039; can be one of the following: &lt;br /&gt;
* all&lt;br /&gt;
* debug	&lt;br /&gt;
* info&lt;br /&gt;
* warn&lt;br /&gt;
* error&lt;br /&gt;
* fatal&lt;br /&gt;
* off&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Type&amp;gt;&amp;#039;&amp;#039;&amp;#039; can be one of the following:&lt;br /&gt;
* console				logging to console&lt;br /&gt;
* event				logging to the event log&lt;br /&gt;
* file or fileAsync			logging to file synchronously or asynchronously&lt;br /&gt;
* dbTable or dbTableAsync	logging errors to the internal database synchronously or            asynchronously&lt;br /&gt;
* odbc or odbcAsync		logging to the database synchronously or asynchronously&lt;br /&gt;
* service				logging to the PDC Notification log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Target&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines where to log for every log &amp;lt;Type&amp;gt; and has the following values:&lt;br /&gt;
* &amp;lt;EventSource&amp;gt; if logging to the event log. Event source is usually application name&lt;br /&gt;
* &amp;lt;file name&amp;gt; if logging to a file (environment variable allowed, ex: %TEMP%\my.log).&lt;br /&gt;
* &amp;lt;table name&amp;gt; if logging to the ODBC db.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;Target&amp;gt; parameter may be omitted for everything else.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;PatternLayout&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter defines message-formatting rules. It can contain the following keys:&lt;br /&gt;
* %lineno		Line number of logged message (starts from zero)&lt;br /&gt;
* %userid		user ID (unknown if not logged in)&lt;br /&gt;
* %username	user name (unknown if not logged in)&lt;br /&gt;
* %proc		Process ID&lt;br /&gt;
* %thread	Thread ID&lt;br /&gt;
* %time		Time stamp&lt;br /&gt;
* %datetime	Date/time stamp&lt;br /&gt;
* %msg		Message itself&lt;br /&gt;
* %msglevel	Message level&lt;br /&gt;
* %newline	New line&lt;br /&gt;
* %callerClassName	Caller class name&lt;br /&gt;
* %callerPredicateName	Caller predicate name&lt;br /&gt;
* %callerCursor		Caller module name with line/position values&lt;br /&gt;
&lt;br /&gt;
For example: &amp;lt;PatternLayout&amp;gt;%userid(%username) \[%callerClassName/%callerPredicateName/%callerCursor\]%newline %proc:%thread time=%time dt=%datetime %msg(%msglevel)&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
Logged message (2 lines):&lt;br /&gt;
145(Test User) \[0x600260 &amp;quot;serviceLog&amp;quot;/anonymous$o0$1$setproc_name/2np$serviceLog/sourceCursor(&amp;quot;tools\\dashboard\\common\\Service.pro&amp;quot;, 14, 17)\]&lt;br /&gt;
&lt;br /&gt;
 18244:4660 time=16:35:51.935 dt=2015/08/06 - 16:35:51.935 Call: workspace_GetDefaultDirContent(\{\})(debug)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Filter&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines what messages will be filtered out (excluded) from the log. It can contain zero or more class names and/or zero or more method names separated by semicolon: &amp;#039;&amp;#039;&amp;#039;class:&amp;lt;class name&amp;gt;;method:&amp;lt;method name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
For example: &lt;br /&gt;
if filter is defined as following class:entityModel;method:getList all logging for class &amp;#039;&amp;#039;&amp;#039;entityModel&amp;#039;&amp;#039;&amp;#039; and method &amp;#039;&amp;#039;&amp;#039;getList&amp;#039;&amp;#039;&amp;#039; (no matter from which class) will be skipped.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;ConnectionString&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines connection string for ODBC logging.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;ColumnInfo&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines set of columns where to log some information. The &amp;#039;&amp;#039;&amp;#039;Name&amp;#039;&amp;#039;&amp;#039; attribute defines column name, the &amp;#039;&amp;#039;&amp;#039;Attribute&amp;#039;&amp;#039;&amp;#039; defines what to log. Attributes can have the same values described in &amp;#039;&amp;#039;&amp;#039;&amp;lt;PatternLayout&amp;gt;&amp;#039;&amp;#039;&amp;#039; section, except for skipped percentage sign (%) in the beginning.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Notes:===&lt;br /&gt;
* Log configuration file can have more than one appender that logs to a file or database table. Of course, in this case file names/database table names should be different. For example, critical errors can be logged to separate file and/or database table.&lt;br /&gt;
&lt;br /&gt;
=Activating pfc\log from command line=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To use log package it is enough to specify one of the command lines parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-LogConfig &amp;lt;Log Configuration File Name&amp;gt; &amp;lt;Configuration Name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
For example: -LogConfig LogConfig.xml ConfigName1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pfc\log programmatically=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Loading log configuration file&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;==&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Make the following calls:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;logConfig::loadConfig(ConfigFileName, ConfigName).&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where: &lt;br /&gt;
ConfigFileName: log configuration file;&lt;br /&gt;
ConfigName: configuration name define in log configuration;&lt;br /&gt;
&lt;br /&gt;
If it is necessary to pass connection string (for db/odbc appenders) it is enough to enumerate activated appenders by name and set the connection string (in this example connection string is set for pfc\log\dbTable appender):&lt;br /&gt;
&lt;br /&gt;
LogAppenders = log::getAcivatedAppenders(@&amp;quot;pfc\log\dbTableAppender&amp;quot;),&lt;br /&gt;
foreach LogAppender in LogAppenders do&lt;br /&gt;
    LogAppender:connectionString := db_connectionString&lt;br /&gt;
end foreach&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==&lt;br /&gt;
Logging messages==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===&lt;br /&gt;
Use &amp;#039;&amp;#039;&amp;#039;log::write(level Level, ...)&amp;#039;&amp;#039;&amp;#039; and/or &amp;#039;&amp;#039;&amp;#039;log::writef(level Level, string Format &amp;#039;&amp;#039;&amp;#039;\[&amp;#039;&amp;#039;&amp;#039;formatString&amp;#039;&amp;#039;&amp;#039;\]&amp;#039;&amp;#039;&amp;#039;, ...)&amp;#039;&amp;#039;&amp;#039; predicates to log messages.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
Log message &amp;quot;Start&amp;quot; with log level &amp;quot;all&amp;quot;:&lt;br /&gt;
log::write(log::all, &amp;quot;Start&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Log fatal error using formatted log:&lt;br /&gt;
log::writef(log::fatal, &amp;quot;SQL ERROR during startup: %&amp;quot;, NativeMessage).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Using log programmatically without log configuration file&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of using ODBC appender:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;===&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
        ODBC = odbcAppender::new(),	&amp;lt;-- constructor&lt;br /&gt;
        ODBC:loglevel := log::all, 		&amp;lt;-- log level&lt;br /&gt;
        ODBC:columninfo := \[tuple(&amp;quot;username&amp;quot;, &amp;quot;username&amp;quot;), tuple(&amp;quot;msg&amp;quot;, &amp;quot;msg&amp;quot;)\], &amp;lt;-- column info (write &amp;#039;username&amp;#039; to the &amp;#039;username&amp;#039; column, write &amp;#039;msg&amp;#039; to the &amp;#039;msg&amp;#039; column,&lt;br /&gt;
        ODBC:connectionString := @&amp;quot;Driver=\{SQL Server\};Server=WEB1.dmz.hc\SQLEXPRESS;Database=Helpdesk_test;UID=leo;PWD=PdcPdcPdc1;app=HelpdeskDashboard&amp;quot;,&lt;br /&gt;
        log::activateAppender(true, ODBC), &amp;lt;-- activate appender&lt;br /&gt;
        log::write(log::debug, &amp;quot;Example&amp;quot;),	&amp;lt;-- log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=List of ideas=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* For critical errors - when we want to call PDC notification log, then we do also need:&lt;br /&gt;
%siteURL                                               (URL of the service)&lt;br /&gt;
%applicationName&lt;br /&gt;
%projectName&lt;br /&gt;
%programVersion&lt;br /&gt;
%customerName&lt;br /&gt;
%machineName&lt;br /&gt;
&lt;br /&gt;
* Expressions: In log4j, there are a number of filtering facilities: [http://logging.apache.org/log4j/2.x/log4j-users-guide.pdf http://logging.apache.org/log4j/2.x/log4j-users-guide.pdf] &lt;br /&gt;
I guess we should implement an expression is logging should be done, something like&lt;br /&gt;
UserName in \[&amp;quot;Leo&amp;quot;,&amp;quot;Alexander&amp;quot;\] and Time&amp;gt;17:00 or Level&amp;gt;info or Message %= &amp;quot;dfhj&amp;quot;&lt;br /&gt;
 - Where the Upper case names refer to the Variable.&lt;br /&gt;
&lt;br /&gt;
* Reload log configuration from UI (App settings/utility/etc.) &amp;#039;&amp;#039;&amp;#039;\[DONE\]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* PDC Notification Log: &amp;#039;&amp;#039;&amp;#039;\[DONE\]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
- analyze;&lt;br /&gt;
&lt;br /&gt;
* Also I think there should be a state variable something like:&lt;br /&gt;
&lt;br /&gt;
Enablelogging_if User=&amp;quot;Leo&amp;quot; and Message contains &amp;quot;login&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Disablelogging_if User=&amp;quot;Leo&amp;quot; and Message contains &amp;quot;logout&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is not precise; I just thought it is needed with a mechanism to start and stop logging based on  logical condition...&lt;br /&gt;
&lt;br /&gt;
* &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Logging&amp;diff=4189</id>
		<title>Logging</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Logging&amp;diff=4189"/>
		<updated>2015-11-19T13:35:19Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Logging in Prolog currently supports logging to console, file, event log, database table, PDC notification log (to be done). Logging is thread safe and even supported for several processes that are writing to the same log. Application can also simultaneously log to several logs including logging to several files and/or database tables. Logging performance does not depend on log type. It is very fast operation and done asynchronously meaning that logging message placed into the message queue, which is processed in background thread. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Log configuration=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Log configuration file (has .XML format) defines where applications logs the information. &lt;br /&gt;
Here is the log configuration file example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;LogConfigurations&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ConfigName0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;console&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;PatternLayout&amp;gt;%username: %thread - %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Appender&amp;gt;		&lt;br /&gt;
&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ConfigName1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;event&amp;lt;/Type&amp;gt; &lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Target&amp;gt;Helpdeskdashboard&amp;lt;/Target&amp;gt; &lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;\[%lineno\] %userid %proc:%thread %datetime %msg&lt;br /&gt;
                     &amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName2&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;file&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Target&amp;gt;log.txt&amp;lt;/Target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;\[%lineno\] %userid(%username) \[%callerClassName/%callerPredicateName/%callerCursor\]%newline %proc:%thread time=%time dt=%datetime %msg(%msglevel)&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;dbtable&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;%userid %proc:%thread %datetime %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName4&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;console&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;%userid %proc:%thread %datetime %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ODBCTable&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName4&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;odbcAsync&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Target&amp;gt;wwLogging&amp;lt;/Target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;ConnectionString&amp;gt;Driver=\{SQL Server\};Server=WEB1.dmz.hc\SQLEXPRESS;Database=Helpdesk_test;UID=xxx;PWD=yyy;app=HelpdeskDashboard&amp;lt;/ConnectionString&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;ColumnInfo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;level&amp;quot; attribute=&amp;quot;msglevel&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;linenumber&amp;quot; attribute =&amp;quot;lineno&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;username&amp;quot; attribute =&amp;quot;username&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;userID&amp;quot; attribute =&amp;quot;userid&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;procid&amp;quot; attribute =&amp;quot;proc&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;thread&amp;quot; attribute =&amp;quot;thread&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;datetime&amp;quot; attribute =&amp;quot;datetime&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;time&amp;quot; attribute =&amp;quot;datetime&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerClassNameElem&amp;quot; attribute =&amp;quot;callerclassname&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerPredicateNameElem&amp;quot; attribute =&amp;quot;callerpredicatename&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerCursorElem&amp;quot; attribute =&amp;quot;callercursor&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;msg&amp;quot; attribute =&amp;quot;msg&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;/ColumnInfo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;DBTable&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;dbTableAsync&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;PDCNotification&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName6&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;service&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;PatternLayout&amp;gt;%thread - %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/LogConfigurations&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Log configuration file may contain one or more named configurations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;LogConfig name=&amp;quot;ConfigName0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each configuration contains one or more appenders. Appender defines the log target and has the following parameters: &amp;#039;&amp;#039;&amp;#039;LogLevel, Type, Target, PatternLayout, Filter, ConnectionString, ColumnInfo&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Loglevel&amp;gt;&amp;#039;&amp;#039;&amp;#039; can be one of the following: &lt;br /&gt;
* all&lt;br /&gt;
* debug	&lt;br /&gt;
* info&lt;br /&gt;
* warn&lt;br /&gt;
* error&lt;br /&gt;
* fatal&lt;br /&gt;
* off&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Type&amp;gt;&amp;#039;&amp;#039;&amp;#039; can be one of the following:&lt;br /&gt;
* console				logging to console&lt;br /&gt;
* event				logging to the event log&lt;br /&gt;
* file or fileAsync			logging to file synchronously or asynchronously&lt;br /&gt;
* dbTable or dbTableAsync	logging errors to the internal database synchronously or            asynchronously&lt;br /&gt;
* odbc or odbcAsync		logging to the database synchronously or asynchronously&lt;br /&gt;
* service				logging to the PDC Notification log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Target&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines where to log for every log &amp;lt;Type&amp;gt; and has the following values:&lt;br /&gt;
* &amp;lt;EventSource&amp;gt; if logging to the event log. Event source is usually application name&lt;br /&gt;
* &amp;lt;file name&amp;gt; if logging to a file (environment variable allowed, ex: %TEMP%\my.log).&lt;br /&gt;
* &amp;lt;table name&amp;gt; if logging to the ODBC db.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;Target&amp;gt; parameter may be omitted for everything else.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;PatternLayout&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter defines message-formatting rules. It can contain the following keys:&lt;br /&gt;
* %lineno		Line number of logged message (starts from zero)&lt;br /&gt;
* %userid		user ID (unknown if not logged in)&lt;br /&gt;
* %username	user name (unknown if not logged in)&lt;br /&gt;
* %proc		Process ID&lt;br /&gt;
* %thread	Thread ID&lt;br /&gt;
* %time		Time stamp&lt;br /&gt;
* %datetime	Date/time stamp&lt;br /&gt;
* %msg		Message itself&lt;br /&gt;
* %msglevel	Message level&lt;br /&gt;
* %newline	New line&lt;br /&gt;
* %callerClassName	Caller class name&lt;br /&gt;
* %callerPredicateName	Caller predicate name&lt;br /&gt;
* %callerCursor		Caller module name with line/position values&lt;br /&gt;
&lt;br /&gt;
For example: &amp;lt;PatternLayout&amp;gt;%userid(%username) \[%callerClassName/%callerPredicateName/%callerCursor\]%newline %proc:%thread time=%time dt=%datetime %msg(%msglevel)&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
Logged message (2 lines):&lt;br /&gt;
145(Test User) \[0x600260 &amp;quot;serviceLog&amp;quot;/anonymous$o0$1$setproc_name/2np$serviceLog/sourceCursor(&amp;quot;tools\\dashboard\\common\\Service.pro&amp;quot;, 14, 17)\]&lt;br /&gt;
&lt;br /&gt;
 18244:4660 time=16:35:51.935 dt=2015/08/06 - 16:35:51.935 Call: workspace_GetDefaultDirContent(\{\})(debug)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Filter&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines what messages will be filtered out (excluded) from the log. It can contain zero or more class names and/or zero or more method names separated by semicolon: &amp;#039;&amp;#039;&amp;#039;class:&amp;lt;class name&amp;gt;;method:&amp;lt;method name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
For example: &lt;br /&gt;
if filter is defined as following class:entityModel;method:getList all logging for class &amp;#039;&amp;#039;&amp;#039;entityModel&amp;#039;&amp;#039;&amp;#039; and method &amp;#039;&amp;#039;&amp;#039;getList&amp;#039;&amp;#039;&amp;#039; (no matter from which class) will be skipped.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;ConnectionString&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines connection string for ODBC logging.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;ColumnInfo&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines set of columns where to log some information. The &amp;#039;&amp;#039;&amp;#039;Name&amp;#039;&amp;#039;&amp;#039; attribute defines column name, the &amp;#039;&amp;#039;&amp;#039;Attribute&amp;#039;&amp;#039;&amp;#039; defines what to log. Attributes can have the same values described in &amp;#039;&amp;#039;&amp;#039;&amp;lt;PatternLayout&amp;gt;&amp;#039;&amp;#039;&amp;#039; section, except for skipped percentage sign (%) in the beginning.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Notes:===&lt;br /&gt;
* Log configuration file can have more than one appender that logs to a file or database table. Of course, in this case file names/database table names should be different. For example, critical errors can be logged to separate file and/or database table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Activating pfc\log from command line=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To use log package it is enough to specify one of the command lines parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-LogConfig &amp;lt;Log Configuration File Name&amp;gt; &amp;lt;Configuration Name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
For example: -LogConfig LogConfig.xml ConfigName1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pfc\log programmatically=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Loading log configuration file&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;==&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Make the following calls:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;logConfig::loadConfig(ConfigFileName, ConfigName).&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where: &lt;br /&gt;
ConfigFileName: log configuration file;&lt;br /&gt;
ConfigName: configuration name define in log configuration;&lt;br /&gt;
&lt;br /&gt;
If it is necessary to pass connection string (for db/odbc appenders) it is enough to enumerate activated appenders by name and set the connection string (in this example connection string is set for pfc\log\dbTable appender):&lt;br /&gt;
&lt;br /&gt;
LogAppenders = log::getAcivatedAppenders(@&amp;quot;pfc\log\dbTableAppender&amp;quot;),&lt;br /&gt;
foreach LogAppender in LogAppenders do&lt;br /&gt;
    LogAppender:connectionString := db_connectionString&lt;br /&gt;
end foreach&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==&lt;br /&gt;
Logging messages==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===&lt;br /&gt;
Use &amp;#039;&amp;#039;&amp;#039;log::write(level Level, ...)&amp;#039;&amp;#039;&amp;#039; and/or &amp;#039;&amp;#039;&amp;#039;log::writef(level Level, string Format &amp;#039;&amp;#039;&amp;#039;\[&amp;#039;&amp;#039;&amp;#039;formatString&amp;#039;&amp;#039;&amp;#039;\]&amp;#039;&amp;#039;&amp;#039;, ...)&amp;#039;&amp;#039;&amp;#039; predicates to log messages.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
Log message &amp;quot;Start&amp;quot; with log level &amp;quot;all&amp;quot;:&lt;br /&gt;
log::write(log::all, &amp;quot;Start&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Log fatal error using formatted log:&lt;br /&gt;
log::writef(log::fatal, &amp;quot;SQL ERROR during startup: %&amp;quot;, NativeMessage).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Using log programmatically without log configuration file&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of using ODBC appender:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;===&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
        ODBC = odbcAppender::new(),	&amp;lt;-- constructor&lt;br /&gt;
        ODBC:loglevel := log::all, 		&amp;lt;-- log level&lt;br /&gt;
        ODBC:columninfo := \[tuple(&amp;quot;username&amp;quot;, &amp;quot;username&amp;quot;), tuple(&amp;quot;msg&amp;quot;, &amp;quot;msg&amp;quot;)\], &amp;lt;-- column info (write &amp;#039;username&amp;#039; to the &amp;#039;username&amp;#039; column, write &amp;#039;msg&amp;#039; to the &amp;#039;msg&amp;#039; column,&lt;br /&gt;
        ODBC:connectionString := @&amp;quot;Driver=\{SQL Server\};Server=WEB1.dmz.hc\SQLEXPRESS;Database=Helpdesk_test;UID=leo;PWD=PdcPdcPdc1;app=HelpdeskDashboard&amp;quot;,&lt;br /&gt;
        log::activateAppender(true, ODBC), &amp;lt;-- activate appender&lt;br /&gt;
        log::write(log::debug, &amp;quot;Example&amp;quot;),	&amp;lt;-- log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=List of ideas=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* For critical errors - when we want to call PDC notification log, then we do also need:&lt;br /&gt;
%siteURL                                               (URL of the service)&lt;br /&gt;
%applicationName&lt;br /&gt;
%projectName&lt;br /&gt;
%programVersion&lt;br /&gt;
%customerName&lt;br /&gt;
%machineName&lt;br /&gt;
&lt;br /&gt;
* Expressions: In log4j, there are a number of filtering facilities: [http://logging.apache.org/log4j/2.x/log4j-users-guide.pdf http://logging.apache.org/log4j/2.x/log4j-users-guide.pdf] &lt;br /&gt;
I guess we should implement an expression is logging should be done, something like&lt;br /&gt;
UserName in \[&amp;quot;Leo&amp;quot;,&amp;quot;Alexander&amp;quot;\] and Time&amp;gt;17:00 or Level&amp;gt;info or Message %= &amp;quot;dfhj&amp;quot;&lt;br /&gt;
 - Where the Upper case names refer to the Variable.&lt;br /&gt;
&lt;br /&gt;
* Reload log configuration from UI (App settings/utility/etc.) &amp;#039;&amp;#039;&amp;#039;\[DONE\]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* PDC Notification Log: &amp;#039;&amp;#039;&amp;#039;\[DONE\]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
- analyze;&lt;br /&gt;
&lt;br /&gt;
* Also I think there should be a state variable something like:&lt;br /&gt;
&lt;br /&gt;
Enablelogging_if User=&amp;quot;Leo&amp;quot; and Message contains &amp;quot;login&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Disablelogging_if User=&amp;quot;Leo&amp;quot; and Message contains &amp;quot;logout&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is not precise; I just thought it is needed with a mechanism to start and stop logging based on  logical condition...&lt;br /&gt;
&lt;br /&gt;
* &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Logging&amp;diff=4188</id>
		<title>Logging</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Logging&amp;diff=4188"/>
		<updated>2015-11-19T13:32:46Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Logging in Prolog currently supports logging to console, file, event log, database table, PDC notification log (to be done). Logging is thread safe and even supported for several processes that are writing to the same log. Application can also simultaneously log to several logs including logging to several files and/or database tables. Logging performance does not depend on log type. It is very fast operation and done asynchronously meaning that logging message placed into the message queue, which is processed in background thread. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Log configuration=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Log configuration file (has .XML format) defines where applications logs the information. &lt;br /&gt;
Here is the log configuration file example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;LogConfigurations&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ConfigName0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;console&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;PatternLayout&amp;gt;%username: %thread - %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Appender&amp;gt;		&lt;br /&gt;
&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ConfigName1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;event&amp;lt;/Type&amp;gt; &lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Target&amp;gt;Helpdeskdashboard&amp;lt;/Target&amp;gt; &lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;\[%lineno\] %userid %proc:%thread %datetime %msg&lt;br /&gt;
                     &amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName2&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;file&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Target&amp;gt;log.txt&amp;lt;/Target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;\[%lineno\] %userid(%username) \[%callerClassName/%callerPredicateName/%callerCursor\]%newline %proc:%thread time=%time dt=%datetime %msg(%msglevel)&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;dbtable&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;%userid %proc:%thread %datetime %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName4&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;console&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;%userid %proc:%thread %datetime %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ODBCTable&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName4&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;odbcAsync&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Target&amp;gt;wwLogging&amp;lt;/Target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;ConnectionString&amp;gt;Driver=\{SQL Server\};Server=WEB1.dmz.hc\SQLEXPRESS;Database=Helpdesk_test;UID=xxx;PWD=yyy;app=HelpdeskDashboard&amp;lt;/ConnectionString&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;ColumnInfo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;level&amp;quot; attribute=&amp;quot;msglevel&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;linenumber&amp;quot; attribute =&amp;quot;lineno&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;username&amp;quot; attribute =&amp;quot;username&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;userID&amp;quot; attribute =&amp;quot;userid&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;procid&amp;quot; attribute =&amp;quot;proc&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;thread&amp;quot; attribute =&amp;quot;thread&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;datetime&amp;quot; attribute =&amp;quot;datetime&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;time&amp;quot; attribute =&amp;quot;datetime&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerClassNameElem&amp;quot; attribute =&amp;quot;callerclassname&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerPredicateNameElem&amp;quot; attribute =&amp;quot;callerpredicatename&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerCursorElem&amp;quot; attribute =&amp;quot;callercursor&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;msg&amp;quot; attribute =&amp;quot;msg&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;/ColumnInfo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;DBTable&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;dbTableAsync&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;PDCNotification&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName6&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;service&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;PatternLayout&amp;gt;%thread - %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/LogConfigurations&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Log configuration file may contain one or more named configurations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;LogConfig name=&amp;quot;ConfigName0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each configuration contains one or more appenders. Appender defines the log target and has the following parameters: &amp;#039;&amp;#039;&amp;#039;LogLevel, Type, Target, PatternLayout, Filter, ConnectionString, ColumnInfo&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Loglevel&amp;gt;&amp;#039;&amp;#039;&amp;#039; can be one of the following: &lt;br /&gt;
* all&lt;br /&gt;
* debug	&lt;br /&gt;
* info&lt;br /&gt;
* warn&lt;br /&gt;
* error&lt;br /&gt;
* fatal&lt;br /&gt;
* off&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Type&amp;gt;&amp;#039;&amp;#039;&amp;#039; can be one of the following:&lt;br /&gt;
* console				logging to console&lt;br /&gt;
* event				logging to the event log&lt;br /&gt;
* file or fileAsync			logging to file synchronously or asynchronously&lt;br /&gt;
* dbTable or dbTableAsync	logging errors to the internal database synchronously or            asynchronously&lt;br /&gt;
* odbc or odbcAsync		logging to the database synchronously or asynchronously&lt;br /&gt;
* service				logging to the PDC Notification log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Target&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines where to log for every log &amp;lt;Type&amp;gt; and has the following values:&lt;br /&gt;
* &amp;lt;EventSource&amp;gt; if logging to the event log. Event source is usually application name&lt;br /&gt;
* &amp;lt;file name&amp;gt; if logging to a file (environment variable allowed, ex: %TEMP%\my.log).&lt;br /&gt;
* &amp;lt;table name&amp;gt; if logging to the ODBC db.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;Target&amp;gt; parameter may be omitted for everything else.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;PatternLayout&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter defines message-formatting rules. It can contain the following keys:&lt;br /&gt;
* %lineno		Line number of logged message (starts from zero)&lt;br /&gt;
* %userid		user ID (unknown if not logged in)&lt;br /&gt;
* %username	user name (unknown if not logged in)&lt;br /&gt;
* %proc		Process ID&lt;br /&gt;
* %thread	Thread ID&lt;br /&gt;
* %time		Time stamp&lt;br /&gt;
* %datetime	Date/time stamp&lt;br /&gt;
* %msg		Message itself&lt;br /&gt;
* %msglevel	Message level&lt;br /&gt;
* %newline	New line&lt;br /&gt;
* %callerClassName	Caller class name&lt;br /&gt;
* %callerPredicateName	Caller predicate name&lt;br /&gt;
* %callerCursor		Caller module name with line/position values&lt;br /&gt;
&lt;br /&gt;
For example: &amp;lt;PatternLayout&amp;gt;%userid(%username) \[%callerClassName/%callerPredicateName/%callerCursor\]%newline %proc:%thread time=%time dt=%datetime %msg(%msglevel)&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
Logged message (2 lines):&lt;br /&gt;
145(Test User) \[0x600260 &amp;quot;serviceLog&amp;quot;/anonymous$o0$1$setproc_name/2np$serviceLog/sourceCursor(&amp;quot;tools\\dashboard\\common\\Service.pro&amp;quot;, 14, 17)\]&lt;br /&gt;
&lt;br /&gt;
 18244:4660 time=16:35:51.935 dt=2015/08/06 - 16:35:51.935 Call: workspace_GetDefaultDirContent(\{\})(debug)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Filter&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines what messages will be filtered out (excluded) from the log. It can contain zero or more class names and/or zero or more method names separated by semicolon: &amp;#039;&amp;#039;&amp;#039;class:&amp;lt;class name&amp;gt;;method:&amp;lt;method name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
For example: &lt;br /&gt;
if filter is defined as following class:entityModel;method:getList all logging for class &amp;#039;&amp;#039;&amp;#039;entityModel&amp;#039;&amp;#039;&amp;#039; and method &amp;#039;&amp;#039;&amp;#039;getList&amp;#039;&amp;#039;&amp;#039; (no matter from which class) will be skipped.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;ConnectionString&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines connection string for ODBC logging.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;ColumnInfo&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines set of columns where to log some information. The &amp;#039;&amp;#039;&amp;#039;Name&amp;#039;&amp;#039;&amp;#039; attribute defines column name, the &amp;#039;&amp;#039;&amp;#039;Attribute&amp;#039;&amp;#039;&amp;#039; defines what to log. Attributes can have the same values described in &amp;#039;&amp;#039;&amp;#039;&amp;lt;PatternLayout&amp;gt;&amp;#039;&amp;#039;&amp;#039; section, except for skipped percentage sign (%) in the beginning.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Notes:===&lt;br /&gt;
* Log configuration file can have more than one appender that logs to a file or database table. Of course, in this case file names/database table names should be different. For example, critical errors can be logged to separate file and/or database table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Activating pfc\log from command line=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To use log package it is enough to specify one of the command lines parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-LogConfig &amp;lt;Log Configuration File Name&amp;gt; &amp;lt;Configuration Name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
For example: -LogConfig LogConfig.xml ConfigName1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=&lt;br /&gt;
Using pfc\log programmatically=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Loading log configuration file&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;==&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Make the following calls:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;logConfig::loadConfig(ConfigFileName, ConfigName).&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where: &lt;br /&gt;
ConfigFileName: log configuration file;&lt;br /&gt;
ConfigName: configuration name define in log configuration;&lt;br /&gt;
&lt;br /&gt;
If it is necessary to pass connection string (for db/odbc appenders) it is enough to enumerate activated appenders by name and set the connection string (in this example connection string is set for pfc\log\dbTable appender):&lt;br /&gt;
&lt;br /&gt;
LogAppenders = log::getAcivatedAppenders(@&amp;quot;pfc\log\dbTableAppender&amp;quot;),&lt;br /&gt;
foreach LogAppender in LogAppenders do&lt;br /&gt;
    LogAppender:connectionString := db_connectionString&lt;br /&gt;
end foreach&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==&lt;br /&gt;
Logging messages==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===&lt;br /&gt;
Use &amp;#039;&amp;#039;&amp;#039;log::write(level Level, ...)&amp;#039;&amp;#039;&amp;#039; and/or &amp;#039;&amp;#039;&amp;#039;log::writef(level Level, string Format &amp;#039;&amp;#039;&amp;#039;\[&amp;#039;&amp;#039;&amp;#039;formatString&amp;#039;&amp;#039;&amp;#039;\]&amp;#039;&amp;#039;&amp;#039;, ...)&amp;#039;&amp;#039;&amp;#039; predicates to log messages.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
Log message &amp;quot;Start&amp;quot; with log level &amp;quot;all&amp;quot;:&lt;br /&gt;
log::write(log::all, &amp;quot;Start&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Log fatal error using formatted log:&lt;br /&gt;
log::writef(log::fatal, &amp;quot;SQL ERROR during startup: %&amp;quot;, NativeMessage).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Using log programmatically without log configuration file&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of using ODBC appender:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;===&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
        ODBC = odbcAppender::new(),	&amp;lt;-- constructor&lt;br /&gt;
        ODBC:loglevel := log::all, 		&amp;lt;-- log level&lt;br /&gt;
        ODBC:columninfo := \[tuple(&amp;quot;username&amp;quot;, &amp;quot;username&amp;quot;), tuple(&amp;quot;msg&amp;quot;, &amp;quot;msg&amp;quot;)\], &amp;lt;-- column info (write &amp;#039;username&amp;#039; to the &amp;#039;username&amp;#039; column, write &amp;#039;msg&amp;#039; to the &amp;#039;msg&amp;#039; column,&lt;br /&gt;
        ODBC:connectionString := @&amp;quot;Driver=\{SQL Server\};Server=WEB1.dmz.hc\SQLEXPRESS;Database=Helpdesk_test;UID=leo;PWD=PdcPdcPdc1;app=HelpdeskDashboard&amp;quot;,&lt;br /&gt;
        log::activateAppender(true, ODBC), &amp;lt;-- activate appender&lt;br /&gt;
        log::write(log::debug, &amp;quot;Example&amp;quot;),	&amp;lt;-- log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=List of ideas=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* For critical errors - when we want to call PDC notification log, then we do also need:&lt;br /&gt;
%siteURL                                               (URL of the service)&lt;br /&gt;
%applicationName&lt;br /&gt;
%projectName&lt;br /&gt;
%programVersion&lt;br /&gt;
%customerName&lt;br /&gt;
%machineName&lt;br /&gt;
&lt;br /&gt;
* Expressions: In log4j, there are a number of filtering facilities: [http://logging.apache.org/log4j/2.x/log4j-users-guide.pdf http://logging.apache.org/log4j/2.x/log4j-users-guide.pdf] &lt;br /&gt;
I guess we should implement an expression is logging should be done, something like&lt;br /&gt;
UserName in \[&amp;quot;Leo&amp;quot;,&amp;quot;Alexander&amp;quot;\] and Time&amp;gt;17:00 or Level&amp;gt;info or Message %= &amp;quot;dfhj&amp;quot;&lt;br /&gt;
 - Where the Upper case names refer to the Variable.&lt;br /&gt;
&lt;br /&gt;
* Reload log configuration from UI (App settings/utility/etc.) &amp;#039;&amp;#039;&amp;#039;\[DONE\]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* PDC Notification Log: &amp;#039;&amp;#039;&amp;#039;\[DONE\]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
- analyze;&lt;br /&gt;
&lt;br /&gt;
* Also I think there should be a state variable something like:&lt;br /&gt;
&lt;br /&gt;
Enablelogging_if User=&amp;quot;Leo&amp;quot; and Message contains &amp;quot;login&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Disablelogging_if User=&amp;quot;Leo&amp;quot; and Message contains &amp;quot;logout&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is not precise; I just thought it is needed with a mechanism to start and stop logging based on  logical condition...&lt;br /&gt;
&lt;br /&gt;
* &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Logging&amp;diff=4187</id>
		<title>Logging</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Logging&amp;diff=4187"/>
		<updated>2015-11-19T13:26:05Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Logging ===&lt;br /&gt;
=== Logging for Prolog (pfc\log) package ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Overview=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Logging in Prolog currently supports logging to console, file, event log, database table, PDC notification log (to be done). Logging is thread safe and even supported for several processes that are writing to the same log. Application can also simultaneously log to several logs including logging to several files and/or database tables. Logging performance does not depend on log type. It is very fast operation and done asynchronously meaning that logging message placed into the message queue, which is processed in background thread. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Log configuration=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Log configuration file (has .XML format) defines where applications logs the information. &lt;br /&gt;
Here is the log configuration file example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;LogConfigurations&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ConfigName0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;console&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;PatternLayout&amp;gt;%username: %thread - %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Appender&amp;gt;		&lt;br /&gt;
&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ConfigName1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;event&amp;lt;/Type&amp;gt; &lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Target&amp;gt;Helpdeskdashboard&amp;lt;/Target&amp;gt; &lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;\[%lineno\] %userid %proc:%thread %datetime %msg&lt;br /&gt;
                     &amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName2&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;file&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Target&amp;gt;log.txt&amp;lt;/Target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;\[%lineno\] %userid(%username) \[%callerClassName/%callerPredicateName/%callerCursor\]%newline %proc:%thread time=%time dt=%datetime %msg(%msglevel)&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;dbtable&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;%userid %proc:%thread %datetime %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName4&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;console&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;%userid %proc:%thread %datetime %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ODBCTable&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName4&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;odbcAsync&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Target&amp;gt;wwLogging&amp;lt;/Target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;ConnectionString&amp;gt;Driver=\{SQL Server\};Server=WEB1.dmz.hc\SQLEXPRESS;Database=Helpdesk_test;UID=xxx;PWD=yyy;app=HelpdeskDashboard&amp;lt;/ConnectionString&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;ColumnInfo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;level&amp;quot; attribute=&amp;quot;msglevel&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;linenumber&amp;quot; attribute =&amp;quot;lineno&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;username&amp;quot; attribute =&amp;quot;username&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;userID&amp;quot; attribute =&amp;quot;userid&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;procid&amp;quot; attribute =&amp;quot;proc&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;thread&amp;quot; attribute =&amp;quot;thread&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;datetime&amp;quot; attribute =&amp;quot;datetime&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;time&amp;quot; attribute =&amp;quot;datetime&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerClassNameElem&amp;quot; attribute =&amp;quot;callerclassname&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerPredicateNameElem&amp;quot; attribute =&amp;quot;callerpredicatename&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerCursorElem&amp;quot; attribute =&amp;quot;callercursor&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;msg&amp;quot; attribute =&amp;quot;msg&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;/ColumnInfo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;DBTable&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;dbTableAsync&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;PDCNotification&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName6&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;service&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;PatternLayout&amp;gt;%thread - %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/LogConfigurations&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Log configuration file may contain one or more named configurations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;LogConfig name=&amp;quot;ConfigName0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each configuration contains one or more appenders. Appender defines the log target and has the following parameters: &amp;#039;&amp;#039;&amp;#039;LogLevel, Type, Target, PatternLayout, Filter, ConnectionString, ColumnInfo&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Loglevel&amp;gt;&amp;#039;&amp;#039;&amp;#039; can be one of the following: &lt;br /&gt;
* all&lt;br /&gt;
* debug	&lt;br /&gt;
* info&lt;br /&gt;
* warn&lt;br /&gt;
* error&lt;br /&gt;
* fatal&lt;br /&gt;
* off&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Type&amp;gt;&amp;#039;&amp;#039;&amp;#039; can be one of the following:&lt;br /&gt;
* console				logging to console&lt;br /&gt;
* event				logging to the event log&lt;br /&gt;
* file or fileAsync			logging to file synchronously or asynchronously&lt;br /&gt;
* dbTable or dbTableAsync	logging errors to the internal database synchronously or            asynchronously&lt;br /&gt;
* odbc or odbcAsync		logging to the database synchronously or asynchronously&lt;br /&gt;
* service				logging to the PDC Notification log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Target&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines where to log for every log &amp;lt;Type&amp;gt; and has the following values:&lt;br /&gt;
* &amp;lt;EventSource&amp;gt; if logging to the event log. Event source is usually application name&lt;br /&gt;
* &amp;lt;file name&amp;gt; if logging to a file (environment variable allowed, ex: %TEMP%\my.log).&lt;br /&gt;
* &amp;lt;table name&amp;gt; if logging to the ODBC db.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;Target&amp;gt; parameter may be omitted for everything else.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;PatternLayout&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter defines message-formatting rules. It can contain the following keys:&lt;br /&gt;
* %lineno		Line number of logged message (starts from zero)&lt;br /&gt;
* %userid		user ID (unknown if not logged in)&lt;br /&gt;
* %username	user name (unknown if not logged in)&lt;br /&gt;
* %proc		Process ID&lt;br /&gt;
* %thread	Thread ID&lt;br /&gt;
* %time		Time stamp&lt;br /&gt;
* %datetime	Date/time stamp&lt;br /&gt;
* %msg		Message itself&lt;br /&gt;
* %msglevel	Message level&lt;br /&gt;
* %newline	New line&lt;br /&gt;
* %callerClassName	Caller class name&lt;br /&gt;
* %callerPredicateName	Caller predicate name&lt;br /&gt;
* %callerCursor		Caller module name with line/position values&lt;br /&gt;
&lt;br /&gt;
For example: &amp;lt;PatternLayout&amp;gt;%userid(%username) \[%callerClassName/%callerPredicateName/%callerCursor\]%newline %proc:%thread time=%time dt=%datetime %msg(%msglevel)&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
Logged message (2 lines):&lt;br /&gt;
145(Test User) \[0x600260 &amp;quot;serviceLog&amp;quot;/anonymous$o0$1$setproc_name/2np$serviceLog/sourceCursor(&amp;quot;tools\\dashboard\\common\\Service.pro&amp;quot;, 14, 17)\]&lt;br /&gt;
&lt;br /&gt;
 18244:4660 time=16:35:51.935 dt=2015/08/06 - 16:35:51.935 Call: workspace_GetDefaultDirContent(\{\})(debug)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Filter&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines what messages will be filtered out (excluded) from the log. It can contain zero or more class names and/or zero or more method names separated by semicolon: &amp;#039;&amp;#039;&amp;#039;class:&amp;lt;class name&amp;gt;;method:&amp;lt;method name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
For example: &lt;br /&gt;
if filter is defined as following class:entityModel;method:getList all logging for class &amp;#039;&amp;#039;&amp;#039;entityModel&amp;#039;&amp;#039;&amp;#039; and method &amp;#039;&amp;#039;&amp;#039;getList&amp;#039;&amp;#039;&amp;#039; (no matter from which class) will be skipped.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;ConnectionString&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines connection string for ODBC logging.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;ColumnInfo&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines set of columns where to log some information. The &amp;#039;&amp;#039;&amp;#039;Name&amp;#039;&amp;#039;&amp;#039; attribute defines column name, the &amp;#039;&amp;#039;&amp;#039;Attribute&amp;#039;&amp;#039;&amp;#039; defines what to log. Attributes can have the same values described in &amp;#039;&amp;#039;&amp;#039;&amp;lt;PatternLayout&amp;gt;&amp;#039;&amp;#039;&amp;#039; section, except for skipped percentage sign (%) in the beginning.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Notes:===&lt;br /&gt;
* Log configuration file can have more than one appender that logs to a file or database table. Of course, in this case file names/database table names should be different. For example, critical errors can be logged to separate file and/or database table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Activating pfc\log from command line=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To use log package it is enough to specify one of the command lines parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-LogConfig &amp;lt;Log Configuration File Name&amp;gt; &amp;lt;Configuration Name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
For example: -LogConfig LogConfig.xml ConfigName1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=&lt;br /&gt;
Using pfc\log programmatically=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Loading log configuration file&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;==&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Make the following calls:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;logConfig::loadConfig(ConfigFileName, ConfigName).&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where: &lt;br /&gt;
ConfigFileName: log configuration file;&lt;br /&gt;
ConfigName: configuration name define in log configuration;&lt;br /&gt;
&lt;br /&gt;
If it is necessary to pass connection string (for db/odbc appenders) it is enough to enumerate activated appenders by name and set the connection string (in this example connection string is set for pfc\log\dbTable appender):&lt;br /&gt;
&lt;br /&gt;
LogAppenders = log::getAcivatedAppenders(@&amp;quot;pfc\log\dbTableAppender&amp;quot;),&lt;br /&gt;
foreach LogAppender in LogAppenders do&lt;br /&gt;
    LogAppender:connectionString := db_connectionString&lt;br /&gt;
end foreach&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==&lt;br /&gt;
Logging messages==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===&lt;br /&gt;
Use &amp;#039;&amp;#039;&amp;#039;log::write(level Level, ...)&amp;#039;&amp;#039;&amp;#039; and/or &amp;#039;&amp;#039;&amp;#039;log::writef(level Level, string Format &amp;#039;&amp;#039;&amp;#039;\[&amp;#039;&amp;#039;&amp;#039;formatString&amp;#039;&amp;#039;&amp;#039;\]&amp;#039;&amp;#039;&amp;#039;, ...)&amp;#039;&amp;#039;&amp;#039; predicates to log messages.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
Log message &amp;quot;Start&amp;quot; with log level &amp;quot;all&amp;quot;:&lt;br /&gt;
log::write(log::all, &amp;quot;Start&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Log fatal error using formatted log:&lt;br /&gt;
log::writef(log::fatal, &amp;quot;SQL ERROR during startup: %&amp;quot;, NativeMessage).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Using log programmatically without log configuration file&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of using ODBC appender:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;===&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
        ODBC = odbcAppender::new(),	&amp;lt;-- constructor&lt;br /&gt;
        ODBC:loglevel := log::all, 		&amp;lt;-- log level&lt;br /&gt;
        ODBC:columninfo := \[tuple(&amp;quot;username&amp;quot;, &amp;quot;username&amp;quot;), tuple(&amp;quot;msg&amp;quot;, &amp;quot;msg&amp;quot;)\], &amp;lt;-- column info (write &amp;#039;username&amp;#039; to the &amp;#039;username&amp;#039; column, write &amp;#039;msg&amp;#039; to the &amp;#039;msg&amp;#039; column,&lt;br /&gt;
        ODBC:connectionString := @&amp;quot;Driver=\{SQL Server\};Server=WEB1.dmz.hc\SQLEXPRESS;Database=Helpdesk_test;UID=leo;PWD=PdcPdcPdc1;app=HelpdeskDashboard&amp;quot;,&lt;br /&gt;
        log::activateAppender(true, ODBC), &amp;lt;-- activate appender&lt;br /&gt;
        log::write(log::debug, &amp;quot;Example&amp;quot;),	&amp;lt;-- log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=List of ideas=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* For critical errors - when we want to call PDC notification log, then we do also need:&lt;br /&gt;
%siteURL                                               (URL of the service)&lt;br /&gt;
%applicationName&lt;br /&gt;
%projectName&lt;br /&gt;
%programVersion&lt;br /&gt;
%customerName&lt;br /&gt;
%machineName&lt;br /&gt;
&lt;br /&gt;
* Expressions: In log4j, there are a number of filtering facilities: [http://logging.apache.org/log4j/2.x/log4j-users-guide.pdf http://logging.apache.org/log4j/2.x/log4j-users-guide.pdf] &lt;br /&gt;
I guess we should implement an expression is logging should be done, something like&lt;br /&gt;
UserName in \[&amp;quot;Leo&amp;quot;,&amp;quot;Alexander&amp;quot;\] and Time&amp;gt;17:00 or Level&amp;gt;info or Message %= &amp;quot;dfhj&amp;quot;&lt;br /&gt;
 - Where the Upper case names refer to the Variable.&lt;br /&gt;
&lt;br /&gt;
* Reload log configuration from UI (App settings/utility/etc.) &amp;#039;&amp;#039;&amp;#039;\[DONE\]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* PDC Notification Log: &amp;#039;&amp;#039;&amp;#039;\[DONE\]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
- analyze;&lt;br /&gt;
&lt;br /&gt;
* Also I think there should be a state variable something like:&lt;br /&gt;
&lt;br /&gt;
Enablelogging_if User=&amp;quot;Leo&amp;quot; and Message contains &amp;quot;login&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Disablelogging_if User=&amp;quot;Leo&amp;quot; and Message contains &amp;quot;logout&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is not precise; I just thought it is needed with a mechanism to start and stop logging based on  logical condition...&lt;br /&gt;
&lt;br /&gt;
* &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Logging&amp;diff=4186</id>
		<title>Logging</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Logging&amp;diff=4186"/>
		<updated>2015-11-19T13:25:22Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Logging ===&lt;br /&gt;
Logging for Prolog (pfc\log) package&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Overview=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Logging in Prolog currently supports logging to console, file, event log, database table, PDC notification log (to be done). Logging is thread safe and even supported for several processes that are writing to the same log. Application can also simultaneously log to several logs including logging to several files and/or database tables. Logging performance does not depend on log type. It is very fast operation and done asynchronously meaning that logging message placed into the message queue, which is processed in background thread. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Log configuration=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Log configuration file (has .XML format) defines where applications logs the information. &lt;br /&gt;
Here is the log configuration file example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;LogConfigurations&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ConfigName0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;console&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;PatternLayout&amp;gt;%username: %thread - %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Appender&amp;gt;		&lt;br /&gt;
&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ConfigName1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;event&amp;lt;/Type&amp;gt; &lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Target&amp;gt;Helpdeskdashboard&amp;lt;/Target&amp;gt; &lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;\[%lineno\] %userid %proc:%thread %datetime %msg&lt;br /&gt;
                     &amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName2&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;file&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Target&amp;gt;log.txt&amp;lt;/Target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;\[%lineno\] %userid(%username) \[%callerClassName/%callerPredicateName/%callerCursor\]%newline %proc:%thread time=%time dt=%datetime %msg(%msglevel)&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName3&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;dbtable&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;%userid %proc:%thread %datetime %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appender name=&amp;quot;AppenderName4&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Type&amp;gt;console&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;PatternLayout&amp;gt;%userid %proc:%thread %datetime %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;filter&amp;gt;class:entityModel;method:aaa&amp;lt;/filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;ODBCTable&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName4&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;LogLevel&amp;gt;all&amp;lt;/LogLevel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;odbcAsync&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Target&amp;gt;wwLogging&amp;lt;/Target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;ConnectionString&amp;gt;Driver=\{SQL Server\};Server=WEB1.dmz.hc\SQLEXPRESS;Database=Helpdesk_test;UID=xxx;PWD=yyy;app=HelpdeskDashboard&amp;lt;/ConnectionString&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;ColumnInfo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;level&amp;quot; attribute=&amp;quot;msglevel&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;linenumber&amp;quot; attribute =&amp;quot;lineno&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;username&amp;quot; attribute =&amp;quot;username&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;userID&amp;quot; attribute =&amp;quot;userid&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;procid&amp;quot; attribute =&amp;quot;proc&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;thread&amp;quot; attribute =&amp;quot;thread&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;datetime&amp;quot; attribute =&amp;quot;datetime&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;time&amp;quot; attribute =&amp;quot;datetime&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerClassNameElem&amp;quot; attribute =&amp;quot;callerclassname&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerPredicateNameElem&amp;quot; attribute =&amp;quot;callerpredicatename&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;callerCursorElem&amp;quot; attribute =&amp;quot;callercursor&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;Column name=&amp;quot;msg&amp;quot; attribute =&amp;quot;msg&amp;quot;&amp;gt;&amp;lt;/Column&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;/ColumnInfo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;DBTable&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;dbTableAsync&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LogConfig name=&amp;quot;PDCNotification&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;Appender name=&amp;quot;AppenderName6&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;Type&amp;gt;service&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;PatternLayout&amp;gt;%thread - %msg&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
			&amp;lt;/Appender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Appenders&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/LogConfigurations&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Log configuration file may contain one or more named configurations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;LogConfig name=&amp;quot;ConfigName0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/LogConfig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each configuration contains one or more appenders. Appender defines the log target and has the following parameters: &amp;#039;&amp;#039;&amp;#039;LogLevel, Type, Target, PatternLayout, Filter, ConnectionString, ColumnInfo&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Loglevel&amp;gt;&amp;#039;&amp;#039;&amp;#039; can be one of the following: &lt;br /&gt;
* all&lt;br /&gt;
* debug	&lt;br /&gt;
* info&lt;br /&gt;
* warn&lt;br /&gt;
* error&lt;br /&gt;
* fatal&lt;br /&gt;
* off&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Type&amp;gt;&amp;#039;&amp;#039;&amp;#039; can be one of the following:&lt;br /&gt;
* console				logging to console&lt;br /&gt;
* event				logging to the event log&lt;br /&gt;
* file or fileAsync			logging to file synchronously or asynchronously&lt;br /&gt;
* dbTable or dbTableAsync	logging errors to the internal database synchronously or            asynchronously&lt;br /&gt;
* odbc or odbcAsync		logging to the database synchronously or asynchronously&lt;br /&gt;
* service				logging to the PDC Notification log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Target&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines where to log for every log &amp;lt;Type&amp;gt; and has the following values:&lt;br /&gt;
* &amp;lt;EventSource&amp;gt; if logging to the event log. Event source is usually application name&lt;br /&gt;
* &amp;lt;file name&amp;gt; if logging to a file (environment variable allowed, ex: %TEMP%\my.log).&lt;br /&gt;
* &amp;lt;table name&amp;gt; if logging to the ODBC db.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;Target&amp;gt; parameter may be omitted for everything else.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;PatternLayout&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter defines message-formatting rules. It can contain the following keys:&lt;br /&gt;
* %lineno		Line number of logged message (starts from zero)&lt;br /&gt;
* %userid		user ID (unknown if not logged in)&lt;br /&gt;
* %username	user name (unknown if not logged in)&lt;br /&gt;
* %proc		Process ID&lt;br /&gt;
* %thread	Thread ID&lt;br /&gt;
* %time		Time stamp&lt;br /&gt;
* %datetime	Date/time stamp&lt;br /&gt;
* %msg		Message itself&lt;br /&gt;
* %msglevel	Message level&lt;br /&gt;
* %newline	New line&lt;br /&gt;
* %callerClassName	Caller class name&lt;br /&gt;
* %callerPredicateName	Caller predicate name&lt;br /&gt;
* %callerCursor		Caller module name with line/position values&lt;br /&gt;
&lt;br /&gt;
For example: &amp;lt;PatternLayout&amp;gt;%userid(%username) \[%callerClassName/%callerPredicateName/%callerCursor\]%newline %proc:%thread time=%time dt=%datetime %msg(%msglevel)&amp;lt;/PatternLayout&amp;gt;&lt;br /&gt;
Logged message (2 lines):&lt;br /&gt;
145(Test User) \[0x600260 &amp;quot;serviceLog&amp;quot;/anonymous$o0$1$setproc_name/2np$serviceLog/sourceCursor(&amp;quot;tools\\dashboard\\common\\Service.pro&amp;quot;, 14, 17)\]&lt;br /&gt;
&lt;br /&gt;
 18244:4660 time=16:35:51.935 dt=2015/08/06 - 16:35:51.935 Call: workspace_GetDefaultDirContent(\{\})(debug)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;Filter&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines what messages will be filtered out (excluded) from the log. It can contain zero or more class names and/or zero or more method names separated by semicolon: &amp;#039;&amp;#039;&amp;#039;class:&amp;lt;class name&amp;gt;;method:&amp;lt;method name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
For example: &lt;br /&gt;
if filter is defined as following class:entityModel;method:getList all logging for class &amp;#039;&amp;#039;&amp;#039;entityModel&amp;#039;&amp;#039;&amp;#039; and method &amp;#039;&amp;#039;&amp;#039;getList&amp;#039;&amp;#039;&amp;#039; (no matter from which class) will be skipped.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;ConnectionString&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines connection string for ODBC logging.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;ColumnInfo&amp;gt;&amp;#039;&amp;#039;&amp;#039; defines set of columns where to log some information. The &amp;#039;&amp;#039;&amp;#039;Name&amp;#039;&amp;#039;&amp;#039; attribute defines column name, the &amp;#039;&amp;#039;&amp;#039;Attribute&amp;#039;&amp;#039;&amp;#039; defines what to log. Attributes can have the same values described in &amp;#039;&amp;#039;&amp;#039;&amp;lt;PatternLayout&amp;gt;&amp;#039;&amp;#039;&amp;#039; section, except for skipped percentage sign (%) in the beginning.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Notes:===&lt;br /&gt;
* Log configuration file can have more than one appender that logs to a file or database table. Of course, in this case file names/database table names should be different. For example, critical errors can be logged to separate file and/or database table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Activating pfc\log from command line=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To use log package it is enough to specify one of the command lines parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-LogConfig &amp;lt;Log Configuration File Name&amp;gt; &amp;lt;Configuration Name&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
For example: -LogConfig LogConfig.xml ConfigName1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=&lt;br /&gt;
Using pfc\log programmatically=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Loading log configuration file&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;==&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Make the following calls:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;logConfig::loadConfig(ConfigFileName, ConfigName).&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where: &lt;br /&gt;
ConfigFileName: log configuration file;&lt;br /&gt;
ConfigName: configuration name define in log configuration;&lt;br /&gt;
&lt;br /&gt;
If it is necessary to pass connection string (for db/odbc appenders) it is enough to enumerate activated appenders by name and set the connection string (in this example connection string is set for pfc\log\dbTable appender):&lt;br /&gt;
&lt;br /&gt;
LogAppenders = log::getAcivatedAppenders(@&amp;quot;pfc\log\dbTableAppender&amp;quot;),&lt;br /&gt;
foreach LogAppender in LogAppenders do&lt;br /&gt;
    LogAppender:connectionString := db_connectionString&lt;br /&gt;
end foreach&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==&lt;br /&gt;
Logging messages==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===&lt;br /&gt;
Use &amp;#039;&amp;#039;&amp;#039;log::write(level Level, ...)&amp;#039;&amp;#039;&amp;#039; and/or &amp;#039;&amp;#039;&amp;#039;log::writef(level Level, string Format &amp;#039;&amp;#039;&amp;#039;\[&amp;#039;&amp;#039;&amp;#039;formatString&amp;#039;&amp;#039;&amp;#039;\]&amp;#039;&amp;#039;&amp;#039;, ...)&amp;#039;&amp;#039;&amp;#039; predicates to log messages.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
Log message &amp;quot;Start&amp;quot; with log level &amp;quot;all&amp;quot;:&lt;br /&gt;
log::write(log::all, &amp;quot;Start&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Log fatal error using formatted log:&lt;br /&gt;
log::writef(log::fatal, &amp;quot;SQL ERROR during startup: %&amp;quot;, NativeMessage).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Using log programmatically without log configuration file&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of using ODBC appender:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;===&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
        ODBC = odbcAppender::new(),	&amp;lt;-- constructor&lt;br /&gt;
        ODBC:loglevel := log::all, 		&amp;lt;-- log level&lt;br /&gt;
        ODBC:columninfo := \[tuple(&amp;quot;username&amp;quot;, &amp;quot;username&amp;quot;), tuple(&amp;quot;msg&amp;quot;, &amp;quot;msg&amp;quot;)\], &amp;lt;-- column info (write &amp;#039;username&amp;#039; to the &amp;#039;username&amp;#039; column, write &amp;#039;msg&amp;#039; to the &amp;#039;msg&amp;#039; column,&lt;br /&gt;
        ODBC:connectionString := @&amp;quot;Driver=\{SQL Server\};Server=WEB1.dmz.hc\SQLEXPRESS;Database=Helpdesk_test;UID=leo;PWD=PdcPdcPdc1;app=HelpdeskDashboard&amp;quot;,&lt;br /&gt;
        log::activateAppender(true, ODBC), &amp;lt;-- activate appender&lt;br /&gt;
        log::write(log::debug, &amp;quot;Example&amp;quot;),	&amp;lt;-- log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=List of ideas=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* For critical errors - when we want to call PDC notification log, then we do also need:&lt;br /&gt;
%siteURL                                               (URL of the service)&lt;br /&gt;
%applicationName&lt;br /&gt;
%projectName&lt;br /&gt;
%programVersion&lt;br /&gt;
%customerName&lt;br /&gt;
%machineName&lt;br /&gt;
&lt;br /&gt;
* Expressions: In log4j, there are a number of filtering facilities: [http://logging.apache.org/log4j/2.x/log4j-users-guide.pdf http://logging.apache.org/log4j/2.x/log4j-users-guide.pdf] &lt;br /&gt;
I guess we should implement an expression is logging should be done, something like&lt;br /&gt;
UserName in \[&amp;quot;Leo&amp;quot;,&amp;quot;Alexander&amp;quot;\] and Time&amp;gt;17:00 or Level&amp;gt;info or Message %= &amp;quot;dfhj&amp;quot;&lt;br /&gt;
 - Where the Upper case names refer to the Variable.&lt;br /&gt;
&lt;br /&gt;
* Reload log configuration from UI (App settings/utility/etc.) &amp;#039;&amp;#039;&amp;#039;\[DONE\]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* PDC Notification Log: &amp;#039;&amp;#039;&amp;#039;\[DONE\]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
- analyze;&lt;br /&gt;
&lt;br /&gt;
* Also I think there should be a state variable something like:&lt;br /&gt;
&lt;br /&gt;
Enablelogging_if User=&amp;quot;Leo&amp;quot; and Message contains &amp;quot;login&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Disablelogging_if User=&amp;quot;Leo&amp;quot; and Message contains &amp;quot;logout&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is not precise; I just thought it is needed with a mechanism to start and stop logging based on  logical condition...&lt;br /&gt;
&lt;br /&gt;
* &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Logging&amp;diff=4185</id>
		<title>Logging</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Logging&amp;diff=4185"/>
		<updated>2015-11-19T13:01:04Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Logging ===&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Logging&amp;diff=4184</id>
		<title>Logging</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Logging&amp;diff=4184"/>
		<updated>2015-11-19T12:59:16Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: Created page with &amp;quot;=== Logging ===&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Logging ===&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Ide/Debugger/Debugger_Views&amp;diff=4003</id>
		<title>Ide/Debugger/Debugger Views</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Ide/Debugger/Debugger_Views&amp;diff=4003"/>
		<updated>2015-03-18T15:25:56Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: /* Memory Dump Window */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;[[Category:Ide/Debugger]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
== Debugger Views ==&lt;br /&gt;
&lt;br /&gt;
=== Run Stack Window ===&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; consists of three kinds of items:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Continue&amp;#039;&amp;#039;&amp;#039; item – marked with [[Image:Ide_db_RunStack_up.png]]. It describes ordinary executable clauses, which do not produce backtrack points and are not trapped.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;BackTrack&amp;#039;&amp;#039;&amp;#039; item – marked with [[Image:Ide_db_RunStack_dn.png]].It describes a clause of a nondeterministic predicate. The next clause of this predicate can be executed when a program failure of this clause occurs. Such items occur when a clause of a predicate, which creates a &amp;#039;&amp;#039;&amp;#039;backtrack&amp;#039;&amp;#039;&amp;#039; point (can produce more than one solution) is called.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;TrapTrack&amp;#039;&amp;#039;&amp;#039; item – marked with [[Image:Ide_db_RunStack_rh.png]] or [[Image:Ide_db_RunStack_dn_rh.png]]. They describe a continue item (clause), which will be resumed in any case independently whether an error condition occurs or no. For example, such item is created when a predicate call is trapped with the &amp;lt;vp&amp;gt;trap/3&amp;lt;/vp&amp;gt; predicate. The [[Image:Ide_db_RunStack_rh.png]] icon is used to mark trapped clauses of deterministic predicates. The [[Image:Ide_db_RunStack_dn_rh.png]] icon is used to mark trapped clauses of nondeterministic predicates.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;BackTrack&amp;#039;&amp;#039;&amp;#039; (marked with [[Image:Ide_db_RunStack_dn.png]]) and &amp;#039;&amp;#039;&amp;#039;TrapTrack&amp;#039;&amp;#039;&amp;#039; items (marked with [[Image:Ide_db_RunStack_dn_rh.png]]) are backtracking points. The clause, marked by one of these items, will be resumed and the program execution will be continued after the corresponding failure or an error occurs.&lt;br /&gt;
&lt;br /&gt;
The typical example of the &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; window is presented in the following picture:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_RunStack.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pop-up Menu&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; window has the pop-up context menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_RunStack_menu.png]]&lt;br /&gt;
&lt;br /&gt;
For each selected item in the tree, this menu contains items:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Refresh&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:It refreshes all the &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; window contents, rebuilds the tree.&lt;br /&gt;
*:&amp;lt;br/&amp;gt;It also refreshes the {{ide|Debugger#Variables Window|&amp;#039;&amp;#039;&amp;#039;Variables&amp;#039;&amp;#039;&amp;#039;}} window (if it is displayed).&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Go To Code&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Activates the Prolog source editor and places the cursor at the Prolog clause corresponding to the item selected in the &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; window. If the item does not correspond to a Prolog module with debug information, then the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window will be opened and the cursor will be placed onto the corresponding assembler instruction. The same action is caused by double-click a predicate call in the &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; window.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Copy Line&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:It copies the selected line contents to the clipboard.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Show Domains&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This option turns ON/OFF displaying domains of variables.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Show Values&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This option turns ON/OFF displaying values of variables.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; window can be activated by the IDE menu &amp;#039;&amp;#039;&amp;#039;View | Run Stack&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Variables Window ===&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Variables&amp;#039;&amp;#039;&amp;#039; window can be activated either by &amp;#039;&amp;#039;&amp;#039;Ctrl+Alt+V&amp;#039;&amp;#039;&amp;#039; or from the IDE menu &amp;#039;&amp;#039;&amp;#039;View | Variables for Current Clause&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Variables Window Contents&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Variables&amp;#039;&amp;#039;&amp;#039; window displays the tree of all program variables and facts from the traced clause, which are already created by the program at the current tracing step. These are: all variables and all object facts (fact variables), which are created in the clause before the executing instruction, and all class facts (fact variables), which can be used in this clause (declared in this class implementation).&lt;br /&gt;
&lt;br /&gt;
The top line of the window displays the declaration of the predicate, whose clause is executed.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Vars_Top.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Variables&amp;#039;&amp;#039;&amp;#039; window content is updated after every trace step.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pop-up Context Menu&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Variables in the Current Clause&amp;#039;&amp;#039;&amp;#039; window has the following pop-up context menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Vars_Menu.png]]&lt;br /&gt;
&lt;br /&gt;
This menu contains items:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Insert into Watch Window&amp;#039;&amp;#039;&lt;br /&gt;
*:Opens the &amp;#039;&amp;#039;&amp;#039;Watch Window&amp;#039;&amp;#039;&amp;#039; and moves there selected variable.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Copy&amp;#039;&amp;#039;&lt;br /&gt;
*:This command copies the contents of the line selected in the &amp;#039;&amp;#039;&amp;#039;Variables&amp;#039;&amp;#039;&amp;#039; window to the clipboard.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show as Hexadecimal&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows integral values in the hexadecimal format.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show as Decimal&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows integral values in the decimal format.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show as Octal&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows integral values in the octal format.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show Domains&amp;#039;&amp;#039;&lt;br /&gt;
*:This option turns &amp;#039;&amp;#039;&amp;#039;ON/OFF&amp;#039;&amp;#039;&amp;#039; displaying the domains after variable names.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show Variable Addresses&amp;#039;&amp;#039;&lt;br /&gt;
*:This option turns &amp;#039;&amp;#039;&amp;#039;ON/OFF&amp;#039;&amp;#039;&amp;#039; displaying the addresses after variable names.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Find&amp;#039;&amp;#039;&lt;br /&gt;
*:This command allows search variable by name.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Copy Tree&amp;#039;&amp;#039;&lt;br /&gt;
*:This command copies the contents of the window to the clipboard.&lt;br /&gt;
&lt;br /&gt;
=== Facts Window ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Class Facts&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Facts&amp;#039;&amp;#039;&amp;#039; window always shows the current contents of all &amp;#039;&amp;#039;&amp;#039;class&amp;#039;&amp;#039;&amp;#039; fact databases defined in the program being debugged.&lt;br /&gt;
&lt;br /&gt;
Simple example:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Facts_View.png]]&lt;br /&gt;
&lt;br /&gt;
Pressing &amp;#039;&amp;#039;&amp;#039;CTRL+ALT+F&amp;#039;&amp;#039;&amp;#039; opens &amp;#039;&amp;#039;&amp;#039;Facts&amp;#039;&amp;#039;&amp;#039; window:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Facts_View3.png]]&lt;br /&gt;
&lt;br /&gt;
Clicking icons opens sub-trees:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Facts_View4.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Facts&amp;#039;&amp;#039;&amp;#039; window automatically goes to the fact that is selected in the text editor (if any):&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Facts_View11.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Facts_View41.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Objects Facts&amp;#039;&amp;#039;&amp;#039; you cat look like a components of object variables in the {{ide|Debugger#Variables Window|&amp;#039;&amp;#039;&amp;#039;Variables&amp;#039;&amp;#039;&amp;#039; window}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pop-up Context Menu&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Facts Window&amp;#039;&amp;#039;&amp;#039; has the following pop-up context menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Vars_Menu.png]]&lt;br /&gt;
&lt;br /&gt;
This menu contains items:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Insert into Watch Window&amp;#039;&amp;#039;&lt;br /&gt;
*:Opens the &amp;#039;&amp;#039;&amp;#039;Watch Window&amp;#039;&amp;#039;&amp;#039; and moves there selected fact.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Copy&amp;#039;&amp;#039;&lt;br /&gt;
*:This command copies the contents of the line selected in the &amp;#039;&amp;#039;&amp;#039;Facts&amp;#039;&amp;#039;&amp;#039; window to the clipboard.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show as Hexadecimal&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows integral values in the hexadecimal format.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show as Decimal&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows integral values in the decimal format.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show as Octal&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows integral values in the octal format.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show Domains&amp;#039;&amp;#039;&lt;br /&gt;
*:This option turns &amp;#039;&amp;#039;&amp;#039;ON/OFF&amp;#039;&amp;#039;&amp;#039; displaying the domains after facts names.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show Addresses&amp;#039;&amp;#039;&lt;br /&gt;
*:This option turns &amp;#039;&amp;#039;&amp;#039;ON/OFF&amp;#039;&amp;#039;&amp;#039; displaying the addresses after facts names.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Find&amp;#039;&amp;#039;&lt;br /&gt;
*:This command allows search fact by name.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Copy Tree&amp;#039;&amp;#039;&lt;br /&gt;
*:This command copies the contents of the window to the clipboard.&lt;br /&gt;
&lt;br /&gt;
=== Breakpoints Window ===&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Breakpoints&amp;#039;&amp;#039;&amp;#039; window shows all breakpoints, which have been set in the program being debugged.&lt;br /&gt;
&lt;br /&gt;
You can set a breakpoint onto any executable line in program source files (or in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window, where a breakpoint can be set on any instruction of the program being debugged).&lt;br /&gt;
&lt;br /&gt;
There are two kinds of breakpoints: hard and soft. Hard breakpoints are active in any debugging mode. Soft breakpoints are active in normal debugging mode but disabled in a special mode of quick debugging, called &amp;#039;&amp;#039;Fast Forward Mode&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== Breakpoints Window Contents ====&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Breakpoints&amp;#039;&amp;#039;&amp;#039; window for each breakpoint includes &amp;#039;&amp;#039;&amp;#039;Status&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Line&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Count&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Comment&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Action&amp;#039;&amp;#039;&amp;#039;, where:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Status&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows whether the breakpoint is &amp;#039;&amp;#039;hard&amp;#039;&amp;#039; or &amp;#039;&amp;#039;soft&amp;#039;&amp;#039;.&lt;br /&gt;
**&amp;#039;&amp;#039;Hard&amp;#039;&amp;#039;&lt;br /&gt;
**:If a breakpoint is &amp;#039;&amp;#039;hard&amp;#039;&amp;#039; then it will be activated in any debugging mode. A hard breakpoint is marked with the filled circle [[Image:Ide_db_BreakPoints_en.png]] or [[Image:Ide_db_BreakPoints_assembler.png]] (for assembler) or [[Image:Ide_db_BreakPoints_shifted.png]] (for relocated breakpoint).&lt;br /&gt;
**&amp;#039;&amp;#039;Soft&amp;#039;&amp;#039;&lt;br /&gt;
**:If a breakpoint is &amp;#039;&amp;#039;soft&amp;#039;&amp;#039; then it will be activated only in normal (not Fast Forward) debugging mode. A soft breakpoint is marked with the hollow circle [[Image:Ide_db_BreakPoints_dis.png]] or [[Image:Ide_db_BreakPoints_assembler_disabled.png]] (for assembler).&lt;br /&gt;
**&amp;#039;&amp;#039;Invalid&amp;#039;&amp;#039;&lt;br /&gt;
**:A breakpoint is invalid when it is set on a line, which does not contain executable code. An invalid breakpoint is marked with the crossed hollow circle [[Image:Ide_db_BreakPoints_invalid.png]].&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This column shows the source string:&lt;br /&gt;
*:&amp;lt;vipbnf&amp;gt;&amp;lt;SourceName&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*:where:&lt;br /&gt;
*:&amp;#039;&amp;#039;SourceName&amp;#039;&amp;#039;&lt;br /&gt;
*:The description of a predicate in the address space of whose clauses the breakpoint is set:&lt;br /&gt;
*:*If the breakpoint is set in Prolog sources, then &amp;#039;&amp;#039;SourceName&amp;#039;&amp;#039; is the filename in which the breakpoint is set. It is displayed with the format:&lt;br /&gt;
*::&amp;lt;vipbnf&amp;gt;&amp;lt;FileName&amp;gt; &amp;#039;(&amp;#039; &amp;lt;Path&amp;gt; &amp;#039;)&amp;#039;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*::The &amp;#039;&amp;#039;Path&amp;#039;&amp;#039; can use {{ide|Make Facility#Build Symbols|Build script symbols}}.&lt;br /&gt;
*:* If the breakpoint is set in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window, then &amp;#039;&amp;#039;SourceName&amp;#039;&amp;#039; has the format:&lt;br /&gt;
*::&amp;lt;vipbnf&amp;gt;--- assembler: &amp;lt;AddressValue&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*::&amp;#039;&amp;#039;AddressValue&amp;#039;&amp;#039; is the hexadecimal address of the breakpoint in the assembler code of the predicate in which the breakpoint is set.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Line&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:When the breakpoint is set in a Prolog source file, then this column displays the number of the line the breakpoint is set on. &amp;lt;br /&amp;gt; When the breakpoint is set in the Disassembly window, then the number of the line is equal to 0.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Count&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This column displays {{ide|Debugger#Breakpoint Properties|counts}} of breakpoints.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Comment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This column displays {{ide|Debugger#Breakpoint Properties|comment strings}} of breakpoints.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Action&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This column displays the script text of a breakpoint. The script is performed each time the program reaches the breakpoint.&lt;br /&gt;
&lt;br /&gt;
==== Breakpoints in Prolog and Disassembly Windows ====&lt;br /&gt;
&lt;br /&gt;
Breakpoints can be set in Prolog source files and in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window:&lt;br /&gt;
&lt;br /&gt;
* In Prolog sources valid breakpoints can be set only on lines containing executable instructions. That is, breakpoints can be set only in predicate clauses on lines containing predicate calls, otherwise the breakpoints that are set on non-clause lines would be marked as invalid. The breakpoints that are set on clause lines that do not contain predicate calls would be shifted to the lines containing such calls (if any), but the initial line would be marked with [[Image:Ide_db_BreakPoints_shifted.png]]. Valid breakpoints are marked with red circles [[Image:Ide_db_BreakPoints_en.png]] or [[Image:Ide_db_BreakPoints_dis.png]] in Prolog sources and are shown in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window as blue circles [[Image:Ide_db_BreakPoints_assembler.png]] or [[Image:Ide_db_BreakPoints_assembler_disabled.png]]. If a Prolog clause has several assembler implementations (when the clause has several flow patterns), then each breakpoint in Prolog sources can generate several breakpoints in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window.&lt;br /&gt;
* Breakpoints that are set in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window are marked with red circles [[Image:Ide_db_BreakPoints_en.png]] or [[Image:Ide_db_BreakPoints_dis.png]]. Such breakpoint can be later overwritten by a breakpoint (marked with blue circles [[Image:Ide_db_BreakPoints_assembler.png]] or [[Image:Ide_db_BreakPoints_assembler_disabled.png]]) that is set in Prolog sources on the same address as the breakpoint set in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window.&amp;lt;br /&amp;gt; Notice that after modification and recompilation of the project some breakpoints that are set in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window can be cleared (if other instructions are placed at breakpoint addresses.)&lt;br /&gt;
&lt;br /&gt;
All breakpoints which are set in a program are seen in the &amp;#039;&amp;#039;&amp;#039;Breakpoints&amp;#039;&amp;#039;&amp;#039; window.&lt;br /&gt;
&lt;br /&gt;
==== Breakpoint Properties ====&lt;br /&gt;
&lt;br /&gt;
Each breakpoint has properties, which can be modified in the &amp;#039;&amp;#039;&amp;#039;Breakpoint Properties&amp;#039;&amp;#039;&amp;#039; dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_BreakPoint_Properties.png]]&lt;br /&gt;
&lt;br /&gt;
In this dialog:&lt;br /&gt;
&lt;br /&gt;
The top line contains:&lt;br /&gt;
&lt;br /&gt;
* If the breakpoint is set in Prolog sources, then the top line has format:&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;&amp;lt;vipbnf&amp;gt;File: &amp;lt;FileName&amp;gt; Line: &amp;lt;LineNumber&amp;gt;&amp;lt;/vipbnf&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;#039;&amp;#039;FileName&amp;#039;&amp;#039; is the name of the Prolog source file in which the breakpoint is set.&lt;br /&gt;
*:&amp;#039;&amp;#039;LineNumber&amp;#039;&amp;#039; is the number of the line on which the breakpoint is set.&lt;br /&gt;
&lt;br /&gt;
* If the breakpoint is set in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window, then the top line has format:&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;&amp;lt;vipbnf&amp;gt;Breakpoint Address:&amp;lt;Address&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*:&amp;#039;&amp;#039;Address&amp;#039;&amp;#039; is the breakpoint address in the program memory as it is seen in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hard&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:This check box controls the &amp;#039;&amp;#039;Hard/Soft&amp;#039;&amp;#039; state of the breakpoint. When you turn a breakpoint to Hard, then it will be activated in any debugging mode. When you turn a breakpoint to Soft, then it will be activated only in normal (not Fast Forward) debugging mode.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Counter&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;Value&amp;#039;&amp;#039;&lt;br /&gt;
:Shows the current number of activations of the breakpoint since its creation. The user cannot modify this value. This value increases by 1 each time when the program reaches the breakpoint. And resets to 0 at the beginning of the debug session.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Comment&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;Comment string&amp;#039;&amp;#039;&lt;br /&gt;
:In this edit box you can type in a &amp;#039;&amp;#039;Comment string&amp;#039;&amp;#039;. By default it has the value of the corresponding line in the source file.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Action&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;Script text&amp;#039;&amp;#039;&lt;br /&gt;
:In this box you can type in a &amp;#039;&amp;#039;Script text&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== Pop-up Menu ====&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Breakpoints&amp;#039;&amp;#039;&amp;#039; window has the pop-up context menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_BreakPoints_pop_up.png]]&lt;br /&gt;
&lt;br /&gt;
To activate this menu, select a breakpoint and press the right mouse button. This menu contains items:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Go to Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:If the breakpoint is set in the Prolog sources, then the &amp;#039;&amp;#039;&amp;#039;Go to Code&amp;#039;&amp;#039;&amp;#039; activates the Prolog source code editor, and moves the cursor to the Prolog code corresponding to the specified breakpoint. If the breakpoint is set in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window, then the &amp;#039;&amp;#039;&amp;#039;Go to Code&amp;#039;&amp;#039;&amp;#039; moves the view to this breakpoint in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window. The same action is performed by double-click the breakpoint or by pressing the &amp;#039;&amp;#039;&amp;#039;Enter&amp;#039;&amp;#039;&amp;#039; on the breakpoint.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Properties&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Invokes the {{ide|Debugger#Breakpoint Properties|&amp;#039;&amp;#039;&amp;#039;Breakpoint Properties&amp;#039;&amp;#039;&amp;#039;}} dialog for the selected breakpoint.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Toggle (Turn to Hard/Soft)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Switches the &amp;#039;&amp;#039;Hard/Soft&amp;#039;&amp;#039; state of the selected breakpoints.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Deletes the selected breakpoints.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Turn to Hard All&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Sets the state of all breakpoints that are set in the program to &amp;#039;&amp;#039;Hard&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Turn to Soft All&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Sets the state of all breakpoints that are set in the program to &amp;#039;&amp;#039;Soft&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Remove All&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Removes all breakpoints that are set in the program.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Breakpoints&amp;#039;&amp;#039;&amp;#039; window is auto-updated for any breakpoint updating.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Breakpoints&amp;#039;&amp;#039;&amp;#039; window can be activated either by &amp;#039;&amp;#039;&amp;#039;Ctrl+Alt+B&amp;#039;&amp;#039;&amp;#039; or from the IDE menu &amp;#039;&amp;#039;&amp;#039;View | Breakpoints&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Threads Window ===&lt;br /&gt;
----&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Threads&amp;#039;&amp;#039;&amp;#039; window shows information about the process being debugged and its threads.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Threads&amp;#039;&amp;#039;&amp;#039; window looks like following:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Threads.png]]&lt;br /&gt;
&lt;br /&gt;
Names displayed in the header of the window columns are the following:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;TID&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This column displays thread identifiers of all threads created by the process being debugged.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Current&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This column identifies the current thread by the &amp;lt;vp&amp;gt;*&amp;lt;/vp&amp;gt; sign. In the {{ide|Debugger#Variables Window|Variables}} window you can see only variables of predicates executed in the current thread.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;State&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Displays states of threads. States can be &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Running&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Stopped&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Suspend&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
*:&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Running&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;  The thread has been started, it is not suspended (see &amp;lt;vp&amp;gt;thread::suspend/0-&amp;gt;&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt; syncObject::wait/0-&amp;gt;&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;syncObject::wait/1-&amp;gt;&amp;lt;/vp&amp;gt;) or terminated (see &amp;lt;vp&amp;gt;thread::terminate/1&amp;lt;/vp&amp;gt;).&lt;br /&gt;
*:&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Suspend&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;  The thread is in suspended state (see &amp;lt;vp&amp;gt;thread::createSuspended/3&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;thread::suspend/0-&amp;gt;&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;syncObject::wait/0-&amp;gt;&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;syncObject::wait/1-&amp;gt;&amp;lt;/vp&amp;gt;).&lt;br /&gt;
*:&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Stopped&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; The thread was created and then stopped on a breakpoint, but it is not suspended (see &amp;lt;vp&amp;gt;thread::suspend/0-&amp;gt;&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;syncObject::wait/0-&amp;gt;&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;syncObject::wait/1-&amp;gt;&amp;lt;/vp&amp;gt;). If you set suspended state to a &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Stopped&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; thread, then it turns into the &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Suspend&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; state.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Thread creation time.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;User time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Processor time in the user-mode used by the thread.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Kernel Time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Processor time in the kernel-mode used by the thread.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Priority&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:The priority level of the thread. Here can be displayed the following numbers &amp;lt;vp&amp;gt;2, 1, 0, -1, -2&amp;lt;/vp&amp;gt;.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Predicate&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This field contains the name of the currently executed thread&amp;#039;s predicate (if it is possible to determine it).&lt;br /&gt;
&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
! Displayed Number&lt;br /&gt;
! Priority Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Highest&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The thread can be scheduled before threads with any other priority.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;AboveNormal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The thread can be scheduled after threads with &amp;#039;&amp;#039;&amp;#039;Highest&amp;#039;&amp;#039;&amp;#039; priority and before those with &amp;#039;&amp;#039;&amp;#039;Normal&amp;#039;&amp;#039;&amp;#039; priority.&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Normal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The thread can be scheduled after threads with &amp;#039;&amp;#039;&amp;#039;AboveNormal&amp;#039;&amp;#039;&amp;#039; priority and before those with &amp;#039;&amp;#039;&amp;#039;BelowNormal&amp;#039;&amp;#039;&amp;#039; priority. Threads have Normal priority by default.&lt;br /&gt;
|-&lt;br /&gt;
| -1&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;BelowNormal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The thread can be scheduled after threads with &amp;#039;&amp;#039;&amp;#039;Normal&amp;#039;&amp;#039;&amp;#039; priority and before those with &amp;#039;&amp;#039;&amp;#039;Lowest&amp;#039;&amp;#039;&amp;#039; priority.&lt;br /&gt;
|-&lt;br /&gt;
| -2&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Lowest&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The thread can be scheduled after threads with any other priority.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pop-up Menu&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Threads&amp;#039;&amp;#039;&amp;#039; window has the pop-up context menu. The same commands can be activated from the &amp;#039;&amp;#039;&amp;#039;Thread&amp;#039;&amp;#039;&amp;#039; sub-menu of the IDE task menu.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Threads_popup.png]]&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Goto Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Opens the text editor and places the cursor onto the predicate, which created the selected thread.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Set Current&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Sets the selected thread as current.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Resume&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Resumes the run of the selected thread.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Suspend&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Suspends the selected thread.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Copy&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Copies the contents of the line selected in the &amp;#039;&amp;#039;&amp;#039;Threads&amp;#039;&amp;#039;&amp;#039; window to the clipboard.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Copy All&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Copies the contents of the &amp;#039;&amp;#039;&amp;#039;Threads&amp;#039;&amp;#039;&amp;#039; window to the clipboard.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Threads&amp;#039;&amp;#039;&amp;#039; window is updated after changing any displayed parameter.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Threads&amp;#039;&amp;#039;&amp;#039; window can be activated either by &amp;#039;&amp;#039;&amp;#039;CTRL+Alt+H&amp;#039;&amp;#039;&amp;#039; or from the IDE menu &amp;#039;&amp;#039;&amp;#039;View | Threads&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Disassembly Window ===&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window shows the assembly language interpretation of the inspected code.&lt;br /&gt;
&lt;br /&gt;
The disassembly starts from the specified top address toward the upper memory and prints each instruction on a new line.&lt;br /&gt;
&lt;br /&gt;
Each line is printed by the pattern:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;LineMarkers&amp;gt; &amp;lt;Address&amp;gt; [ &amp;lt;HexCode&amp;gt; ] &amp;lt;AssemblerCommand&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;LineMarkers&amp;#039;&amp;#039;&lt;br /&gt;
:Are the {{ide|Debugger#Debug Menu Commands|&amp;#039;&amp;#039;instruction pointer&amp;#039;&amp;#039;}} [[Image:Ide_db_InstructionPointer.png]] and the breakpoint[[Image:Ide_db_BreakPoints_en.png]] (or [[Image:Ide_db_BreakPoints_dis.png]]) markers, which can mark this line.&lt;br /&gt;
&amp;#039;&amp;#039;Address&amp;#039;&amp;#039;&lt;br /&gt;
:The start address of the instruction code.&lt;br /&gt;
&amp;#039;&amp;#039;HexCode&amp;#039;&amp;#039;&lt;br /&gt;
:This is the hexadecimal instruction code. This field can be shown/hidden from the pop-up menu of the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window by checking the &amp;#039;&amp;#039;&amp;#039;Show OpCodes&amp;#039;&amp;#039;&amp;#039; item.&lt;br /&gt;
&amp;#039;&amp;#039;AssemblerCommand&amp;#039;&amp;#039;&lt;br /&gt;
:This is the assembler command corresponding to the instruction code. Assembler commands have the Intel standard assembler abbreviation. If a certain address is resolved to an external name, then this name will be printed in the command column.&lt;br /&gt;
:&amp;lt;br/&amp;gt;The instruction, which will be executed at the next trace step, is marked with the [[Image:Ide_db_InstructionPointer.png]] &amp;#039;&amp;#039;Instruction pointer&amp;#039;&amp;#039; in the &amp;#039;&amp;#039;LineMarkers&amp;#039;&amp;#039; field.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_DisAsm_View.png]]&lt;br /&gt;
&lt;br /&gt;
==== Pop-up Menu ====&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window has the pop-up context menu with the followin commands:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Go To Address&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Invokes the &amp;#039;&amp;#039;&amp;#039;Go to Address&amp;#039;&amp;#039;&amp;#039; dialog&lt;br /&gt;
*:[[Image:Ide_db_DisAsm_Go2Address.png]]&lt;br /&gt;
*:to type in the address of the instruction, which should be displayed in the top line of the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window. The &amp;#039;&amp;#039;Address&amp;#039;&amp;#039; should be specified in the hexadecimal format. This dialog allows typing symbolic external link names and symbolic CPU register names.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Go To EIP&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Updates the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window and places the cursor at the address of the instruction on which the program execution is suspended.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Breakpoint…&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Allows handling the breakpoint [[Image:Ide_db_BreakPoints_en.png]] (or [[Image:Ide_db_BreakPoints_dis.png]]) for the assembler instruction pointed by the cursor. It has the following sub-commands:&lt;br /&gt;
*:[[Image:Ide_db_DisAsm_PopUp.png]]&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Toggle Breakpoint&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Sets or removes a breakpoint at the instruction with the address pointed by the cursor.&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Enable / Disable&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:&amp;#039;&amp;#039;Enables / Disables&amp;#039;&amp;#039; the breakpoint pointed by the cursor. This item is disabled if there is no breakpoint at the address pointed by the cursor.&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Properties&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Invokes the &amp;#039;&amp;#039;&amp;#039;Breakpoint Properties&amp;#039;&amp;#039;&amp;#039; dialog for the breakpoint pointed by the cursor. This item is disabled if there is no breakpoint at the address pointed by the cursor.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Go To Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Activates the IDE source code editor and sets the cursor at the predicate whose assembler instruction is pointed by the cursor in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window. (When it is possible.)&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Copy&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Copies lines selected in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window to the clipboard. A selection can be performed with the &amp;#039;&amp;#039;&amp;#039;Shift+Up Arrow&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Shift+Down Arrow&amp;#039;&amp;#039;&amp;#039; key combinations.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Show OpCodes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Checking and unchecking this item hides/shows hex images of operation (instruction) codes (&amp;#039;&amp;#039;&amp;#039;OpCodes&amp;#039;&amp;#039;&amp;#039;). These hex instruction codes are shown in the &amp;#039;&amp;#039;HexCode&amp;#039;&amp;#039; field.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Source Annotation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Checking OFF/ON this item hides/shows object names, corresponding to predicate entry points. Each object name is printed on a new line before the corresponding instruction line.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Show Hints&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows additional information about the instruction being executed.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window is updated after each trace step of the debugger.&lt;br /&gt;
&lt;br /&gt;
==== Disassembly Window Commands ====&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Trace Into&amp;#039;&amp;#039;&amp;#039; command&lt;br /&gt;
*:Tracing in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window with the &amp;#039;&amp;#039;&amp;#039;Step Into&amp;#039;&amp;#039;&amp;#039; command performs execution of one assembler instruction (including entering into procedures if any). That is, if the &amp;#039;&amp;#039;&amp;#039;Step Over&amp;#039;&amp;#039;&amp;#039; command will execute a &amp;lt;vp&amp;gt;call&amp;lt;/vp&amp;gt; instruction as one trace step, then the &amp;#039;&amp;#039;&amp;#039;Step Into&amp;#039;&amp;#039;&amp;#039; command will go into the called procedure. It usually executes disassembler instructions line after line.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Step Over&amp;#039;&amp;#039;&amp;#039; command&lt;br /&gt;
*:Tracing in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window with the &amp;#039;&amp;#039;&amp;#039;Step Over&amp;#039;&amp;#039;&amp;#039;  command performs execution of one assembler instruction (including execution of &amp;lt;vp&amp;gt;call&amp;lt;/vp&amp;gt; instructions). So the &amp;#039;&amp;#039;&amp;#039;Step Over&amp;#039;&amp;#039;&amp;#039; command works almost the same way as the &amp;#039;&amp;#039;&amp;#039;Trace Into&amp;#039;&amp;#039;&amp;#039; command except for execution of &amp;lt;vp&amp;gt;call&amp;lt;/vp&amp;gt; instructions. In difference to the &amp;#039;&amp;#039;&amp;#039;Trace Into&amp;#039;&amp;#039;&amp;#039; command, it tries to perform &amp;lt;vp &amp;gt;call&amp;lt;/vp&amp;gt; instructions as one step and reaches the next line only if the called code returns to that line.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Run to Cursor&amp;#039;&amp;#039;&amp;#039; command&lt;br /&gt;
*:Tracing in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window with the &amp;#039;&amp;#039;&amp;#039;Run to Cursor&amp;#039;&amp;#039;&amp;#039; command works in the following way. The debugger places an invisible breakpoint at the address corresponding to the instruction specified by the cursor and performs the &amp;#039;&amp;#039;&amp;#039;Debug Run&amp;#039;&amp;#039;&amp;#039; command. It depends only upon the program code whether the program will reach this instruction or will never reach it.&lt;br /&gt;
&lt;br /&gt;
If the tracing code has no debug information, then the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window is opened initially (when the debugger starts) and the instruction pointer [[Image:Ide_db_InstructionPointer.png]] points to the executing assembler instruction.&lt;br /&gt;
&lt;br /&gt;
=== Registers Window ===&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Registers&amp;#039;&amp;#039;&amp;#039; window shows current values of the CPU (Central Processor Unit) registers:&lt;br /&gt;
&lt;br /&gt;
* General registers&lt;br /&gt;
* Segment registers&lt;br /&gt;
* Flags&lt;br /&gt;
* Floating-point registers&lt;br /&gt;
&lt;br /&gt;
A register value is printed:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:Red&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;red&amp;#039;&amp;#039;&amp;#039;&amp;lt;/span&amp;gt;, if it is changed from the last program trace step&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:Blue&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;blue&amp;#039;&amp;#039;&amp;#039;&amp;lt;/span&amp;gt;, otherwise.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Registers_fpu.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Floating Point&amp;#039;&amp;#039;&amp;#039; command from context pop-up menu can be used to turn ON/OFF the displaying of Floating-point registers.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Registers&amp;#039;&amp;#039;&amp;#039; window can be activated either by &amp;#039;&amp;#039;&amp;#039;Ctr+ Alt+G&amp;#039;&amp;#039;&amp;#039; or from the IDE menu &amp;#039;&amp;#039;&amp;#039;View | Registers&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Modules Window ===&lt;br /&gt;
----&lt;br /&gt;
The Modules Window shows all the modules currently loaded in this debug session. It shows the filename, path, the base address range, the code address range and the type of debug information.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Modules.png]]&lt;br /&gt;
&lt;br /&gt;
=== Memory Dump Window ===&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window shows the virtual memory dump of the program being debugged. Memory dump lines have the length, which is determined by the window width. The number of printed lines window height.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Information Displayed in the Memory Dump Window&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Each line in the &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window is printed by the pattern:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Address&amp;gt; | [ &amp;lt;HexValues&amp;gt; ] [ &amp;lt;ASCIIcharacters&amp;gt; ] [ &amp;lt;UnicodeCharacters&amp;gt;]&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Address&amp;#039;&amp;#039;&lt;br /&gt;
:This is the hexadecimal address of the first byte of the memory displayed in this line.&lt;br /&gt;
&amp;#039;&amp;#039;HexValues&amp;#039;&amp;#039;&lt;br /&gt;
:&amp;lt;vipbnf&amp;gt;&amp;lt;HexValues&amp;gt; : &amp;lt;HexValue&amp;gt; [ &amp;lt;HexValues&amp;gt; ]&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
:This is the hexadecimal format of the memory dump. Each hex value can be an image of one, two, four or eight continued memory bytes (this is contolled by the &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window content pop-up menu).&lt;br /&gt;
&amp;#039;&amp;#039;ASCIIcharacters&amp;#039;&amp;#039;&lt;br /&gt;
:&amp;lt;vipbnf&amp;gt;&amp;lt;ASCIIcharacters&amp;gt; : &amp;lt;ASCIIcharacter&amp;gt; [ &amp;lt;ASCIIcharacters&amp;gt; ]&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
:This is the same memory dump but in the format of ASCII characters (a character represenrs one byte). Unprintable characters are printed as dots.&lt;br /&gt;
&amp;#039;&amp;#039;UnicodeCharacters&amp;#039;&amp;#039;&lt;br /&gt;
:&amp;lt;vipbnf&amp;gt;&amp;lt;UnicodeCharacters&amp;gt; : &amp;lt;UnicodeCharacter&amp;gt; [ &amp;lt;UnicodeCharacters&amp;gt; ]&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
:This is the same memory dump in the format of Unicode characters (a character represents two bytes). Unprintable characters are printed as dots.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Memory_view1.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window title shows the module name, which memory is displayed in the window. If the module name cannot be determined, then the title displays &amp;#039;&amp;#039;Unknown module&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
If memory is inaccessible then its state will be represented by following symbol:&lt;br /&gt;
* &amp;#039;R&amp;#039; - memory reserved&lt;br /&gt;
* &amp;#039;G&amp;#039; - guard page&lt;br /&gt;
* &amp;#039;X&amp;#039; - unknown state&lt;br /&gt;
* &amp;#039;?&amp;#039; - memory free.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Content Pop-up Menu&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window has the pop-up context menu which contains commands:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Go To Address&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;Ctrl+G&amp;#039;&amp;#039;&amp;#039;. Invokes the &amp;#039;&amp;#039;&amp;#039;Go to Address&amp;#039;&amp;#039;&amp;#039; dialog&lt;br /&gt;
*:[[Image:Ide_db_DisAsm_Go2Address.png]]&lt;br /&gt;
*: to type a new top address in hex format. This dialog allows typing symbolic external link names and symbolic CPU register names. Double-click in the &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window area also activates the &amp;#039;&amp;#039;&amp;#039;Go to Address&amp;#039;&amp;#039;&amp;#039; dialog.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Go To &amp;#039;&amp;#039;Ptr&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;Ctrl+Shift+G&amp;#039;&amp;#039;&amp;#039;. Updates the &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window starting the first line from the address shown as &amp;#039;&amp;#039;Ptr&amp;#039;&amp;#039; (address defined by the memory contents of four or eight continued bytes at which the cursor is pointing if one of &amp;#039;&amp;#039;&amp;#039;4-byte Integer&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;8-byte Integer&amp;#039;&amp;#039;&amp;#039; is selected).&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Undo Go to&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;Alt+Left Arrow&amp;#039;&amp;#039;&amp;#039;. Updates the &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window view to start from the previously used top (the first line) address.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Redo Go to&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;Alt+Right Arrow&amp;#039;&amp;#039;&amp;#039;. This operation is the counterpart to the &amp;#039;&amp;#039;&amp;#039;Undo Go to&amp;#039;&amp;#039;&amp;#039;. It updates the &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window view to start from the &amp;quot;next&amp;quot; top address, which was used before the &amp;#039;&amp;#039;&amp;#039;Undo Go to&amp;#039;&amp;#039;&amp;#039; command was implemented.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Set Memory Breakpoint&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This operation sets a memory breakpoint at address from the left pane.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Remove Memory Breakpoint&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This operation removes a previously set a memory breakpoint.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Copy&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Copies the selected lines to the clipboard. To select a line, click on it while holding the &amp;#039;&amp;#039;&amp;#039;shift&amp;#039;&amp;#039;&amp;#039; key. You can select multiple lines at one time.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Copy &amp;#039;&amp;#039;Ptr&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;Ctrl+C&amp;#039;&amp;#039;&amp;#039;. Copies hexadecimal representation of the specified address (four or eight bytes) to the clipboard.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Refresh&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Refresh the &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window contents.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Write Block&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This command opens the &amp;#039;&amp;#039;&amp;#039;Write Memory Block&amp;#039;&amp;#039;&amp;#039; dialog:&lt;br /&gt;
*:[[Image:Ide_db_Memory_BlockWrite.png]]&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Filename&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Here you should type in the name of a file in which the specified memory block should be saved.&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Start Address&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Here you should specify a hexadecimal start address of the memory block.&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Length&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Here you should specify a hexadecimal length in bytes of the memory block.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Show Hex&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows the column, which displays the memory dump in the hexadecimal format. This is the {{ide|Debugger#Debugger Views|&amp;#039;&amp;#039;HexValues&amp;#039;&amp;#039;}} column in the right pane.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Show ASCII&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows the column, which displays the &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;ASCII&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; format of the memory dump. This is the {{ide|Debugger#Debugger Views|&amp;#039;&amp;#039;ASCIIcharacters&amp;#039;&amp;#039;}} column in the right pane.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Show Unicode&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows the column, which displays the &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Unicode&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; format of the memory dump. This is the {{ide|Debugger#Debugger Views|&amp;#039;&amp;#039;UnicodeCharacters&amp;#039;&amp;#039;}} column in the right pane.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Update Speed...&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Defines the rate of the Memory Dump window updating:&lt;br /&gt;
*:[[Image:iDE_db_Memory_menu1.png]]&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;High&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Performs automatic updating with the high rate.&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Normal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Performs automatic updating with normal rate.&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Low&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Performs automatic updating with low rate.&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Manual&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:No automatic updating.&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window can be activated either by &amp;#039;&amp;#039;&amp;#039;CTRL+Alt+M&amp;#039;&amp;#039;&amp;#039; or from the IDE menu &amp;#039;&amp;#039;&amp;#039;View | Memory Dump&amp;#039;&amp;#039;&amp;#039;.&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Generic_Interfaces_and_Classes&amp;diff=3988</id>
		<title>Language Reference/Generic Interfaces and Classes</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Generic_Interfaces_and_Classes&amp;diff=3988"/>
		<updated>2015-01-16T13:53:35Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: /* Restrictions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{languageReferenceNavbar|Generic Interfaces and Classes}}&lt;br /&gt;
&lt;br /&gt;
{{lang|Interfaces|Interfaces}} and {{lang|Classes|classes}} can be parametrized with type parameters so that they can be used in different instantiations in different contexts.&lt;br /&gt;
&lt;br /&gt;
This section must be considered as an extension to the individual sections about:&lt;br /&gt;
* {{lang|Interfaces|Interfaces}}&lt;br /&gt;
* {{lang|Classes|Classes}}&lt;br /&gt;
* {{lang|Implementations|Implementations}}&lt;br /&gt;
&lt;br /&gt;
The pragmatic reason to use generic classes and interfaces is to declare &amp;#039;&amp;#039;&amp;#039;parametrized object facts&amp;#039;&amp;#039;&amp;#039; and implement operations on these facts.  As illustrated in the Queue example below.&lt;br /&gt;
&lt;br /&gt;
=== Example: Queue ===&lt;br /&gt;
&lt;br /&gt;
Consider this interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface queue_integer&lt;br /&gt;
    predicates&lt;br /&gt;
        insert : (integer Value).&lt;br /&gt;
        tryGet : () -&amp;gt; integer Value.&lt;br /&gt;
end interface queue_integer&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An object of this type is a queue of integers, if you replace &amp;quot;integer&amp;quot; with &amp;quot;string&amp;quot; you would have a type describing queues of strings.&lt;br /&gt;
&lt;br /&gt;
A generic interface can be used to describe all such interfaces in a single interface definition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface queue{@Elem}&lt;br /&gt;
    predicates&lt;br /&gt;
        insert : (@Elem Value).&lt;br /&gt;
        tryGet : () -&amp;gt; @Elem Value determ.&lt;br /&gt;
end interface queue&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;@Elem&amp;lt;/vp&amp;gt; is a &amp;#039;&amp;#039;scope type variable&amp;#039;&amp;#039; (distinguished from local type variables by the &amp;lt;vp&amp;gt;@&amp;lt;/vp&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;queue{integer}&amp;lt;/vp&amp;gt; represents integer-queues; &amp;lt;vp&amp;gt;queue{string}&amp;lt;/vp&amp;gt; represents string-queues; and so forth.&lt;br /&gt;
&lt;br /&gt;
We can declare a generic queue class like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class queueClass{@Elem} : queue{@Elem}&lt;br /&gt;
end class queueClass&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;queueClass{@Elem}&amp;lt;/vp&amp;gt; constructs objects type &amp;lt;vp&amp;gt;queue{@Elem}&amp;lt;/vp&amp;gt; for any instantiation of &amp;lt;vp&amp;gt;@Elem&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The implementation can look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;implement queueClass{@Elem}&lt;br /&gt;
    facts&lt;br /&gt;
        queue_fact : (@Elem Value).&lt;br /&gt;
    clauses&lt;br /&gt;
        insert(Value) :-&lt;br /&gt;
            assert(queue_fact(Value)).&lt;br /&gt;
    clauses&lt;br /&gt;
        tryGet() = Value :-&lt;br /&gt;
            retract(queue_fact(Value)),&lt;br /&gt;
            !.&lt;br /&gt;
end implement queueClass&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This piece of code illustrates how to create an integer queue and insert an element in it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;..., Q = queueClass{integer}::new(), Q:insert(17), ...&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is not necessary to apply the type explicitly, instead the compiler can infer it from the context:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;..., Q = queueClass::new(), Q:insert(17), ...&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The compiler sees that &amp;lt;vp&amp;gt;Q&amp;lt;/vp&amp;gt; must be an integer queue, because we insert 17 into it.&lt;br /&gt;
&lt;br /&gt;
=== Generic Interfaces ===&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&lt;br /&gt;
Generic interfaces have a list of type parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;InterfaceDeclaration&amp;gt; :&lt;br /&gt;
    interface &amp;lt;InterfaceName&amp;gt; { &amp;lt;ScopeTypeVariable&amp;gt;-comma-sep-list-opt }&lt;br /&gt;
        &amp;lt;ScopeQualifications&amp;gt;&lt;br /&gt;
    &amp;lt;Sections&amp;gt;&lt;br /&gt;
    end interface &amp;lt;InterfaceName&amp;gt;-opt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ScopeTypeVariable&amp;gt; :&lt;br /&gt;
    @ &amp;lt;UppercaseName&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The scope type parameters can be used in any declaration/definition in the interface.&lt;br /&gt;
&lt;br /&gt;
==== Semantics ====&lt;br /&gt;
&lt;br /&gt;
A generic interface defines all the interfaces that can be obtained by instantiating the type parameters with actual types.  The scope type parameters from the opening are bound in the entire interface.&lt;br /&gt;
&lt;br /&gt;
==== Restrictions ====&lt;br /&gt;
&lt;br /&gt;
Then closing name should not have parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface xxx{@A}&lt;br /&gt;
    ...&lt;br /&gt;
end interface xxx % no parameters here&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is illegal to use same interface name for interfaces with different arity (in the same namespace):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface xxx % xxx/0&lt;br /&gt;
    ...&lt;br /&gt;
end interface xxx&lt;br /&gt;
&lt;br /&gt;
interface xxx{@A, @B} % error: Several classes, interfaces and/or namespaces have the same name &amp;#039;xxx&amp;#039;&lt;br /&gt;
    ...&lt;br /&gt;
end interface xxx&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Parameters can be used in supported interfaces:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface xxx{@P} supports yyy{@P} % legal: @P is bound&lt;br /&gt;
    ...&lt;br /&gt;
end interface xxx&lt;br /&gt;
&lt;br /&gt;
interface xxx supports yyy{@P} % illegal: @P must be bound&lt;br /&gt;
    ...&lt;br /&gt;
end interface xxx&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Supported interfaces can be instantiated with any type expressions (as long as parameters are bound):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface xxx{@A} supports yyy{integer, @A*}&lt;br /&gt;
    ...&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Generic Classes ===&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&lt;br /&gt;
Generic classes have a list of type parameters, and constructs objects of an interface type uses the these parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;ClassDeclaration&amp;gt; :&lt;br /&gt;
    class &amp;lt;ClassName&amp;gt; { &amp;lt;ScopeTypeVariable&amp;gt;-comma-sep-list-opt } &amp;lt;ConstructionType&amp;gt;&lt;br /&gt;
        &amp;lt;ScopeQualifications&amp;gt;&lt;br /&gt;
    &amp;lt;Sections&amp;gt; &lt;br /&gt;
    end class &amp;lt;ClassName&amp;gt;-opt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ScopeTypeVariable&amp;gt; :&lt;br /&gt;
    @ &amp;lt;UppercaseName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ConstructionType&amp;gt; :&lt;br /&gt;
   : &amp;lt;TypeExpression&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The construction type must be generic (i.e. a generic interface).&lt;br /&gt;
&lt;br /&gt;
==== Semantics ====&lt;br /&gt;
&lt;br /&gt;
A generic class declares a class with a generic constructor.  The type of the constructed object will be inferred from the usage of the constructor.&lt;br /&gt;
&lt;br /&gt;
==== Restrictions ====&lt;br /&gt;
&lt;br /&gt;
Then closing name should not have parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class xxx{@A} : xxx{@A}&lt;br /&gt;
    ...&lt;br /&gt;
end class xxx % no parameters here&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is illegal to use same class name for class with different arity (in the same namespace):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class xxx % xxx/0&lt;br /&gt;
    ...&lt;br /&gt;
end class xxx&lt;br /&gt;
&lt;br /&gt;
class xxx{@A} : yyy{@A} % error: Several classes, interfaces and/or namespaces have the same name &amp;#039;xxx&amp;#039;&lt;br /&gt;
    ...&lt;br /&gt;
end class xxx&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a class and interface can have the same name, the class must construct objects of that interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface xxx{@A}&lt;br /&gt;
    ...&lt;br /&gt;
end interface xxx&lt;br /&gt;
&lt;br /&gt;
class xxx{@Q, @P} : object % error: Several classes, interfaces and/or namespaces have the same name &amp;#039;xxx&amp;#039;&lt;br /&gt;
    ...&lt;br /&gt;
end class xxx&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Parameters in the construction type, etc must be bound:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class bbb : xxx{@Q} % error: Free parameter &amp;#039;@Q&amp;#039; is used in type expression&lt;br /&gt;
    ...&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All the parameters from the class must be used in the construction type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class xxx{@P} : object % error: Unused type parameter &amp;#039;@P&amp;#039;&lt;br /&gt;
    ...&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In class declarations scope parameter can only be used in constructors, domains and constants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class xxx{@P} : xxx{@P}&lt;br /&gt;
    domains&lt;br /&gt;
        list = @P*. % legal&lt;br /&gt;
    constants&lt;br /&gt;
        empty : @P* = []. % legal&lt;br /&gt;
    constructors&lt;br /&gt;
        new  : (@P Init).  % legal&lt;br /&gt;
    predicates&lt;br /&gt;
        p : (@P X). % error: Scope parameter &amp;#039;@P&amp;#039; used in a class entity&lt;br /&gt;
end class xxx&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Generic Implmentations ===&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&lt;br /&gt;
Generic implementations have a list of type parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;ClassImplementation&amp;gt; :&lt;br /&gt;
    implement &amp;lt;ClassName&amp;gt; { &amp;lt;ScopeTypeVariable&amp;gt;-comma-sep-list-opt }&lt;br /&gt;
        &amp;lt;ScopeQualifications&amp;gt;&lt;br /&gt;
    &amp;lt;Sections&amp;gt;&lt;br /&gt;
    end implement &amp;lt;ClassName&amp;gt;-opt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ScopeTypeVariable&amp;gt; :&lt;br /&gt;
    @ &amp;lt;UppercaseName&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Semantics ====&lt;br /&gt;
&lt;br /&gt;
A generic class declares a class with a generic constructor.  The type of the constructed object will be inferred from the usage of the constructor.&lt;br /&gt;
&lt;br /&gt;
==== Restrictions ====&lt;br /&gt;
&lt;br /&gt;
Then closing name should not have parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;implement xxx{@A}&lt;br /&gt;
    ...&lt;br /&gt;
end implement xxx % no parameters here&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The parameters must be the same as in the corresponding class declaration and have same order.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class xxx{@A} : aaa{@A}&lt;br /&gt;
    ...&lt;br /&gt;
end class xxx&lt;br /&gt;
&lt;br /&gt;
implement xxx{@B} % error: The parameter &amp;#039;@B&amp;#039; is not the same as in the declaration &amp;#039;@A&amp;#039;&lt;br /&gt;
    ...&lt;br /&gt;
end implement xxx&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In class implementations scope parameter can be used in constructors, domains, constants and in object entities (i.e. object facts, object predicates and object properties).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;implement xxx{@P}&lt;br /&gt;
    domains&lt;br /&gt;
        list = @P*. % legal&lt;br /&gt;
    constants&lt;br /&gt;
        empty : @P* = []. % legal&lt;br /&gt;
    constructors&lt;br /&gt;
        new  : (@P Init).  % legal&lt;br /&gt;
    predicates&lt;br /&gt;
        op : (@P X). % legal&lt;br /&gt;
    class predicates&lt;br /&gt;
        cp : (@P X). % error: Scope parameter &amp;#039;@P&amp;#039; used in a class entity&lt;br /&gt;
    facts&lt;br /&gt;
        ofct : (@P). % legal&lt;br /&gt;
    class facts&lt;br /&gt;
        cfct : (@P). % error: Scope parameter &amp;#039;@P&amp;#039; used in a class entity&lt;br /&gt;
    ...&lt;br /&gt;
end implement xxx&amp;lt;/vip&amp;gt;&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Terms/Anonymous_Predicates&amp;diff=3987</id>
		<title>Language Reference/Terms/Anonymous Predicates</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Terms/Anonymous_Predicates&amp;diff=3987"/>
		<updated>2015-01-01T22:04:52Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: remove filterPredicate&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An anonymous predicate is an expression that evaluates to a predicate value. The predicate value can be bound to a variable, passed as arguments or returned as result, but the value does not have a name in any class, interface or implementation.&lt;br /&gt;
&lt;br /&gt;
Anonymous predicates have the ability to capture values from the context in which the expression occurs, this is a rather powerful ability that can be used to avoid rather excessive amount of strange/unpleasant code.&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&lt;br /&gt;
Anonymous predicates are terms:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Term&amp;gt; : one of&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;AnonymousPredicate&amp;gt;&lt;br /&gt;
    ...&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An anonymous predicate is a nameless clause in curly brackets. Certain parts are optional, giving these forms:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;AnonymousPredicate&amp;gt; : one of&lt;br /&gt;
    { ( &amp;lt;Arg&amp;gt;-comma-sep-list ) = &amp;lt;Term&amp;gt; } &lt;br /&gt;
    { ( &amp;lt;Arg&amp;gt;-comma-sep-list ) = &amp;lt;Term&amp;gt; :- &amp;lt;Term&amp;gt; } &lt;br /&gt;
    { ( &amp;lt;Arg&amp;gt;-comma-sep-list ) :- &amp;lt;Term&amp;gt; }&lt;br /&gt;
    { = &amp;lt;Term&amp;gt; } &lt;br /&gt;
    { = &amp;lt;Term&amp;gt; :- &amp;lt;Term&amp;gt; } &lt;br /&gt;
    { :- &amp;lt;Term&amp;gt; }&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
Leaving out the argument list means &amp;quot;the required number of arguments&amp;quot; and can be used whenever the arguments are not used.&lt;br /&gt;
&lt;br /&gt;
==== Semantics ====&lt;br /&gt;
&lt;br /&gt;
An anonymous predicate expression evaluates to a predicate value.&lt;br /&gt;
Consider this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    run() :-&lt;br /&gt;
        Inc = { (X) = X+1 },&lt;br /&gt;
        A = Inc(4),&lt;br /&gt;
        B = Inc(23),&lt;br /&gt;
        stdio::writef(&amp;quot;A = %, B = %&amp;quot;, A, B).&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
Inc becomes an increment predicate, so the program will write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;A = 5, B = 24&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code in this example corresponds to this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    run() :-&lt;br /&gt;
        Inc = inc,&lt;br /&gt;
        A = Inc(4),&lt;br /&gt;
        B = Inc(23),&lt;br /&gt;
        stdio::writef(&amp;quot;A = %, B = %&amp;quot;, A, B).&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    inc : (integer X) -&amp;gt; integer R.&lt;br /&gt;
clauses&lt;br /&gt;
    inc(X) = X+1.&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
Where the clause &amp;lt;vp&amp;gt;(X) = X+1&amp;lt;/vp&amp;gt; can be found in the last line.  I.e. this time in a named predicate.&lt;br /&gt;
&lt;br /&gt;
Variables that are bound outside (i.e. before the occurrence of) an anonymous predicate can be used inside the anonymous predicate.  The value of variable will be captured by the anonymous predicate.&lt;br /&gt;
&lt;br /&gt;
Variables that are bound in an anonymous predicate are local variables in the anonymous predicate.&lt;br /&gt;
&lt;br /&gt;
===== Capturing context =====&lt;br /&gt;
&lt;br /&gt;
An anonymous predicate can capture context, which means that it can refer to things that are defined in its context, especially facts and variables from the clause.&lt;br /&gt;
&lt;br /&gt;
===== Capturing Variables =====&lt;br /&gt;
&lt;br /&gt;
Anonymous predicate occurs in a clause, and this clause may contain variables. Those variables that are bound before the anonymous predicate is met can be used inside the anonymous predicate.&lt;br /&gt;
This code illustrates how a variable is captured:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;domains&lt;br /&gt;
    pred = (integer) -&amp;gt; integer.&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    createAdder : (integer A) -&amp;gt; pred Adder.&lt;br /&gt;
clauses&lt;br /&gt;
    createAdder(A) = { (X) = X+A }.&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    run() :-&lt;br /&gt;
        Add17 = createAdder(17),&lt;br /&gt;
        A = Add17(4),&lt;br /&gt;
        B = Add17(20),&lt;br /&gt;
        stdio::writef(&amp;quot;A = %, B = %&amp;quot;, A, B).&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
We call &amp;lt;vp&amp;gt;createAdder&amp;lt;/vp&amp;gt; with &amp;lt;vp&amp;gt;17&amp;lt;/vp&amp;gt; as argument. So in the &amp;lt;vp&amp;gt;createAdder&amp;lt;/vp&amp;gt; clause &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is &amp;lt;vp&amp;gt;17&amp;lt;/vp&amp;gt;, and therefore the result is &amp;lt;vp&amp;gt;{ (X) = X+17 }&amp;lt;/vp&amp;gt;.  We say that the anonymous predicate has captured the variable &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;vp&amp;gt;Add17&amp;lt;/vp&amp;gt; is a predicate that adds &amp;lt;vp&amp;gt;17&amp;lt;/vp&amp;gt; to its argument, the output of the code will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;A = 21, B = 37&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Capturing ellipsis (...) =====&lt;br /&gt;
&lt;br /&gt;
An anonymous predicate can capture the ellipsis variable (i.e. ...):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    ppp(...)  :-&lt;br /&gt;
        W = { () :- stdio::write(...) },&lt;br /&gt;
        qqq(W).&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
&amp;lt;vp&amp;gt;W&amp;lt;/vp&amp;gt; captures the ellipsis variable. &amp;lt;vp&amp;gt;qqq&amp;lt;/vp&amp;gt; receives a zero-arity predicate, when this predicate is invoked the captured ellipsis  variable will be written to the standard output device.&lt;br /&gt;
&lt;br /&gt;
===== Capturing Facts =====&lt;br /&gt;
&lt;br /&gt;
An anonymous predicate can access facts. If it is created by a class predicate it can access class facts.  If it is created by an object predicate it can access both object and class facts.&lt;br /&gt;
Consider this code that captures a class fact:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class facts&lt;br /&gt;
    count : integer := 0.&lt;br /&gt;
clauses&lt;br /&gt;
    seq() = { () = count :- count := count+1 }.&lt;br /&gt;
clauses&lt;br /&gt;
    run() :-&lt;br /&gt;
        A = seq(),&lt;br /&gt;
        B = seq(),&lt;br /&gt;
        stdio::writef(&amp;quot;A1 = %, &amp;quot;, A()),&lt;br /&gt;
        stdio::writef(&amp;quot;B1 = %, &amp;quot;, B()),&lt;br /&gt;
        stdio::writef(&amp;quot;A2 = %, &amp;quot;, A()),&lt;br /&gt;
        stdio::writef(&amp;quot;B2 = %&amp;quot;, B()).&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
Both &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; increment the class fact count, so the result is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;A1 = 1, B1 = 2, A2 = 3, B2 = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In object predicates we can capture object facts. So assuming that &amp;lt;vp&amp;gt;seq&amp;lt;/vp&amp;gt; is an object predicate in &amp;lt;vp&amp;gt;myClass&amp;lt;/vp&amp;gt;, this code illustrates the capture of an object fact:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;facts&lt;br /&gt;
    count : integer := 0.&lt;br /&gt;
clauses&lt;br /&gt;
    seq() = { () = count :- count := count+1 }.&lt;br /&gt;
clauses&lt;br /&gt;
    run() :-&lt;br /&gt;
        A = myClass::new():seq(),&lt;br /&gt;
        B = myClass::new():seq(),&lt;br /&gt;
        stdio::writef(&amp;quot;A1 = %, &amp;quot;, A()),&lt;br /&gt;
        stdio::writef(&amp;quot;B1 = %, &amp;quot;, B()),&lt;br /&gt;
        stdio::writef(&amp;quot;A2 = %, &amp;quot;, A()),&lt;br /&gt;
        stdio::writef(&amp;quot;B2 = %&amp;quot;, B()).&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
In this case &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; comes from two different objects, which each have a count fact, so the output will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;A1 = 1, B1 = 1, A2 = 2, B2 = 2&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Technically, the class version actually doesn&amp;#039;t capture anything, it merely have access to the fact. Likewise, the object version doesn&amp;#039;t actually capture the fact, instead it captures This and through This it obtains access to the object facts.&lt;br /&gt;
&lt;br /&gt;
===== Capturing This =====&lt;br /&gt;
&lt;br /&gt;
As described above it is possible to capture &amp;lt;vp&amp;gt;This&amp;lt;/vp&amp;gt; and thereby gaining access to objects facts.  The same mechanism gives access to calling object predicates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    seq() = { () = count :- inc() }.&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    inc() :- count := count+1.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&amp;lt;vp&amp;gt;This&amp;lt;/vp&amp;gt; can also be used directly:&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    ppp() = { () = aaa::rrr(This) }.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Nesting =====&lt;br /&gt;
&lt;br /&gt;
Anonymous predicates can be nested:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    run() :-&lt;br /&gt;
        P = { (A) = { (B) = A+B } },&lt;br /&gt;
        Q = P(3300),&lt;br /&gt;
        R = P(2200),&lt;br /&gt;
        stdio::writef(&amp;quot;Q(11) = %, &amp;quot;, Q(11)),&lt;br /&gt;
        stdio::writef(&amp;quot;R(11) = %&amp;quot;, R(11)).&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
To obtain &amp;lt;vp&amp;gt;Q&amp;lt;/vp&amp;gt; we call &amp;lt;vp&amp;gt;P&amp;lt;/vp&amp;gt; with &amp;lt;vp&amp;gt;3300&amp;lt;/vp&amp;gt;, so &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is &amp;lt;vp&amp;gt;3300&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;Q&amp;lt;/vp&amp;gt; therefore becomes &amp;lt;vp&amp;gt;{ (B) = 3300+B } }&amp;lt;/vp&amp;gt;, likewise R becomes &amp;lt;vp&amp;gt;{ (B) = 2200+B } }&amp;lt;/vp&amp;gt;.  So, the output is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;Q(11) = 3311, R(11) = 2211&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Syntactic Sugar ====&lt;br /&gt;
&lt;br /&gt;
If you don&amp;#039;t need the arguments they can be skipped.  &lt;br /&gt;
So this code-fragment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;P = { (_) :- succeed },&lt;br /&gt;
Q = { (_, _) = 0 },&lt;br /&gt;
R = { (_, _, _) = _ :- fail }&lt;br /&gt;
Can be shortened down to this:&lt;br /&gt;
P = { :- succeed },&lt;br /&gt;
Q = { = 0 },&lt;br /&gt;
R = { = _ :- fail }&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the arguments are completely skipped. If you write &amp;lt;vp&amp;gt;()&amp;lt;/vp&amp;gt; it means zero arguments, whereas skipping the arguments means &amp;quot;a suitable amount&amp;quot; of arguments.&lt;br /&gt;
&lt;br /&gt;
==== Examples of practical usage ====&lt;br /&gt;
&lt;br /&gt;
This section shows some cases where anonymous predicates are very handy.  The examples assume that the PFC scopes core, std, stdio, list and string are open.&lt;br /&gt;
&lt;br /&gt;
===== Dummy predicates =====&lt;br /&gt;
&lt;br /&gt;
Anonymous predicates are good for creating dummy predicate values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ppp( { = true } ), % don&amp;#039;t filter (boolean)&lt;br /&gt;
qqq( { :- succeed } ), %  don&amp;#039;t filter (determ)&lt;br /&gt;
rrr( { = 17 } ), % all rows must have height 17&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Adaptation =====&lt;br /&gt;
&lt;br /&gt;
In cases where you need a predicate and have one that is almost suitable, you can make the adaptation using an anonymous predicate.&lt;br /&gt;
&lt;br /&gt;
===== Index adaptation =====&lt;br /&gt;
&lt;br /&gt;
Consider the predicate write3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    write3 : (function{integer, string} Indexer).&lt;br /&gt;
clauses&lt;br /&gt;
    write3(Indexer) :-&lt;br /&gt;
        foreach I = std::fromTo(0,2) do&lt;br /&gt;
            write(Indexer(I), &amp;quot;\n&amp;quot;)&lt;br /&gt;
        end foreach.&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
Indexer implements an &amp;quot;array&amp;quot; of strings, &amp;lt;vp&amp;gt;write3&amp;lt;/vp&amp;gt; will write the three strings found at the indexes &amp;lt;vp&amp;gt;0&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;2&amp;lt;/vp&amp;gt;.  So &amp;lt;vp&amp;gt;write3&amp;lt;/vp&amp;gt; assumes that the &amp;quot;array&amp;quot; index is zero-based.&lt;br /&gt;
However, the &amp;quot;array&amp;quot; we have uses a one-based index:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    myArray : (integer N) -&amp;gt; string Value.&lt;br /&gt;
clauses&lt;br /&gt;
    myArray(1) = &amp;quot;First&amp;quot; :- !.&lt;br /&gt;
    myArray(2) = &amp;quot;Second&amp;quot; :- !.&lt;br /&gt;
    myArray(3) = &amp;quot;Third&amp;quot; :- !.&lt;br /&gt;
    myArray(_) = _ :-&lt;br /&gt;
        raiseError().&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
But using an anonymous predicate we can easily adapt the one-based array to the zero-based usage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;% myArray is 0-based, write3 requires 1-based&lt;br /&gt;
Arr = { (N) = myArray(N+1) },&lt;br /&gt;
write3(Arr)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So we get the expected output:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;First&lt;br /&gt;
Second&lt;br /&gt;
Third&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Parameter adaptation =====&lt;br /&gt;
&lt;br /&gt;
In this code &amp;lt;vp&amp;gt;listChildren&amp;lt;/vp&amp;gt; will call a &amp;lt;vp&amp;gt;ChildWriter&amp;lt;/vp&amp;gt; predicate for each &amp;quot;&amp;lt;vp&amp;gt;C&amp;lt;/vp&amp;gt; is the child of &amp;lt;vp&amp;gt;P&amp;lt;/vp&amp;gt;&amp;quot;-pair:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    listChildren :&lt;br /&gt;
        (predicate{string,string} ChildWriter).&lt;br /&gt;
clauses&lt;br /&gt;
    listChildren(CW) :-&lt;br /&gt;
        CW(&amp;quot;Son1&amp;quot;, &amp;quot;Father&amp;quot;),&lt;br /&gt;
        CW(&amp;quot;Son2&amp;quot;, &amp;quot;Father&amp;quot;).&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
We will however prefer to list the &amp;quot;&amp;lt;vp&amp;gt;P&amp;lt;/vp&amp;gt; is the parent of &amp;lt;vp&amp;gt;C&amp;lt;/vp&amp;gt;&amp;quot; using the predicate &amp;lt;vp&amp;gt;wParent&amp;lt;/vp&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    wParent : (string Parent, string Child).&lt;br /&gt;
clauses&lt;br /&gt;
    wParent(P, C) :-&lt;br /&gt;
        writef(&amp;quot;% is the parent of %\n&amp;quot;, P, C).&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
&amp;lt;vp&amp;gt;wParent&amp;lt;/vp&amp;gt; takes the arguments in the opposite order, but we can easily adapt using an anonymous predicate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Swap = { (A,B) :- wParent(B,A) },&lt;br /&gt;
listChildren(Swap)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And then the out becomes the expected:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;Father is the parent of Son1&lt;br /&gt;
Father is the parent of Son2&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can also throw away arguments, for example when calling this predicate that only needs a &amp;lt;vp&amp;gt;Child&amp;lt;/vp&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    wKnowParent : (string Child).&lt;br /&gt;
clauses&lt;br /&gt;
    wKnowParent(C) :-&lt;br /&gt;
        writef(&amp;quot;We know a parent of %\n&amp;quot;, C).&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
The adaptation looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Fewer = { (C,P) :- wKnowParent(C) },&lt;br /&gt;
listChildren(Fewer)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;We know a parent of Son1&lt;br /&gt;
We know a parent of Son2&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can also supply dummy arguments:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;More = { (_,P) :- addChildren(P, 1) }&lt;br /&gt;
listChildren(More)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;vp&amp;gt;addChildren&amp;lt;/vp&amp;gt; will &amp;quot;add a count of children to &amp;lt;vp&amp;gt;P&amp;lt;/vp&amp;gt;&amp;quot;.  Since each invocation corresponds to one child we will call &amp;lt;vp&amp;gt;addChild&amp;lt;/vp&amp;gt; supplying &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt; as a &amp;quot;dummy&amp;quot; argument.  The More is thus an adaptor that both throws away an argument and supplies a dummy argument.&lt;br /&gt;
&lt;br /&gt;
===== Filters =====&lt;br /&gt;
&lt;br /&gt;
Assume this predicate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    writeFiltered : &lt;br /&gt;
        (string L, predicate_dt{integer} Filter).&lt;br /&gt;
clauses&lt;br /&gt;
    writeFiltered(Label, Filter) :-&lt;br /&gt;
        List = [1,2,3,4,5,6,7,8,9],&lt;br /&gt;
        FilteredList = filter(List, Filter),&lt;br /&gt;
        writef(&amp;quot;%\t%\n&amp;quot;, Label, FilteredList).&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
Filter is used to filter the list &amp;lt;vp&amp;gt;[1,2,3,4,5,6,7,8,9]&amp;lt;/vp&amp;gt;; the filtered list and the Label are written to the standard output.&lt;br /&gt;
&lt;br /&gt;
First we use the allow-all filter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;All = { :- succeed },&lt;br /&gt;
writeFiltered(&amp;quot;All&amp;quot;, All)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This filter simply succeeds for any element, so the output is the entire list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;All     [1,2,3,4,5,6,7,8,9]&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is just as easy to create a filter that fails for all elements and thus allow-none:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;None = { :- fail },&lt;br /&gt;
writeFiltered(&amp;quot;None&amp;quot;, None)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output from this is the empty list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;None    []&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can also create filters for elements greater than &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt; and elements dividable by &amp;lt;vp&amp;gt;3&amp;lt;/vp&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;GreaterThan3 = { (X) :- X &amp;gt; 3 },&lt;br /&gt;
writeFiltered(&amp;quot;&amp;gt; 3&amp;quot;, GreaterThan3),&lt;br /&gt;
Rem3 = { (X) :- 0 = X rem 3 },&lt;br /&gt;
writeFiltered(&amp;quot;Rem3&amp;quot;, Rem3)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output from this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&amp;gt; 3     [4,5,6,7,8,9]&lt;br /&gt;
Rem3    [3,6,9]&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Sorting =====&lt;br /&gt;
&lt;br /&gt;
The list package has a sort predicate. But sometimes the default order is not what you need.  Therefore the list package also has a predicate sortBy, which sorts the elements using a programmer defined compare operation.&lt;br /&gt;
Let us first consider string sorting, using this predicate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    writeStringsSorted :&lt;br /&gt;
        (string Label, comparator{string} Comp).&lt;br /&gt;
clauses&lt;br /&gt;
    writeStringsSorted(Label, C) :-&lt;br /&gt;
        List = [&amp;quot;John Wayne&amp;quot;, &amp;quot;Uma Thurman&amp;quot;,&lt;br /&gt;
            &amp;quot;Harrison Ford&amp;quot;, &amp;quot;Nicolas Cage&amp;quot;,&lt;br /&gt;
            &amp;quot;Elizabeth Taylor&amp;quot;, &amp;quot;Cary Grant&amp;quot;,&lt;br /&gt;
            &amp;quot;Jerry Lewis&amp;quot;, &amp;quot;Robert De Niro&amp;quot;],&lt;br /&gt;
        Sorted = sortBy(C, List),&lt;br /&gt;
        write(Label, &amp;quot;\n&amp;quot;),&lt;br /&gt;
        foreach S = list::getMember_nd(Sorted) do&lt;br /&gt;
            writef(&amp;quot;    %\n&amp;quot;, S)&lt;br /&gt;
        end foreach.&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
We can call the predicate with the &amp;quot;normal&amp;quot; comparator, and using an anonymous predicate we can easily sort it descending as well:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Normal = compare,&lt;br /&gt;
writeStringsSorted(&amp;quot;Normal&amp;quot;, Normal),&lt;br /&gt;
Descending = { (A,B) = compare(B,A) },&lt;br /&gt;
writeStringsSorted(&amp;quot;Descending&amp;quot;, Descending)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;Normal&lt;br /&gt;
    Cary Grant&lt;br /&gt;
    Elizabeth Taylor&lt;br /&gt;
    Harrison Ford&lt;br /&gt;
    Jerry Lewis&lt;br /&gt;
    John Wayne&lt;br /&gt;
    Nicolas Cage&lt;br /&gt;
    Robert De Niro&lt;br /&gt;
    Uma Thurman&lt;br /&gt;
Descending&lt;br /&gt;
    Uma Thurman&lt;br /&gt;
    Robert De Niro&lt;br /&gt;
    Nicolas Cage&lt;br /&gt;
    John Wayne&lt;br /&gt;
    Jerry Lewis&lt;br /&gt;
    Harrison Ford&lt;br /&gt;
    Elizabeth Taylor&lt;br /&gt;
    Cary Grant&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
Let us also sort some more complex elements. Here a person has a first name and a last name, using this domain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;domains&lt;br /&gt;
    person = p(string First, string Last).&amp;lt;/vip&amp;gt;&lt;br /&gt;
For the demonstration we will use this test predicate:&lt;br /&gt;
&amp;lt;vip&amp;gt;class predicates&lt;br /&gt;
    writePersonsSorted : &lt;br /&gt;
        (string Label, comparator{person} Comparator).&lt;br /&gt;
clauses&lt;br /&gt;
    writePersonsSorted(Label, C) :-&lt;br /&gt;
        List = [p(&amp;quot;John&amp;quot;,&amp;quot;Wayne&amp;quot;),&lt;br /&gt;
            p(&amp;quot;Uma&amp;quot;,&amp;quot;Thurman&amp;quot;),&lt;br /&gt;
            p(&amp;quot;Harrison&amp;quot;,&amp;quot;Ford&amp;quot;),&lt;br /&gt;
            p(&amp;quot;Nicolas&amp;quot;,&amp;quot;Cage&amp;quot;),&lt;br /&gt;
            p(&amp;quot;Elizabeth&amp;quot;,&amp;quot;Taylor&amp;quot;),&lt;br /&gt;
            p(&amp;quot;Cary&amp;quot;,&amp;quot;Grant&amp;quot;),&lt;br /&gt;
            p(&amp;quot;Jerry&amp;quot;,&amp;quot;Lewis&amp;quot;),&lt;br /&gt;
            p(&amp;quot;Robert&amp;quot;,&amp;quot;De Niro&amp;quot;)],&lt;br /&gt;
        Sorted = sortBy(C, List),&lt;br /&gt;
        write(Label, &amp;quot;\n&amp;quot;),&lt;br /&gt;
        foreach p(F,L) = list::getMember_nd(Sorted) do&lt;br /&gt;
            writef(&amp;quot;    % %\n&amp;quot;, F, L)&lt;br /&gt;
        end foreach.&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
Again we can sort using the normal and a descending comparator:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Normal = compare,&lt;br /&gt;
writePersonsSorted(&amp;quot;Normal&amp;quot;, Normal),&lt;br /&gt;
Descending = { (A,B) = compare(B,A) },&lt;br /&gt;
writePersonsSorted(&amp;quot;Descending&amp;quot;, Descending)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the compare predicate uses left-to-right lexicographic order on the &amp;lt;vp&amp;gt;p&amp;lt;/vp&amp;gt;-functor, the result is the same as before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;Normal&lt;br /&gt;
    Cary Grant&lt;br /&gt;
    Elizabeth Taylor&lt;br /&gt;
    Harrison Ford&lt;br /&gt;
    Jerry Lewis&lt;br /&gt;
    John Wayne&lt;br /&gt;
    Nicolas Cage&lt;br /&gt;
    Robert De Niro&lt;br /&gt;
    Uma Thurman&lt;br /&gt;
Descending&lt;br /&gt;
    Uma Thurman&lt;br /&gt;
    Robert De Niro&lt;br /&gt;
    Nicolas Cage&lt;br /&gt;
    John Wayne&lt;br /&gt;
    Jerry Lewis&lt;br /&gt;
    Harrison Ford&lt;br /&gt;
    Elizabeth Taylor&lt;br /&gt;
    Cary Grant&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
But with the more complex domain we can create a comparator that will sort on last name:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;LN = { (p(_,L1), p(_, L2)) = compare(L1,L2) },&lt;br /&gt;
writePersonsSorted(&amp;quot;LastName&amp;quot;, LN)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is what we expect:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;LastName&lt;br /&gt;
    Nicolas Cage&lt;br /&gt;
    Robert De Niro&lt;br /&gt;
    Harrison Ford&lt;br /&gt;
    Cary Grant&lt;br /&gt;
    Jerry Lewis&lt;br /&gt;
    Elizabeth Taylor&lt;br /&gt;
    Uma Thurman&lt;br /&gt;
    John Wayne&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Capturing context =====&lt;br /&gt;
&lt;br /&gt;
As mentioned a very powerful feature of anonymous predicates is the ability to capture context.  The examples in this section show some ways you can use this. &lt;br /&gt;
&lt;br /&gt;
===== Background threads =====&lt;br /&gt;
&lt;br /&gt;
The routine for starting a thread takes a null-ary predicate and run it in the new thread.  But you nearly always need to pass some input data to the job in the new thread.&lt;br /&gt;
This is possible in several ways, but the absolutely simplest way is to use anonymous predicates.&lt;br /&gt;
The project &amp;lt;vp&amp;gt;bgDemo&amp;lt;/vp&amp;gt; from the Visual Prolog example collection (that can be installed from the IDE) use this method.&lt;br /&gt;
The project has a form that can start background job and display status information from the job in a &amp;lt;vp&amp;gt;jobControl&amp;lt;/vp&amp;gt; that is added to the form.&lt;br /&gt;
A background job is a predicate that will receive a &amp;lt;vp&amp;gt;jobLog&amp;lt;/vp&amp;gt;, which it can use to report status and completion degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;domains&lt;br /&gt;
    job = (jobLog Log).&amp;lt;/vip&amp;gt;&lt;br /&gt;
A jobLog looks like this:&lt;br /&gt;
&amp;lt;vip&amp;gt;interface jobLog&lt;br /&gt;
&lt;br /&gt;
properties&lt;br /&gt;
    completion : real (i).&lt;br /&gt;
&lt;br /&gt;
properties&lt;br /&gt;
    status : string (i).&lt;br /&gt;
&lt;br /&gt;
end interface jobLog&amp;lt;/vip&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
The job can report completion degree by setting the completion property (range &amp;lt;vp&amp;gt;0&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;1&amp;lt;/vp&amp;gt;).  Likewise, the status property can be used to reflect the current status of the job.&lt;br /&gt;
&lt;br /&gt;
The status and completion will be shown in the form together with a job name.&lt;br /&gt;
A job is started by calling the form&amp;#039;s &amp;lt;vp&amp;gt;addJob&amp;lt;/vp&amp;gt; predicate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    addJob(JobName, Job) :-&lt;br /&gt;
        JobCtrl = jobControl::new(This),&lt;br /&gt;
        JobCtrl:name := JobName,&lt;br /&gt;
        JobCtrl:show(),&lt;br /&gt;
        assert(jobCtrl_fact(JobCtrl)),&lt;br /&gt;
        arrange(),&lt;br /&gt;
        JobLog = jobLog::new(JobCtrl),&lt;br /&gt;
        Action = { :- Job(JobLog) },&lt;br /&gt;
        _ = thread::start(Action).&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
In this context it is the last three lines that are interesting.  &amp;lt;vp&amp;gt;thread::start&amp;lt;/vp&amp;gt; takes a null-ary predicate as argument, but a job is a predicate that takes a &amp;lt;vp&amp;gt;jobLog&amp;lt;/vp&amp;gt; as argument.  Therefore we create an anonymous predicate &amp;lt;vp&amp;gt;Action&amp;lt;/vp&amp;gt;, which takes no arguments but invokes &amp;lt;vp&amp;gt;Job&amp;lt;/vp&amp;gt; on the &amp;lt;vp&amp;gt;JobLog&amp;lt;/vp&amp;gt;.  The anonymous predicate has captured both &amp;lt;vp&amp;gt;Job&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;JobLog&amp;lt;/vp&amp;gt; from the context, and subsequently both these values are transferred to the new thread even though this thread only receives a null-ary predicate.&lt;br /&gt;
The jobs in the &amp;lt;vp&amp;gt;bgDemo&amp;lt;/vp&amp;gt; project are merely dummy jobs that only manipulate their &amp;lt;vp&amp;gt;jobLog&amp;lt;/vp&amp;gt;.  One of them looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    job(Log, From, To) :-&lt;br /&gt;
        Log:status := &amp;quot;Step 1&amp;quot;,&lt;br /&gt;
        foreach N1 = std::fromTo(From, To) do&lt;br /&gt;
            Log:completion :=&lt;br /&gt;
                (N1-From) / (To-From) / 2,&lt;br /&gt;
            programControl::sleep(3)&lt;br /&gt;
        end foreach,&lt;br /&gt;
        Log:status := &amp;quot;Step 2&amp;quot;,&lt;br /&gt;
        foreach N2 = std::fromTo(From, To) do&lt;br /&gt;
            Log:completion :=&lt;br /&gt;
                (N2-From) / (To-From) / 2 + 0.5,&lt;br /&gt;
            programControl::sleep(3)&lt;br /&gt;
        end foreach,&lt;br /&gt;
        Log:status := &amp;quot;finished&amp;quot;.&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
It has two loops which run from &amp;lt;vp&amp;gt;From&amp;lt;/vp&amp;gt; to &amp;lt;vp&amp;gt;To&amp;lt;/vp&amp;gt; and calculates the completion and sets it on the &amp;lt;vp&amp;gt;Log&amp;lt;/vp&amp;gt;.  It also sets the status text before, between and after the loops.&lt;br /&gt;
You may notice that the job does not have the proper job type, because a proper job only has one argument (the &amp;lt;vp&amp;gt;jobLog&amp;lt;/vp&amp;gt;), this job has three arguments.&lt;br /&gt;
Again it is anonymous predicates that help us.  The code that adds the jobs to the form looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicates&lt;br /&gt;
    onFileNew : window::menuItemListener.&lt;br /&gt;
clauses&lt;br /&gt;
    onFileNew(_Source, _MenuTag) :-&lt;br /&gt;
        JF = jobForm::display(This),&lt;br /&gt;
        Job11 = {(L) :- job1::job(L, 1, 1000)},&lt;br /&gt;
        Job12 = {(L) :- job1::job(L, 200, 600)},&lt;br /&gt;
        Job13 = {(L) :- job1::job(L, 1200, 3000)},&lt;br /&gt;
        Job14 = {(L) :- job1::job(L, 1, 1000)},&lt;br /&gt;
        JF:addJob(&amp;quot;job1.1&amp;quot;, Job11),&lt;br /&gt;
        JF:addJob(&amp;quot;job1.2&amp;quot;, Job12),&lt;br /&gt;
        JF:addJob(&amp;quot;job1.3&amp;quot;, Job13),&lt;br /&gt;
        JF:addJob(&amp;quot;job1.4&amp;quot;, Job14),&lt;br /&gt;
        ...&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
In a more realistic program, it is most likely that &amp;lt;vp&amp;gt;From&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;To&amp;lt;/vp&amp;gt; would not be constants, but rather parameters passed from some outer place.  In that case these anonymous predicates would also capture variables from the context.&lt;br /&gt;
The &amp;lt;vp&amp;gt;jobLog&amp;lt;/vp&amp;gt; in the &amp;lt;vp&amp;gt;bgDemo&amp;lt;/vp&amp;gt; illustrates one more usage of anonymous predicates.  The &amp;lt;vp&amp;gt;jobLog&amp;lt;/vp&amp;gt; pass the completion and the status information to a &amp;lt;vp&amp;gt;jobControl&amp;lt;/vp&amp;gt;.  The &amp;lt;vp&amp;gt;jobControl&amp;lt;/vp&amp;gt; is a GUI control on the &amp;lt;vp&amp;gt;jobForm&amp;lt;/vp&amp;gt; capable of doing a suitable rendering of the information.  This however gives a synchronization problem, because GUI controls are not thread safe and here we want to update some controls from a background thread.  This can lead to conflicts, because it is the main thread that draws the controls.&lt;br /&gt;
The solution is to make transfer the the update of the control to the GUI thread.  We do this by posting actions to the control.&lt;br /&gt;
The implementation of the status update looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    status(Status) :-&lt;br /&gt;
        Action = { :- jobCtrl:status := Status },&lt;br /&gt;
        jobCtrl:postAction(Action).&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
&amp;lt;vp&amp;gt;Action&amp;lt;/vp&amp;gt; is a null-ary predicate that will set the status in the &amp;lt;vp&amp;gt;jobCtrl&amp;lt;/vp&amp;gt;.  We post this action to the &amp;lt;vp&amp;gt;jobCtrl&amp;lt;/vp&amp;gt;.  When the &amp;lt;vp&amp;gt;jobCtrl&amp;lt;/vp&amp;gt; receives the action it invokes it and is thus updated.  This way that actual update of the control will be performed by the GUI thread.&lt;br /&gt;
This anonymous predicate not only captures the &amp;lt;vp&amp;gt;Status&amp;lt;/vp&amp;gt; variable it also captures the &amp;lt;vp&amp;gt;jobCtrl&amp;lt;/vp&amp;gt; fact.&lt;br /&gt;
&lt;br /&gt;
===== Asynchronous callbacks =====&lt;br /&gt;
&lt;br /&gt;
Assume that we send commands to a remote service. The command execution is asynchronous, so when we execute a command we also give a callback action which will be invoked when the execution of the command is finished.  To execute a command we must call this predicate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicates&lt;br /&gt;
    executeCommand :&lt;br /&gt;
        (command Cmd, predicate{} OnDone).&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
Based on this predicate we want to create a similar predicate that can execute a list of commands.  A certain command should be executed when the previous command completes.&lt;br /&gt;
We will also make our list executor asynchronous, so we supply an action that will be invoked when the entire script of commands are finished.&lt;br /&gt;
Our script executer will have the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicates&lt;br /&gt;
    executeScript :&lt;br /&gt;
        (command* Script, predicate{} OnDone).&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
If the script is empty we simply invoke the &amp;lt;vp&amp;gt;OnDone&amp;lt;/vp&amp;gt; action. &lt;br /&gt;
If the script has a command &amp;lt;vp&amp;gt;H&amp;lt;/vp&amp;gt; and a rest script &amp;lt;vp&amp;gt;T&amp;lt;/vp&amp;gt;, we must first execute &amp;lt;vp&amp;gt;H&amp;lt;/vp&amp;gt;, and when it is finished we must execute the rest of the script &amp;lt;vp&amp;gt;T&amp;lt;/vp&amp;gt;.  So the &amp;lt;vp&amp;gt;OnDone&amp;lt;/vp&amp;gt; action we supply when executing &amp;lt;vp&amp;gt;H&amp;lt;/vp&amp;gt; must execute &amp;lt;vp&amp;gt;T&amp;lt;/vp&amp;gt;.&lt;br /&gt;
All in all, the implementation can look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    executeScript([], OnDone) :-&lt;br /&gt;
        OnDone().&lt;br /&gt;
    executeScript([H|T], OnDone) :-&lt;br /&gt;
        DoneH = { :- executeScript(T, OnDone) },&lt;br /&gt;
        executeCommand(H, DoneH).&amp;lt;/vip&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
We have used an anonymous predicate to perform the execution of the rest of the script.  This anonymous predicate captures &amp;lt;vp&amp;gt;T&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;OnDone&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{LanguageReferenceSubarticle|Terms/Anonymous Predicates}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Lexical_Elements&amp;diff=3973</id>
		<title>Language Reference/Lexical Elements</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Lexical_Elements&amp;diff=3973"/>
		<updated>2014-10-22T08:45:47Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: &amp;quot; -&amp;gt; &amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{languageReferenceNavbar|Lexical Elements}}&lt;br /&gt;
&lt;br /&gt;
The Visual Prolog Compiler is applied to a source file.  This source file may include other source files, which are (conceptually) inserted into the original source file to constitute one &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;compilation unit&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;. The compilation of a compilation unit is done in two conceptual steps:&lt;br /&gt;
*first the input is transformed into a sequence of tokens; &lt;br /&gt;
*and then these tokens are syntactically analyzed and transformed into executable code.&lt;br /&gt;
&lt;br /&gt;
The lexical analysis of the program will break the compilation unit &amp;lt;vpbnf&amp;gt;&amp;lt;CompilationUnit&amp;gt;&amp;lt;/vpbnf&amp;gt; into a list of input elements &amp;lt;vpbnf&amp;gt;&amp;lt;InputElement&amp;gt;&amp;lt;/vpbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;CompilationUnit&amp;gt;:&lt;br /&gt;
   &amp;lt;InputElement&amp;gt;-list&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;InputElement&amp;gt;:&lt;br /&gt;
   &amp;lt;Comment&amp;gt;&lt;br /&gt;
   &amp;lt;WhiteSpace&amp;gt;&lt;br /&gt;
   &amp;lt;Token&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only tokens are significant to the subsequent syntax analysis.&lt;br /&gt;
&lt;br /&gt;
=== Comments ===&lt;br /&gt;
&lt;br /&gt;
A Visual Prolog comment is written in one of the following ways:&lt;br /&gt;
*The &amp;lt;vpbnf&amp;gt;/*&amp;lt;/vpbnf&amp;gt; (slash, asterisk) characters, followed by any sequence of characters (including new lines), terminated by the &amp;lt;vpbnf&amp;gt;*/&amp;lt;/vpbnf&amp;gt; (asterisk, slash) characters. These comments can be multi-lined. They can also be nested.&lt;br /&gt;
*The &amp;lt;vpbnf&amp;gt;%&amp;lt;/vpbnf&amp;gt; (percent sign) character, followed by any sequence of characters. Comments that begin with character &amp;lt;vpbnf&amp;gt;%&amp;lt;/vpbnf&amp;gt; (percent sign) continue until the end of the line. Therefore, they are commonly called &amp;#039;&amp;#039;single-line comments&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Notice the following comment example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: #AA77BD&amp;quot;&amp;gt;/* Begin of Comment1&lt;br /&gt;
   % Nested Comment2 */ Comment 1 is not terminated (single-line comment)&lt;br /&gt;
   This is the real termination of Comment1 */&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Whitespace ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;WhiteSpace&amp;gt;:&lt;br /&gt;
   &amp;lt;Space&amp;gt;&lt;br /&gt;
   &amp;lt;Tab&amp;gt;&lt;br /&gt;
   &amp;lt;NewLine&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;vpbnf&amp;gt;&amp;lt;Space&amp;gt;&amp;lt;/vpbnf&amp;gt; is a space character, &amp;lt;vpbnf&amp;gt;&amp;lt;Tab&amp;gt;&amp;lt;/vpbnf&amp;gt; is a tabulation character and &amp;lt;vpbnf&amp;gt;&amp;lt;NewLine&amp;gt;&amp;lt;/vpbnf&amp;gt; is a new line character.&lt;br /&gt;
&lt;br /&gt;
=== Tokens ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Token&amp;gt;:&lt;br /&gt;
   &amp;lt;Identifier&amp;gt;&lt;br /&gt;
   &amp;lt;Keyword&amp;gt;&lt;br /&gt;
   &amp;lt;Punctuator&amp;gt;&lt;br /&gt;
   &amp;lt;Operator&amp;gt;&lt;br /&gt;
   &amp;lt;Literal&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
==== Identifiers ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Identifier&amp;gt;:&lt;br /&gt;
   &amp;lt;LowercaseIdentifier&amp;gt;&lt;br /&gt;
   &amp;lt;UppercaseIdentifier&amp;gt;&lt;br /&gt;
   &amp;lt;AnonymousIdentifier&amp;gt;&lt;br /&gt;
   &amp;lt;Ellipsis&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;vpbnf&amp;gt;&amp;lt;LowercaseIdentifier&amp;gt;&amp;lt;/vpbnf&amp;gt; is a sequence of letters, digits, and underscores that starts with a small letter. An &amp;lt;vpbnf&amp;gt;&amp;lt;UppercaseIdentifier&amp;gt;&amp;lt;/vpbnf&amp;gt; is a sequence of letters, digits, and underscores that starts either with a capital letter or with an underscore.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;AnonymousIdentifier&amp;gt; :    _&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Ellipsis&amp;gt; :&lt;br /&gt;
   ...&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Keywords ====&lt;br /&gt;
&lt;br /&gt;
Keywords are divided into major and minor keywords, this division is only cosmetic however, there is no formal difference between major and minor keywords.  In the sequel we will however use different coloring for them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Keyword&amp;gt; :&lt;br /&gt;
   &amp;lt;MajorKeyword&amp;gt;&lt;br /&gt;
   &amp;lt;MinorKeyword&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;MajorKeyword&amp;gt; : one of&lt;br /&gt;
   class clauses constants constructors&lt;br /&gt;
   delegate domains&lt;br /&gt;
   end&lt;br /&gt;
   facts&lt;br /&gt;
   goal&lt;br /&gt;
   implement inherits interface&lt;br /&gt;
   monitor&lt;br /&gt;
   namespace&lt;br /&gt;
   open&lt;br /&gt;
   predicates&lt;br /&gt;
   properties&lt;br /&gt;
   resolve&lt;br /&gt;
   supports&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;MinorKeyword&amp;gt; : one of&lt;br /&gt;
   align and anyflow as &lt;br /&gt;
   bitsize&lt;br /&gt;
   catch&lt;br /&gt;
   determ digits div do&lt;br /&gt;
   else elseif  erroneous externally&lt;br /&gt;
   failure finally foreach from&lt;br /&gt;
   guard&lt;br /&gt;
   if in &lt;br /&gt;
   language&lt;br /&gt;
   mod multi&lt;br /&gt;
   nondeterm&lt;br /&gt;
   or orelse&lt;br /&gt;
   procedure&lt;br /&gt;
   quot&lt;br /&gt;
   rem&lt;br /&gt;
   single&lt;br /&gt;
   then to try&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All keywords except &amp;lt;vp&amp;gt;as&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;language&amp;lt;/vp&amp;gt; are reserved words.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;end&amp;lt;/vp&amp;gt; is always combined with another key word:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;end class&lt;br /&gt;
end implement&lt;br /&gt;
end interface&lt;br /&gt;
end if&lt;br /&gt;
end foreach&lt;br /&gt;
end try&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Punctuation Marks ====&lt;br /&gt;
&lt;br /&gt;
Punctuation marks in Visual Prolog have syntactic and semantic meaning to the compiler, but do not specify by themselves an operation that yields a value. Some punctuation marks, either alone or in combinations, can also be Visual Prolog operators.&lt;br /&gt;
&lt;br /&gt;
Punctuation marks are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;PunctuationMarks&amp;gt;: one of&lt;br /&gt;
   ;    !    ,    .    #    [    ]    |    (    )    {    }    :-    :    ::&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Operators ====&lt;br /&gt;
&lt;br /&gt;
{{lang2|Terms|Operators|Operators}} specify an evaluation to be performed on involved operands.&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Operators&amp;gt;: one of&lt;br /&gt;
   ^&lt;br /&gt;
   /    *  div mod quot rem&lt;br /&gt;
   +    -&lt;br /&gt;
   =    &amp;lt;    &amp;gt;    &amp;lt;&amp;gt;    &amp;gt;&amp;lt;    &amp;lt;=    &amp;gt;=    :=&lt;br /&gt;
&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All operators are {{lang2|Terms|Operators|binary}}, but &amp;lt;vp&amp;gt;-&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;+&amp;lt;/vp&amp;gt; also exist as {{lang2|Terms|Operators|unary}} operators.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;div&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;mod&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;quot&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;rem&amp;lt;/vp&amp;gt; are reserved words.&lt;br /&gt;
&lt;br /&gt;
===  Literals ===&lt;br /&gt;
&lt;br /&gt;
Literals fall into following categories: integer, character, floating-point, string, binary and list.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Literal&amp;gt;:&lt;br /&gt;
   &amp;lt;IntegerLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;RealLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;CharacterLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;StringLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;BinaryLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;ListLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;CompoundDomainLiteral&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Integral Literals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;IntegerLiteral&amp;gt;:&lt;br /&gt;
   &amp;lt;UnaryPlus&amp;gt;-opt    &amp;lt;DecimalDigit&amp;gt;-list&lt;br /&gt;
   &amp;lt;UnaryMinus&amp;gt;-opt   &amp;lt;DecimalDigit&amp;gt;-list&lt;br /&gt;
   &amp;lt;UnaryPlus&amp;gt;-opt    &amp;lt;OctalPrefix&amp;gt; &amp;lt;OctalDigit&amp;gt;-list&lt;br /&gt;
   &amp;lt;UnaryMinus&amp;gt;-opt   &amp;lt;OctalPrefix&amp;gt; &amp;lt;OctalDigit&amp;gt;-list&lt;br /&gt;
   &amp;lt;UnaryPlus&amp;gt;-opt    &amp;lt;HexadecimalPrefix&amp;gt; &amp;lt;HexadecimalDigit&amp;gt;-list&lt;br /&gt;
   &amp;lt;UnaryMinus&amp;gt;-opt   &amp;lt;HexadecimalPrefix&amp;gt; &amp;lt;HexadecimalDigit&amp;gt;-list&lt;br /&gt;
&lt;br /&gt;
&amp;lt;UnaryPlus&amp;gt;:&lt;br /&gt;
   +&lt;br /&gt;
&lt;br /&gt;
&amp;lt;UnaryMinus&amp;gt;:&lt;br /&gt;
   -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;OctalPrefix&amp;gt;:&lt;br /&gt;
   0o&lt;br /&gt;
&lt;br /&gt;
&amp;lt;OctalDigit&amp;gt;: one of&lt;br /&gt;
   0 1 2 3 4 5 6 7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;DecimalDigit&amp;gt;: one of&lt;br /&gt;
   0 1 2 3 4 5 6 7 8 9&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HexadecimalPrefix&amp;gt;:&lt;br /&gt;
   0x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HexadecimalDigit&amp;gt;: one of&lt;br /&gt;
   0 1 2 3 4 5 6 7 8 9 A a B b C c D d E e F f&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An integral literal can belong to {{lang2|Built-in_entities|integer|integer}} or {{lang2|Built-in_entities|unsigned|unsigned}} domains and it should not exceed maximum and minimum {{lang2|Built-in_entities|integer|integer}} or {{lang2|Built-in_entities|unsigned|unsigned}} values.&lt;br /&gt;
&lt;br /&gt;
==== Real Literal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;RealLiteral&amp;gt;:&lt;br /&gt;
   &amp;lt;UnaryMinus&amp;gt;-opt &amp;lt;DecimalDigit&amp;gt;-list &amp;lt;FractionOfFloat&amp;gt;-opt &amp;lt;Exponent&amp;gt;-opt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;FractionOfFloat&amp;gt;:&lt;br /&gt;
   . &amp;lt;DecimalDigit&amp;gt;-list&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Exponent&amp;gt;:&lt;br /&gt;
   &amp;lt;ExponentSymbol&amp;gt; &amp;lt;ExponentSign&amp;gt;-opt &amp;lt;DecimalDigit&amp;gt;-list&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ExponentSymbol&amp;gt;: one of&lt;br /&gt;
   e E&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ExponentSign&amp;gt;: one of&lt;br /&gt;
   - +&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A floating literal should not exceed maximum and minimum real values.&lt;br /&gt;
&lt;br /&gt;
==== Character Literals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;CharacterLiteral&amp;gt;:&lt;br /&gt;
   &amp;#039; &amp;lt;CharacterValue&amp;gt; &amp;#039;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vpbnf&amp;gt;&amp;lt;CharacterValue&amp;gt;&amp;lt;/vpbnf&amp;gt; can be any printable character or an escape sequence:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;vpbnf&amp;gt;\\&amp;lt;/vpbnf&amp;gt; representing &amp;lt;vp&amp;gt;\&amp;lt;/vp&amp;gt; &lt;br /&gt;
*&amp;lt;vp&amp;gt;\t&amp;lt;/vp&amp;gt; representing Tab character&lt;br /&gt;
*&amp;lt;vp&amp;gt;\n&amp;lt;/vp&amp;gt; representing New Line character&lt;br /&gt;
*&amp;lt;vp&amp;gt;\r&amp;lt;/vp&amp;gt; representing carriage return&lt;br /&gt;
*&amp;lt;vp&amp;gt;\&amp;#039;&amp;lt;/vp&amp;gt; representing single quote&lt;br /&gt;
*&amp;lt;vp&amp;gt;\&amp;quot;&amp;lt;/vp&amp;gt; representing double quote&lt;br /&gt;
*&amp;lt;vp&amp;gt;\u&amp;lt;/vp&amp;gt;&amp;lt;vpbnf&amp;gt;&amp;lt;XXXX&amp;gt;&amp;lt;/vpbnf&amp;gt;, here &amp;lt;vpbnf&amp;gt;&amp;lt;XXXX&amp;gt;&amp;lt;/vpbnf&amp;gt; should be exactly four &amp;lt;vpbnf&amp;gt;&amp;lt;HexadecimalDigit&amp;gt;&amp;lt;/vpbnf&amp;gt;&amp;#039;s representing the Unicode character corresponding to the digits.&lt;br /&gt;
&lt;br /&gt;
==== String Literals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;StringLiteral&amp;gt;:&lt;br /&gt;
   &amp;lt;StringLiteralPart&amp;gt;-list&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;StringLiteralPart&amp;gt;:&lt;br /&gt;
   &amp;#039; &amp;lt;CharacterValue&amp;gt;-list-opt &amp;#039;&lt;br /&gt;
   &amp;quot; &amp;lt;CharacterValue&amp;gt;-list-opt &amp;quot;&lt;br /&gt;
   @&amp;lt;AtOpenChar&amp;gt; &amp;lt;AnyCharacter&amp;gt;-list-opt &amp;lt;AtCloseChar&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A string literal consists of one or more &amp;lt;vpbnf&amp;gt;&amp;lt;StringLiteralPart&amp;gt;&amp;lt;/vpbnf&amp;gt;&amp;#039;s, which are concatenated.&lt;br /&gt;
&lt;br /&gt;
The first two forms (the &amp;#039; and &amp;quot; forms) uses escape sequences to express certain characters&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;vp&amp;gt;\\&amp;lt;/vp&amp;gt; representing &amp;lt;vp&amp;gt;\&amp;lt;/vp&amp;gt;&lt;br /&gt;
*&amp;lt;vp&amp;gt;\t&amp;lt;/vp&amp;gt; representing Tab character&lt;br /&gt;
*&amp;lt;vp&amp;gt;\n&amp;lt;/vp&amp;gt; representing New Line character&lt;br /&gt;
*&amp;lt;vp&amp;gt;\r&amp;lt;/vp&amp;gt; representing carriage return&lt;br /&gt;
*&amp;lt;vp&amp;gt;\&amp;lt;/vp&amp;gt;&amp;lt;vp&amp;gt;&amp;quot;&amp;lt;/vp&amp;gt; representing double quote&lt;br /&gt;
*&amp;lt;vp&amp;gt;\&amp;lt;/vp&amp;gt;&amp;lt;vp&amp;gt;&amp;#039;&amp;lt;/vp&amp;gt; representing single quote&lt;br /&gt;
*&amp;lt;vp&amp;gt;\u&amp;lt;/vp&amp;gt;&amp;lt;vpbnf&amp;gt;&amp;lt;XXXX&amp;gt;&amp;lt;/vpbnf&amp;gt;, here &amp;lt;vpbnf&amp;gt;&amp;lt;XXXX&amp;gt;&amp;lt;/vpbnf&amp;gt; should be exactly four &amp;lt;vpbnf&amp;gt;&amp;lt;HexadecimalDigit&amp;gt;&amp;lt;/vpbnf&amp;gt;&amp;#039;s representing the Unicode character corresponding to the digits.&lt;br /&gt;
&lt;br /&gt;
In single quoted strings it is optional to escape double quotes, and likewise it is optional to escape single quotes in double quoted strings.&lt;br /&gt;
&lt;br /&gt;
Single quoted strings must contain at least two characters otherwise they will be assumed to be a character literal.&lt;br /&gt;
&lt;br /&gt;
The @-literals can be used to avoid obscuring the string literals with escape characters.  The literals starts with @ followed by some non-letter  character &amp;lt;vpbnf&amp;gt;&amp;lt;AtOpenChar&amp;gt;&amp;lt;/vpbnf&amp;gt;.  And it terminates when the close character &amp;lt;vpbnf&amp;gt;&amp;lt;AtCloseChar&amp;gt;&amp;lt;/vpbnf&amp;gt; is met.  For most characters the close character is the same as the opening character, but for diverse paranthesis charactes the close character is the corresponding opposite paranthesis.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; rules=&amp;quot;all&amp;quot; style=&amp;quot;border:solid 1px #AAAAAA; border-collapse:collapse; empty-cells:show; text-align: center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Open&lt;br /&gt;
| Close&lt;br /&gt;
| Open&lt;br /&gt;
| Close&lt;br /&gt;
|-&lt;br /&gt;
| @(&lt;br /&gt;
| )&lt;br /&gt;
| @)&lt;br /&gt;
| (&lt;br /&gt;
|-&lt;br /&gt;
| @[&lt;br /&gt;
| ]&lt;br /&gt;
| @]&lt;br /&gt;
| [&lt;br /&gt;
|-&lt;br /&gt;
| @{&lt;br /&gt;
| }&lt;br /&gt;
| @}&lt;br /&gt;
| {&lt;br /&gt;
|-&lt;br /&gt;
| @&amp;lt;&lt;br /&gt;
| &amp;gt;&lt;br /&gt;
| @&amp;gt;&lt;br /&gt;
| &amp;lt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For all non-paranthesis opening character the close character is the same as the open character, for example @&amp;quot; is closed by &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For all @-strings it is the case the twice the closing character does not close the string, but means one occurence of the closing character in the string.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
This example uses @[ as opening and ] as closing, inside the string literal both &amp;quot; and &amp;#039; can be used unescaped:&lt;br /&gt;
[[Image:AtString.png]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Binary Literals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;BinaryLiteral&amp;gt;:&lt;br /&gt;
   $[ &amp;lt;ElementValue&amp;gt;-comma-sep-list-opt ]&lt;br /&gt;
&amp;lt;ElementValue&amp;gt;:&lt;br /&gt;
   &amp;lt;IntegerLiteral&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vpbnf&amp;gt;&amp;lt;ElementValue&amp;gt;&amp;lt;/vpbnf&amp;gt; should be any integral arithmetic expression (for example, constant), which should be calculated while compilation-time and be in the range from &amp;lt;vp&amp;gt;0&amp;lt;/vp&amp;gt; till &amp;lt;vp&amp;gt;255.&amp;lt;/vp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== List Literals ====&lt;br /&gt;
&lt;br /&gt;
All elements in a list literal must belong to the same domain (or to compatible domains). This domain can be any {{lang2|Built-in_entities|Domains|built-in}} or {{lang|Domains|user defined domain}}, for example, it can be {{lang2|Lexical_Elements|Integral_Literals|integral}}, {{lang2|Lexical_Elements|Character_Literals|character}}, {{lang2|Lexical_Elements|Binary_Literals|binary}}, {{lang2|Lexical_Elements|Compound_Domain_Literals|compound domain}}, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;ListLiteral&amp;gt;:&lt;br /&gt;
   [ &amp;lt;SimpleLiteral&amp;gt;-comma-sep-list-opt ]&lt;br /&gt;
   [ &amp;lt;SimpleLiteral&amp;gt;-comma-sep-list | &amp;lt;ListLiteral&amp;gt; ]&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;vpbnf&amp;gt;&amp;lt;SimpleLiteral&amp;gt;&amp;lt;/vpbnf&amp;gt; can be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;SimpleLiteral&amp;gt;:&lt;br /&gt;
   &amp;lt;IntegerLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;RealLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;CharacterLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;StringLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;BinaryLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;ListLiteral&amp;gt;&lt;br /&gt;
   &amp;lt;CompoundDomainLiteral&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Example| These are all valid list literals:&lt;br /&gt;
&amp;lt;vip&amp;gt;&lt;br /&gt;
[]                    % empty list&lt;br /&gt;
[1,2,3]               % list of integers&lt;br /&gt;
[&amp;quot;abc&amp;quot;, &amp;quot;defg&amp;quot;]       % list of strings&amp;lt;/vip&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Example| This is invalid because the elements in a list must all have same type:&lt;br /&gt;
&amp;lt;vip&amp;gt;&lt;br /&gt;
[1,&amp;quot;abc&amp;quot;]             % this is INVALID list&amp;lt;/vip&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Compound Domain Literals ====&lt;br /&gt;
&lt;br /&gt;
Terms of {{lang2|Domains|Compound_Domains|user defined compound}} domains can be treated as literals if all their arguments are literals.&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Predicates&amp;diff=3909</id>
		<title>Language Reference/Built-in entities/Predicates</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Predicates&amp;diff=3909"/>
		<updated>2014-06-24T11:31:04Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: try-catch-finally&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;__NOTOC__&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#and_.28.2C.29|and/2]] &amp;lt;br&amp;gt; [[Language_Reference/Terms#and_.28.2C.29|,/2]]&lt;br /&gt;
|Term &amp;quot;and&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[#assert|assert/1]]&lt;br /&gt;
|Insert the specified fact at the end of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#asserta|asserta/1]]&lt;br /&gt;
|Insert a fact at the beginning of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#assertz|assertz/1]]&lt;br /&gt;
|Insert a fact at the end of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#bound|bound/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Test whether the specified variable is bound to a value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#class_name|class_name/0-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;ClassName&amp;#039;&amp;#039; that represents the name of the current interface or class.&lt;br /&gt;
|-&lt;br /&gt;
|[[#compare|compare/2-&amp;gt;]]&lt;br /&gt;
|Returns the result of the variables&amp;#039; comparison.&lt;br /&gt;
|-&lt;br /&gt;
|[[#convert|convert/2-&amp;gt;]]&lt;br /&gt;
|Checked term conversion.&lt;br /&gt;
|-&lt;br /&gt;
|[[#digitsOf|digitsOf/1-&amp;gt;]]&lt;br /&gt;
|Returns precision of the specified floating-point domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#errorExit|errorExit/1]] &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Performs a run-time error with the specified return code &amp;#039;&amp;#039;ErrorNumber&amp;#039;&amp;#039; and sets the internal error information.&lt;br /&gt;
|-&lt;br /&gt;
|[[#fail|fail/0]] &amp;lt;vp&amp;gt;failure&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Invoke backtracking.&lt;br /&gt;
|-&lt;br /&gt;
|[[#free|free/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Check whether a variable is free.&lt;br /&gt;
|-&lt;br /&gt;
|[[#fromEllipsis|fromEllipsis/1-&amp;gt;]]&lt;br /&gt;
|Creates the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; from the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#hasDomain|hasDomain/2]] &amp;lt;br&amp;gt; [[#hasDomain|hasDomain/2-&amp;gt;]]&lt;br /&gt;
|Declares/restricts the type of a variable or value.&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#in|in/2]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt; &amp;lt;br&amp;gt; [[Language_Reference/Terms#in|in/2]] &amp;lt;vp&amp;gt;nondeterm&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Infix operator &amp;quot;in&amp;quot; (in-test and in-iterator).&lt;br /&gt;
|-&lt;br /&gt;
|[[#isErroneous|isErroneous/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Returns the lower bound value of the specified numeric domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#lowerBound|lowerBound/1-&amp;gt;]]&lt;br /&gt;
|Returns the lower bound value of the specified numeric domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#maxDigits|maxDigits/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the value of digits (precision) of the basic domain corresponding to the specified floating-point domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#not|not/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Negate the result (success/fail) of subgoal.&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#or_.28.3B.29|or/2]] &amp;lt;br&amp;gt; [[Language_Reference/Terms#and_.28.3B.29|;/2]]&lt;br /&gt;
|Nondeterministic term &amp;quot;or&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[Language_Reference/Terms#orelse|orelse]]&lt;br /&gt;
|Deterministic term &amp;quot;or&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[#predicate_fullname|predicate_fullname/1-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;PredicateFullName&amp;#039;&amp;#039; that represent the name of the predicate in which clause body &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; is called. The returned predicate name is qualified with a scope name.&lt;br /&gt;
|-&lt;br /&gt;
|[[#predicate_name|predicate_name/1-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;PredicateName&amp;#039;&amp;#039; that represent the name of the predicate in which clause body &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; is called. The returned predicate name is not qualified with a scope name.&lt;br /&gt;
|-&lt;br /&gt;
|[[#programPoint|programPoint/0-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the &amp;lt;vp&amp;gt;programPoint&amp;lt;/vp&amp;gt; corresponding to the place where it is called.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retract|retract/1]] &amp;lt;vp&amp;gt;nondeterm&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Remove a matched fact from the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retractall|retractall/1]]&lt;br /&gt;
|Remove all matching facts from the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retractFactDb|retractFactDb/1]]&lt;br /&gt;
|Remove all facts from the specified named internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeBitsOf|sizeBitsOf/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bits occupied in memory by an entity of the specified domain &amp;#039;&amp;#039;DomainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeOf|sizeOf/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bytes occupied in memory by the specified term.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeOfDomain|sizeOfDomain/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bytes occupied in memory by the entity of the specified domain &amp;#039;&amp;#039;DomainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_lineno|sourcefile_lineno/0-&amp;gt;]]&lt;br /&gt;
|Returns the current line number in the source file processed by the compiler .&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_name|sourcefile_name/0-&amp;gt;]]&lt;br /&gt;
|Returns the name of the source file processed by the compiler.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_timestamp|sourcefile_timestamp/0-&amp;gt;]]&lt;br /&gt;
|Returns the string representing the date and time of the source file processed by the compiler.&lt;br /&gt;
|-&lt;br /&gt;
|[[#succeed|succeed/0]]&lt;br /&gt;
|The predicate &amp;lt;vp&amp;gt;succeed/0&amp;lt;/vp&amp;gt; will always succeed.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toAny|toAny/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; to the value of the universal term type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toBinary|toBinary/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified Term to the binary representation.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toBoolean|toBoolean/1-&amp;gt;]]&lt;br /&gt;
|The purpose of this meta-predicate is to convert the deterministic call (to a predicate or fact) to the procedure that returns the value of &amp;lt;vp&amp;gt;boolean&amp;lt;/vp&amp;gt; domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toEllipsis|toEllipsis/1-&amp;gt;]]&lt;br /&gt;
|Creates the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; from the list of &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; type values.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toString|toString/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; to the string representation.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toTerm|toTerm/1-&amp;gt;]] &amp;lt;br&amp;gt; [[#toTerm|toTerm/2-&amp;gt;]]&lt;br /&gt;
|Converts the string/binary representation of the specified term &amp;#039;&amp;#039;SrcTerm&amp;#039;&amp;#039; into representation corresponding to the domain of &amp;#039;&amp;#039;PrologTerm&amp;#039;&amp;#039; variable of the return value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#tryToTerm|tryToTerm/1-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt; &amp;lt;br&amp;gt; [[#tryToTerm|tryToTerm/2-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Converts the string/binary representation of the specified term &amp;#039;&amp;#039;SrcTerm&amp;#039;&amp;#039; into representation corresponding to the domain of &amp;#039;&amp;#039;PrologTerm&amp;#039;&amp;#039; variable of the return value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#tryConvert|tryConvert/2-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Checks whether the input term &amp;#039;&amp;#039;InputTerm&amp;#039;&amp;#039; can be strictly converted into the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; and returns the converted term &amp;#039;&amp;#039;ReturnTerm&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]]&lt;br /&gt;
|Unchecked conversion of domains.&lt;br /&gt;
|-&lt;br /&gt;
|[[#upperBound|upperBound/1-&amp;gt;]]&lt;br /&gt;
|Returns the upper bound value of the specified numeric domain.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following predicates are deprecated:&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
| finally/2&lt;br /&gt;
| Use [[Language_Reference/Terms#try-finally| &amp;lt;vp&amp;gt;try-finally&amp;lt;/vp&amp;gt;]] constuction instead.&lt;br /&gt;
|-&lt;br /&gt;
| findall/3&lt;br /&gt;
| Use list comprehension [[Language_Reference/Terms#List_Comprehension| &amp;lt;vp&amp;gt;[ ... || ...  ]&amp;lt;/vp&amp;gt;]] instead&lt;br /&gt;
|-&lt;br /&gt;
| trap/3 &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
| Use [[Language_Reference/Terms#try-catch| &amp;lt;vp&amp;gt;try-catch&amp;lt;/vp&amp;gt;]] constuction instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== and ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#and_.28.2C.29|and (,)]].&lt;br /&gt;
&lt;br /&gt;
==== assert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;assert : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert the specified fact at the end of the matched internal facts database&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;assert(Fact)&amp;lt;/vp&amp;gt; inserts &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; in the matched internal facts database after any other stored facts for the corresponding database predicate. &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; must be a term belonging to the domain of an internal facts database. &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; applied to a single fact changes the existing instance of a fact to the specified one. &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; has the same effect as [[#assertz|assertz/1]]. See also [[#asserta|asserta/1]].&lt;br /&gt;
&lt;br /&gt;
Notice that the combination of [[#retract|retract/1]] and &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; like the following can lead to endless loop:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;loop() :-&lt;br /&gt;
  retract(fct(X)),&lt;br /&gt;
     ...           % creating Y from X&lt;br /&gt;
     assert(fct(Y)),&lt;br /&gt;
  fail.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem is that the retract in first line will eventually retract the fact asserted in the last line, because that fact is inserted &amp;#039;&amp;#039;last&amp;#039;&amp;#039; in the fact chain.&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Attempt to assert a second instance to a fact declared as determ.&lt;br /&gt;
&lt;br /&gt;
==== asserta ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;asserta : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert a fact at the beginning of the matched internal facts database.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;asserta(Fact)&amp;lt;/vp&amp;gt; predicate inserts a &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; in the matched internal facts database before any other stored facts for the corresponding predicate. The &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; must be a term belonging to the domain of an internal facts database. The &amp;lt;vp&amp;gt;asserta/1&amp;lt;/vp&amp;gt; applied to a single fact changes the existing instance of a fact to the specified one. See also [[#assert|assert/1]] and [[#assertz|assertz/1]].&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Attempt to a fact declared as determ, but the fact instance already exists.&lt;br /&gt;
&lt;br /&gt;
==== assertz ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;assertz : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;assertz&amp;lt;/vp&amp;gt; does exactly the same as the [[#assert|assert/1]] predicate.&lt;br /&gt;
&lt;br /&gt;
==== bound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;bound : (&amp;lt;variable&amp;gt; Variable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test whether the specified variable is bound to a value.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;bound(Variable)&amp;lt;/vp&amp;gt; succeeds if &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is bound and fails if it is free. The &amp;lt;vp&amp;gt;bound&amp;lt;/vp&amp;gt; predicate is used to control flow patterns and to check the binding of reference variables. The &amp;lt;vp&amp;gt;bound&amp;lt;/vp&amp;gt; predicate treats the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; as bound if any of it&amp;#039;s part is instantiated.&lt;br /&gt;
&lt;br /&gt;
See also [[#free|free/1]].&lt;br /&gt;
&lt;br /&gt;
==== class_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class_Name : () -&amp;gt; string ClassName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compile time predicate returns the string &amp;lt;vp&amp;gt;ClassName&amp;lt;/vp&amp;gt; that represents the name of the current interface or class.&lt;br /&gt;
&lt;br /&gt;
==== compare ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;compare : (A Left, A Right) -&amp;gt; compareResult CompareResult.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comparison of two terms of the same domain, resturns the value of [[#compareResult|compareResult]] domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;CompareResult&amp;lt;/vp&amp;gt; = compare(&amp;quot;&amp;lt;vp&amp;gt;bar&amp;lt;/vp&amp;gt;&amp;quot;, &amp;quot;&amp;lt;vp&amp;gt;foo&amp;lt;/vp&amp;gt;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== convert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;convert : (&amp;lt;type&amp;gt; Type, Term) -&amp;gt; &amp;lt;type&amp;gt; Converted.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checked term conversion.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; = convert(returnDomain, &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;returnDomain&amp;lt;/vpbnf&amp;gt;: Specifies a domain to which function &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; converts &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be a name of built-in Visual Prolog domain, an interface domain, a name of such user defined domain that is synonym to one of built-in Visual Prolog domains, a numeric domain, binary and pointer domains. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the value that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; is an expression, then it will be evaluated before the conversion.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned parameter &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; type.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;convert&amp;lt;/vp&amp;gt; predicate performs a clean and genuine conversion of the given &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;, returning a new term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; of the specified new domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;. If &amp;lt;vp&amp;gt;convert&amp;lt;/vp&amp;gt; cannot perform the required conversion, it rises errors. The similar functionality is provided by the [[#tryConvert|tryConvert/2-&amp;gt;]] predicate, but &amp;lt;vp&amp;gt;tryConvert-&amp;gt;&amp;lt;/vp&amp;gt; fails and does not produce any runtime errors if it cannot perform the conversion.&lt;br /&gt;
&lt;br /&gt;
===== Allowed conversions =====&lt;br /&gt;
&lt;br /&gt;
* Between numerical domains.&lt;br /&gt;
* Between interface types.&lt;br /&gt;
* Between [[#string|string]] and [[#symbol|symbol]] domains.&lt;br /&gt;
* From [[#binary|binary]] to [[#pointer|pointer]].&lt;br /&gt;
* For synonyms of mentioned domains.&lt;br /&gt;
* Between [http://wiki.visual-prolog.com/index.php?title=How_To_Remove_Reference_Domains_from_a_Project reference] domains and corresponding non-reference domains.&lt;br /&gt;
&lt;br /&gt;
The contrast to these is [[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]] predicate, which performs an unchecked conversion between terms from any domains, which have the same bit-size.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; (or [[#tryConvert|tryConvert/2-&amp;gt;]]) predicate accomplishes a checked explicit conversion, when the source and target domains are statically known during the compilation. The result of an explicit conversion can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ok&amp;#039;&amp;#039;&amp;#039; the successful conversion to the target domain;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;run-time-check&amp;#039;&amp;#039;&amp;#039; the conversion to the target domain with generation of run-time checking for compatibility;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;error&amp;#039;&amp;#039;&amp;#039; the conversion is impossible, error output.&lt;br /&gt;
&lt;br /&gt;
===== Rules of Checked Explicit Conversions =====&lt;br /&gt;
&lt;br /&gt;
* Synonyms of domains are converted using the same rules that are applied to the domains themselves.&lt;br /&gt;
* Numerical domains can be converted to the numerical domains only.&lt;br /&gt;
* Integral constants are the representatives of the anonymous integral domain: &amp;lt;vp&amp;gt;[const .. const]&amp;lt;/vp&amp;gt;.&lt;br /&gt;
* Real constants are the representatives of the anonymous real domain: &amp;lt;vp&amp;gt;digits&amp;lt;/vp&amp;gt; &amp;lt;vp&amp;gt;dig [const .. const]&amp;lt;/vp&amp;gt;, where &amp;lt;vp&amp;gt;dig&amp;lt;/vp&amp;gt; is the number of the digits in mantissa without insignificant zeroes.&lt;br /&gt;
* A value of the symbol domain can be converted to the string domain and vice versa.&lt;br /&gt;
* A value of binary domain can be converted to the pointer domain.&lt;br /&gt;
* The domains that are implicitly introduced for interfaces can be converted only to the interface domains according to the rules specified below.&lt;br /&gt;
* All other domains cannot be converted.&lt;br /&gt;
&lt;br /&gt;
===== Conversions of Numerical Domains =====&lt;br /&gt;
&lt;br /&gt;
* The range is considered first during such conversion. If the ranges of source and target do not intersect, then an error is produced. If the ranges of source and target only partially intersect, then run-time checking is generated. Also, if one of domains is real and another is an integral one, then the integer range is converted to the real range before the comparison.&lt;br /&gt;
* When input term in real and output is integer, then &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; and [[#tryConvert|tryConvert/2-&amp;gt;]] predicates truncate the input value to the nearest integer value, which is nearer to zero.&lt;br /&gt;
&lt;br /&gt;
===== Conversions of Interface Types =====&lt;br /&gt;
&lt;br /&gt;
Predicate &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; allow to convert any object to any interface type. The actual correctness of such conversion is checked at runtime. When object is created, its type is internally stored, therefore when the object is passed as argument it still remember about its original type. This original type is used for checking allowed conversions. The example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface x&lt;br /&gt;
      supports a, b&lt;br /&gt;
end interface x&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If object is created by class, which implements &amp;lt;vp&amp;gt;x&amp;lt;/vp&amp;gt; interface, and then object is passed as parameter of type &amp;lt;vp&amp;gt;a&amp;lt;/vp&amp;gt; to some predicate, then it is allowed to convert the object to &amp;lt;vp&amp;gt;b&amp;lt;/vp&amp;gt; type.&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Check range error.&lt;br /&gt;
* Unsupported interface type.&lt;br /&gt;
&lt;br /&gt;
==== digitsOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;digitsOf : (&amp;lt;real-domain&amp;gt; Domain) -&amp;gt; unsigned.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns precision of the specified floating-point domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Precision = digitsof(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input parameter &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; of this compiling-time predicate is a floating-point domain, it should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable). The predicate returns the number &amp;lt;vpbnf&amp;gt;&amp;lt;Precision&amp;gt;&amp;lt;/vpbnf&amp;gt; that was determined by the &amp;lt;vp&amp;gt;digits&amp;lt;/vp&amp;gt; attribute in the domain declaration.&lt;br /&gt;
&lt;br /&gt;
The compiler guarantees that values of the domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; will have at least &amp;lt;vpbnf&amp;gt;&amp;lt;Precision&amp;gt;&amp;lt;/vpbnf&amp;gt; number of significant decimal digits.&lt;br /&gt;
&lt;br /&gt;
==== errorExit ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;errorExit : (unsigned ErrorNumber) erroneous.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs a run-time error with the specified return code &amp;lt;vp&amp;gt;ErrorNumber&amp;lt;/vp&amp;gt;, which can be used in the [[#try-catch-finally|try-catch-finally]].&lt;br /&gt;
&lt;br /&gt;
==== fail ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;fail : () failure.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; predicate forces failure and, hence, always causes backtracking. A clause that fails (with &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; or for some other reason) cannot bind output arguments.&lt;br /&gt;
&lt;br /&gt;
==== free ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;free : (&amp;lt;variableName&amp;gt; Variable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check whether a variable is free.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;free(Variable)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;free&amp;lt;/vp&amp;gt; predicate succeeds if the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is free and fails if &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is bound. The &amp;lt;vp&amp;gt;free&amp;lt;/vp&amp;gt; predicate treats the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; as bound if any of it&amp;#039;s part are instantiated.&lt;br /&gt;
&lt;br /&gt;
See also [[#bound|bound/1]].&lt;br /&gt;
&lt;br /&gt;
==== fromEllipsis ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;fromEllipsis : (...) -&amp;gt; any* AnyTermList.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate creates the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; from the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039; (i.e. from the special varying parameters block).&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;AnyTermList = fromEllipsis(EllipsisBlock )&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#toEllipsis|toEllipsis/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== hasDomain ====&lt;br /&gt;
&lt;br /&gt;
{{Template:NonReleased}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;hasDomain&amp;lt;/vp&amp;gt; is not really a predicate, but more a type declaration/restriction.  It has two forms a non-function for declaring/restricting the type of a variable and a function form for declaring/restricting the type of a value.&lt;br /&gt;
&lt;br /&gt;
The non-function form is called with a type as first parmeter and a variable as second parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;hasDomain : (&amp;lt;type&amp;gt; Type, Type Variable).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only effect of the call is that the &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; will be restricted to the type &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The variable can be free, bound or of some mixed flow and the binding of the variable will not change in any way.&lt;br /&gt;
&lt;br /&gt;
The function form is called with a type as first argument and a value as second argument, and it returns the same value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;hasDomain : (&amp;lt;type&amp;gt; Type, Type Value) -&amp;gt; Type Value.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only effect of the call is to ensure that the &amp;lt;vp&amp;gt;Value&amp;lt;/vp&amp;gt; will be restricted to the type &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== lowerBound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;lowerBound : (&amp;lt;numeric-domain&amp;gt; NumericDomain) -&amp;gt; &amp;lt;numeric-domain&amp;gt; LowerBound.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the lower bound of the specified &amp;lt;vp&amp;gt;NumericDomain&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;LowerBoundValue = lowerBound(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;lowerBound&amp;lt;/vp&amp;gt; is a compiling-time predicate. The &amp;lt;vp&amp;gt;lowerBound&amp;lt;/vp&amp;gt; returns the lower bound value &amp;lt;vp&amp;gt;LowerBoundValue&amp;lt;/vp&amp;gt; of the specified numeric domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The return value &amp;lt;vp&amp;gt;LowerBoundValue&amp;lt;/vp&amp;gt; belongs to the same domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter should be the name of any numerical domain; this domain name should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable). See also [[#upperBound|upperBound/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
It will give a compile time error if the specified domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; is not numeric domain.&lt;br /&gt;
&lt;br /&gt;
==== in ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#in|in/2]].&lt;br /&gt;
&lt;br /&gt;
==== isErroneous ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;isErroneous : (&amp;lt;fact-variable&amp;gt; FactVariable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate succeeds if the specified fact variable is &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;isErroneous(factVariableName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate succeeds if the specified fact variable &amp;lt;vp&amp;gt;factVariableName&amp;lt;/vp&amp;gt; has the &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt; value, otherwise it fails.&lt;br /&gt;
&lt;br /&gt;
==== maxDigits ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;maxDigits : (&amp;lt;real-domain&amp;gt; RealDomain) -&amp;gt; unsigned MaxDigits&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the value of digits (precision) of the basic domain corresponding to the specified floating-point domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;MaxDigitsNumber = maxdigits(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The return maximal number of digits &amp;lt;vp&amp;gt;MaxDigitsNumber&amp;lt;/vp&amp;gt; for the &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter, which should be the name of a &amp;lt;vp&amp;gt;real&amp;lt;/vp&amp;gt; domain.&lt;br /&gt;
&lt;br /&gt;
==== not ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#not|not]].&lt;br /&gt;
&lt;br /&gt;
==== or ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#or_.28.3B.29|or (;)]].&lt;br /&gt;
&lt;br /&gt;
==== orelse ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#orelse|orelse]].&lt;br /&gt;
&lt;br /&gt;
==== predicate_fullname ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicate_fullname : () -&amp;gt; string PredicateFullName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;PredicateFullName&amp;lt;/vp&amp;gt; of the predicate in which it is invoked. The returned predicate name is qualified with a scope name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;predicate_fullname&amp;lt;/vp&amp;gt; can only be used inside a clause. Use of &amp;lt;vp&amp;gt;predicate_fullname&amp;lt;/vp&amp;gt; in other places causes a compile time error. See also [[#predicate_name|predicate_name]].&lt;br /&gt;
&lt;br /&gt;
==== predicate_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicate_name : () -&amp;gt; string PredicateName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;PredicateName&amp;lt;/vp&amp;gt; of the predicate in which it is invoked.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; can only be used inside a clause. Use of &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; in other places causes a compile time error. See also [[#predicate_fullname|predicate_fullname]]&lt;br /&gt;
&lt;br /&gt;
==== programPoint ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;programPoint : () -&amp;gt; core::programPoint ProgramPoint.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;programPoint&amp;lt;/vp&amp;gt; corresponding to the place where it is invoked.&lt;br /&gt;
&lt;br /&gt;
==== retract ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract : (&amp;lt;fact-term&amp;gt; FactTerm) nondeterm anyflow.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Successively removes the first matching fact from the facts database.  Fails when no more facts match.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract(FactTemplate)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; should be a fact term. The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate deletes the first fact that matches the &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; in the appropriated facts database. During backtracking, the rest of the matching facts will be deleted.&lt;br /&gt;
&lt;br /&gt;
Notice that &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can have any level of instantiation. The &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; is matched with the facts in the facts database, which means that any free variables will be bound in the call to &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can contain any anonymous variables. That is, variables with names consisting from the single underscore &amp;lt;vp&amp;gt;_&amp;lt;/vp&amp;gt; or a variable with a name starting with an underscore &amp;lt;vp&amp;gt;_AnyValue&amp;lt;/vp&amp;gt; if the variable occurs only once in the clause. For example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract(person(&amp;quot;Hans&amp;quot;, _Age)),&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will retract the first matched person fact that has &amp;quot;&amp;lt;vp&amp;gt;Hans&amp;lt;/vp&amp;gt;&amp;quot; as the first argument and anything as the second argument.&lt;br /&gt;
&lt;br /&gt;
When retracting a fact, which is declared to be determ, the call to &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; will be deterministic.&lt;br /&gt;
&lt;br /&gt;
See also [[#retractall|retractall/1]] and [[#retractFactDb|retractFactDb]].&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate cannot be applied to single facts or fact variables.&lt;br /&gt;
&lt;br /&gt;
Be careful calling &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; with free &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; variable if any single fact is declared in the project current scope. If you retract a single fact, then the run-time error is generated. The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate fails when there are no more matches.&lt;br /&gt;
&lt;br /&gt;
==== retractall ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractall : (&amp;lt;fact-term&amp;gt; FactTerm) .&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove all matching facts from the facts database.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractall(FactTemplate)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; should be a fact term.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt; retracts all facts which match the given &amp;#039;&amp;#039;FactTemplate&amp;#039;&amp;#039;. It always succeeds, even if no facts were retracted.&lt;br /&gt;
&lt;br /&gt;
Attempting to retract a &amp;lt;vp&amp;gt;single&amp;lt;/vp&amp;gt; fact will cause a compile time error.&lt;br /&gt;
&lt;br /&gt;
It is not possible to obtain any output values from &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt;. For this reason, the variables in the call must be bound or be a single underscores (anonymous). Notice that  &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can have any level of instantiation, but free variables must be single underscores (&amp;quot;unconditionally anonymous&amp;quot;). In difference to [[#retract|retract/1]] &amp;quot;conditionally&amp;quot; anonymous variables with names starting from the underscore (like &amp;lt;vp&amp;gt;_AnyValue&amp;lt;/vp&amp;gt;) cannot be used in &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
See also [[#retract|retract/1]] and [[#retractFactDb|retractFactDb/1]].&lt;br /&gt;
&lt;br /&gt;
==== retractFactDb ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractFactDb : (factDB FactDB).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove all facts from the named internal facts database &amp;lt;vp&amp;gt;FactDB&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractFactDb(FactDB)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retractFactDb/1&amp;lt;/vp&amp;gt; removes all facts from the named facts database &amp;lt;vp&amp;gt;FactDB&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Notice, it is impossible to retract &amp;lt;vp&amp;gt;single&amp;lt;/vp&amp;gt; facts and fact variables, so the predicate leaves such ones as they are.&lt;br /&gt;
&lt;br /&gt;
See also [[#retractall|retractall/1]] and [[#retract|retract/1]].&lt;br /&gt;
&lt;br /&gt;
==== retractAll/2 ====&lt;br /&gt;
&lt;br /&gt;
Obsolete predicate! Use [[#retractFactDb|retractFactDb/1]] instead.&lt;br /&gt;
&lt;br /&gt;
==== sizeBitsOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeBitsOf : (&amp;lt;domain&amp;gt; DomainName) -&amp;gt; unsigned BitSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bits occupied in memory by an entity of the specified domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;BitSize = sizeBitsOf(DomainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compiling-time predicate receives the domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt; as input parameter and return the size of memory that is occupied by the entity of the given domain. The result is measured in bits. For the integer domains &amp;lt;vp&amp;gt;sizeBitsOf/1-&amp;gt;&amp;lt;/vp&amp;gt; predicate returns the value that was defined for the size-field in a domain&amp;#039;s declaration.&lt;br /&gt;
&lt;br /&gt;
The following is always true for the integral domains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOfDomain(domain)*8 - 7 &amp;lt;= sizeBitsOf(domain) &amp;lt;= sizeOfDomain(domain)*8&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#sizeOfDomain|sizeOfDomain]]/1-&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== sizeOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOf : (&amp;lt;term&amp;gt; Term) -&amp;gt; integer ByteSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bytes occupied in memory by the specified term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ByteSize = sizeOf(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;sizeOf/1-&amp;gt;&amp;lt;/vp&amp;gt; function receives a term as input parameter and returns value &amp;lt;vp&amp;gt;ByteSize&amp;lt;/vp&amp;gt; that specifies the number of bytes occupied in memory by this term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== sizeOfDomain ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOfDomain : (&amp;lt;domain&amp;gt; Domain) -&amp;gt; integer ByteSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bytes occupied in memory by the entity of the specified domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ByteSize = sizeOfDomain(DomainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compiling-time predicate receives the domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt; as input parameter and return the size of memory that is occupied by the entity of the given domain. The result is measured in bytes. The returned value &amp;lt;vp&amp;gt;ByteSize&amp;lt;/vp&amp;gt; belongs to the integer domain. Compare with [[#sizeBitsOf|sizeBitsOf/1-&amp;gt;]], which returns size of a domain measured in bits.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_lineno ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_lineno : () -&amp;gt; unsigned LineNumber.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current line number in the source file processed by the compiler.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_name : () -&amp;gt; string FileName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the name of the source file processed by the compiler.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_timestamp ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_timestamp : () -&amp;gt; string TimeStamp..&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a string that represents the date and time of the currently compiled source file in format &amp;lt;vp&amp;gt;YYYY-MM-DD&amp;lt;/vp&amp;gt; &amp;lt;vp&amp;gt;HH:MM:SS&amp;lt;/vp&amp;gt;. Where:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vp&amp;gt;YYYY&amp;lt;/vp&amp;gt; - Year.&lt;br /&gt;
* &amp;lt;vp&amp;gt;MM&amp;lt;/vp&amp;gt; - Month.&lt;br /&gt;
* &amp;lt;vp&amp;gt;DD&amp;lt;/vp&amp;gt; - Day.&lt;br /&gt;
* &amp;lt;vp&amp;gt;HH&amp;lt;/vp&amp;gt; - Hour.&lt;br /&gt;
* &amp;lt;vp&amp;gt;MM&amp;lt;/vp&amp;gt; - Minute.&lt;br /&gt;
* &amp;lt;vp&amp;gt;SS&amp;lt;/vp&amp;gt; - Second.&lt;br /&gt;
&lt;br /&gt;
==== succeed ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;succeed : ().&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate &amp;lt;vp&amp;gt;succeed/0&amp;lt;/vp&amp;gt; will always succeed.&lt;br /&gt;
&lt;br /&gt;
==== toAny ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toAny : (Term) -&amp;gt; any UniversalTypeValue.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to the value of universal term type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;UniversalTypeValue = toAny(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== toBinary ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toBinary : (Term) -&amp;gt; binary Serialized.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to [[#binary|binary]] representation.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Serialized = toBinary(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a binary, it can safely be stored in a file or sent over a network to another program. Later the obtained binary value &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; can be converted back to a Visual Prolog term, using [[#toTerm|toTerm/1-&amp;gt;]] function (the domain for the reversed term should be adequate to &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) for the reverse conversion.&lt;br /&gt;
&lt;br /&gt;
==== toBoolean ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toBoolean : (&amp;lt;term&amp;gt; SubGoal) -&amp;gt; boolean Succeed.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of this meta-predicate is to convert the deterministic call (to a predicate or fact) to the procedure that returns the value of [[#boolean|boolean]] domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this meta-predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;True_or_False = toBoolean(deterministic_call)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;toBoolean/1-&amp;gt;&amp;lt;/vp&amp;gt; meta-predicate returns [[#boolean|boolean]] value. The result is &amp;lt;vp&amp;gt;true&amp;lt;/vp&amp;gt; if &amp;#039;&amp;#039;deterministic_call&amp;#039;&amp;#039; succeeds. The result is &amp;lt;vp&amp;gt;false&amp;lt;/vp&amp;gt; if &amp;#039;&amp;#039;deterministic_call&amp;#039;&amp;#039; fails.&lt;br /&gt;
&lt;br /&gt;
==== toEllipsis ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toEllipsis : (any* AnyTermList) -&amp;gt; ....&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate creates &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039; (i.e. the special varying parameters block) from the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;. Such &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; can be later passed to a predicate which expects the varying number of arguments (i.e. is declared with the ellipsis (&amp;#039;&amp;#039;...&amp;#039;&amp;#039;)), like &amp;lt;vp&amp;gt;write/...&amp;lt;/vp&amp;gt;, at the position of the ellipsis (&amp;#039;&amp;#039;...&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;EllipsisBlock = toEllipsis(&amp;lt;any_term_list&amp;gt;), write(EllipsisBlock )&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#fromEllipsis|fromEllipsis/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== toString ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toString : (Term) -&amp;gt; string Serialized.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to string representation.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Serialized = toString(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a string, it can safely be stored in a file or sent over a network to another program. Later the obtained string value can be converted back to a Visual Prolog term, using [[#toTerm|toTerm/1-&amp;gt;]] function (the domain of the return value should be adequate to &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) for the reverse conversion.&lt;br /&gt;
&lt;br /&gt;
==== toTerm ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toTerm : (string Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (binary Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (any Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, string Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, binary Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, any Serialized) -&amp;gt; Term.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the string/binary/any representation of the specified term &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; into representation corresponding to the domain of &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; variable of the return value. The domain can be stated explicitly or it can be left to the compiler to determine a suitable domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Term = toTerm(Serialized) % with implicit domain&lt;br /&gt;
Term = toTerm(domainName, Serialized) % with explicit domain, domainName&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the domain is not specified the compiler must be able to determine the domain for the returned value &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; at compile-time. Notice that binary version of &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicate performs almost byte to byte conversion and only checking general compatibility of &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; data with the domain required to the return value &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;. The programmer is wholly responsible for providing binary data of &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; that can be correctly converted to the term of the desired domain. The &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicates are counterparts to predicates [[#toBinary|toBinary/1-&amp;gt;]] and [[#toString|toString/1-&amp;gt;]]. When a &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a binary or string representation &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; (by [[#toBinary|toBinary/1-&amp;gt;]] or [[#toString|toString/1-&amp;gt;]] or [[#toAny|toAny/1-&amp;gt;]] correspondingly), it can safely be stored in a file or sent over a network to another program. Later the corresponding &amp;lt;vp&amp;gt;toTerm/1&amp;lt;/vp&amp;gt;-&amp;gt; function can convert the obtained string/binary value &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; back to a Visual Prolog term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;. For correctness of the reverse conversion the domain of the clause variable &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; should be adequate to the initial domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
See also [[#tryToTerm|tryToTerm]].&lt;br /&gt;
&lt;br /&gt;
It gives a compile time error if the compiler cannot determine the return domain.&lt;br /&gt;
&lt;br /&gt;
Exceptions&lt;br /&gt;
&lt;br /&gt;
* Run time errors are generated when the &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicate cannot convert the string or binary into a term of the specified domain.&lt;br /&gt;
&lt;br /&gt;
==== tryToTerm ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;tryToTerm : (string Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (binary Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (any Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, string Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, binary Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, any Serialized) -&amp;gt; Term.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Converts the string/binary/any representation &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; into a term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;  like [[#toTerm|toTerm]]. The only difference between the predicates is that &amp;lt;vp&amp;gt;tryToTerm&amp;lt;/vp&amp;gt; fails if it cannot convert the string or binary or any into a term of the specified domain whereas toTerm raises an exception.&lt;br /&gt;
&lt;br /&gt;
See also [[#toTerm|toTerm]].&lt;br /&gt;
&lt;br /&gt;
==== tryConvert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;tryConvert : (&amp;lt;type&amp;gt; Type, Value) -&amp;gt; &amp;lt;type&amp;gt; Converted determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the input term &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; can be strictly converted into the specified domain &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt; and returns the converted term &amp;lt;vp&amp;gt;Converted&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ReturnTerm = tryConvert(returnDomain, InputTerm)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vp&amp;gt;returnDomain&amp;lt;/vp&amp;gt;: Specifies a domain to which &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate tries to convert the specified &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; can be any domain accessible in the current scope. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the term that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; is an expression, then it will be evaluated before conversion.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; domain.&lt;br /&gt;
&lt;br /&gt;
The conversion rules are the same as of the embedded predicate [[#convert|convert/2-&amp;gt;]], but &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; fails when [[#convert|convert/2-&amp;gt;]] generates conversion errors.&lt;br /&gt;
&lt;br /&gt;
This predicate succeeds if the corresponding conversion succeeds. Otherwise it fails. The &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate tries to perform a clean and genuine conversion of the given &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; into a value of the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;. The &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate will fail if the required conversion cannot be performed. When &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate succeeds, it returns the term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; converted to the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
For allowed conversions and rules of checked explicit conversions see [[#convert|convert/2-&amp;gt;]] predicate.&lt;br /&gt;
&lt;br /&gt;
See also [[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== uncheckedConvert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;uncheckedConvert : (&amp;lt;type&amp;gt; Type, Value) -&amp;gt; &amp;lt;type&amp;gt; Converted.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unchecked conversion of a value to another type.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ReturnTerm = uncheckedConvert(returnDomain, InputTerm)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vp&amp;gt;returnDomain&amp;lt;/vp&amp;gt;: Specifies a domain to which &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; predicate unsafely converts the specified &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; can be any domain accessible in the current scope, the &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; should has the same bit-size as the &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the value that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;#039;&amp;#039;InputTerm&amp;#039;&amp;#039; is an expression, then it will be evaluated before conversion.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned parameter &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; type.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; evaluates &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;, change the type to &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; without any modification of the memory pattern and unifies with &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt;. The &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; predicate performs no runtime checks. It makes only compile time checking of bit-size equality of the converted domains. So almost any term may be quite recklessly converted to any other term. So quite disastrous results may occur if you try to use variables incorrectly converted by &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;. Be extremely careful implementing &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;; we strongly recommend you always, when it is possible, using of [[#convert|convert/2-&amp;gt;]] and [[#tryConvert|tryConvert/2-&amp;gt;]]. But notice that, when an object is returned by COM system it is necessary to convert it by &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;, as Prolog program does not have information about its actual type.&lt;br /&gt;
&lt;br /&gt;
==== upperBound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;upperBound : (&amp;lt;numeric-domain&amp;gt; NumericDomain) -&amp;gt; &amp;lt;number-domain&amp;gt; UpperBound.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the upper bound value of the specified numeric domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;UpperBound = upperBound(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;upperBound&amp;lt;/vp&amp;gt; is a compiling-time predicate. The &amp;lt;vp&amp;gt;upperBound&amp;lt;/vp&amp;gt; returns the upper bound value of the specified numeric domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The return value &amp;lt;vp&amp;gt;UpperBound&amp;lt;/vp&amp;gt; belongs to the same domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter should be the name of any numerical domain; this domain name should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable).&lt;br /&gt;
&lt;br /&gt;
See also [[#lowerBound|lowerBound/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
Will cause a compile time error if the specified domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; is not numeric domain.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{LanguageReferenceSubarticle|Built-in entities/Predicates}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Terms/in&amp;diff=3903</id>
		<title>Language Reference/Terms/in</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Terms/in&amp;diff=3903"/>
		<updated>2014-06-23T11:08:19Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: misspelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==== in ====&lt;br /&gt;
&lt;br /&gt;
{{Template:NonReleased}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;InOperator&amp;gt;:&lt;br /&gt;
  in&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;in&amp;lt;/vp&amp;gt; operator is used to test for member ship of a collection (e.g. a list) and to nondeterministically generate the members of a collection.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;predicates&lt;br /&gt;
    p : (Type X, Type* L).&lt;br /&gt;
clauses&lt;br /&gt;
    p(X, L) :-&lt;br /&gt;
        if X in L then&lt;br /&gt;
            write(&amp;quot;X is in L\n&amp;quot;)&lt;br /&gt;
        end if.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&amp;lt;vp&amp;gt;p&amp;lt;/vp&amp;gt; is a procedure that takes a value &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; and a list &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt; as arguments.  If &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; is in the list &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt; then it will write &amp;lt;vp&amp;gt;&amp;quot;X is in L&amp;quot;&amp;lt;/vp&amp;gt;.  In this case in is used as an in-test (membership test).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;predicates&lt;br /&gt;
    q : (Type* L).&lt;br /&gt;
clauses&lt;br /&gt;
    q(L) :-&lt;br /&gt;
        foreach X in L do&lt;br /&gt;
            writef(&amp;quot;% is in L\n&amp;quot;, X)&lt;br /&gt;
        end foreach.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&amp;lt;vp&amp;gt;q&amp;lt;/vp&amp;gt; is a procedure that takes a list &amp;lt;vp&amp;gt;L&amp;lt;/vp&amp;gt; as argument.  The &amp;quot;in&amp;quot; operator is used to nondeterministically return the members of L, so that they can be written.}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;in&amp;lt;/vp&amp;gt; operator can be defined for any domain and interface using the &amp;lt;vp&amp;gt;in_test&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;in_iterate&amp;lt;/vp&amp;gt; attributes.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;in_test(&amp;lt;predicate name&amp;gt;)&amp;lt;/vp&amp;gt; attribute defines the predicate that is used as in-test for a certain domain or interface.  Likewise the &amp;lt;vp&amp;gt;in_iterate&amp;lt;/vp&amp;gt; attribute defines the predicate that is used as in-ieratorfor the domain/interface.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;domains&lt;br /&gt;
    tree{E} = empty; node(tree{E} Left, E Value, tree{E} Right) [in_test(isMemberTree), in_iterate(getAll_nd)].&amp;lt;/vip&amp;gt;&lt;br /&gt;
When the program contains &amp;lt;vp&amp;gt;A in B&amp;lt;/vp&amp;gt; where &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is bound &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is a &amp;lt;vp&amp;gt;tree{E}&amp;lt;/vp&amp;gt; then &amp;lt;vp&amp;gt;isMemberTree&amp;lt;/vp&amp;gt; is actually called.&lt;br /&gt;
&lt;br /&gt;
In that case &amp;lt;vp&amp;gt;A in B&amp;lt;/vp&amp;gt; corresponds to &amp;lt;vp&amp;gt;isMemberTree(A, B)&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is free the call corresponds to &amp;lt;vp&amp;gt;A = getAll_nd(B)&amp;lt;/vp&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
For a domain &amp;lt;collection&amp;gt; the predicate must have the type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicates&lt;br /&gt;
    &amp;lt;predicate&amp;gt; : (&amp;lt;some-type&amp;gt; Elem, &amp;lt;collection&amp;gt; Collection) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;interface collection [in_test(contains), in_test(getAll_nd)]&lt;br /&gt;
...&lt;br /&gt;
end interface collection&amp;lt;/vip&amp;gt;&lt;br /&gt;
When the program contains &amp;lt;vp&amp;gt;A in B&amp;lt;/vp&amp;gt; where &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is bound &amp;lt;vp&amp;gt;B&amp;lt;/vp&amp;gt; is a &amp;lt;vp&amp;gt;collection&amp;lt;/vp&amp;gt; then &amp;lt;vp&amp;gt;contains&amp;lt;/vp&amp;gt; is actually called.&lt;br /&gt;
&lt;br /&gt;
In that case &amp;lt;vp&amp;gt;A in B&amp;lt;/vp&amp;gt; corresponds to &amp;lt;vp&amp;gt;B:contains(A)&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;vp&amp;gt;A&amp;lt;/vp&amp;gt; is free the call corresponds to &amp;lt;vp&amp;gt;A = B:getAll_nd()&amp;lt;/vp&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
For a domain &amp;lt;vp&amp;gt;&amp;lt;collection&amp;gt;&amp;lt;/vp&amp;gt; the &amp;lt;vp&amp;gt;in_test&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;in_iterate&amp;lt;/vp&amp;gt; predicate must fulfill these schematic declarations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;domains&lt;br /&gt;
    &amp;lt;collection&amp;gt; = ... [in_test(&amp;lt;in_test&amp;gt;), in_iterate(&amp;lt;in_iterate&amp;gt;)].&lt;br /&gt;
class predicates&lt;br /&gt;
    &amp;lt;in_test&amp;gt; : (&amp;lt;some-type&amp;gt; Elem, &amp;lt;collection&amp;gt; Collection) determ.&lt;br /&gt;
    &amp;lt;in_iterate : (&amp;lt;collection&amp;gt; Collection) -&amp;gt; &amp;lt;some-type&amp;gt; Elem nondeterm.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For an interface &amp;lt;vp&amp;gt;&amp;lt;collection&amp;gt;&amp;lt;/vp&amp;gt; the &amp;lt;vp&amp;gt;in_test&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;in_iterate&amp;lt;/vp&amp;gt; predicate must fulfill these schematic declarations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface &amp;lt;collection&amp;gt; [in_test(&amp;lt;in_test&amp;gt;), in_iterate(&amp;lt;in_iterate&amp;gt;)].&lt;br /&gt;
predicates&lt;br /&gt;
    &amp;lt;in_test&amp;gt; : (&amp;lt;some-type&amp;gt; Elem) determ.&lt;br /&gt;
    &amp;lt;in_iterate : () -&amp;gt; &amp;lt;some-type&amp;gt; Elem nondeterm.&lt;br /&gt;
...&lt;br /&gt;
end interface &amp;lt;collection&amp;gt;&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;in&amp;lt;/vp&amp;gt; operator is predefined on list domains, and in PFC the collections have suitable attributes.&lt;br /&gt;
&lt;br /&gt;
{{Example|&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    p() :-&lt;br /&gt;
        foreach X in [1, 2, 3, 4] do % in_iterate&lt;br /&gt;
            if X in [2, 4] then % in_test&lt;br /&gt;
                ...&lt;br /&gt;
            end if&lt;br /&gt;
        end foreach.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first &amp;lt;vp&amp;gt;in&amp;lt;/vp&amp;gt; is the predefined &amp;lt;vp&amp;gt;in_iterate&amp;lt;/vp&amp;gt; for the list domain, and the second one is the predefined &amp;lt;vp&amp;gt;in_iterate&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    q() :-&lt;br /&gt;
        M1 = setM_redBlack::new(),&lt;br /&gt;
        M1:inset(&amp;quot;a&amp;quot;),&lt;br /&gt;
        M1:inset(&amp;quot;b&amp;quot;),&lt;br /&gt;
        M2 = setM_redBlack::new(),&lt;br /&gt;
        M2:inset(&amp;quot;b&amp;quot;),&lt;br /&gt;
        foreach X in M1 do % in_iterate&lt;br /&gt;
            if X in M2 then % in_test&lt;br /&gt;
                ...&lt;br /&gt;
            end if&lt;br /&gt;
        end foreach.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For collections the &amp;lt;vp&amp;gt;in&amp;lt;/vp&amp;gt; operators resolve to &amp;lt;vp&amp;gt;contains&amp;lt;/vp&amp;gt; and &amp;lt;vp&amp;gt;getAll_nd&amp;lt;/vp&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface collection{@Type}&lt;br /&gt;
    [in_test(contains), in_iterate(getAll_nd)]&lt;br /&gt;
&lt;br /&gt;
predicates&lt;br /&gt;
    contains : (@Type Value) determ.&lt;br /&gt;
    % @short Succeeds if the collection contains the value @Type&lt;br /&gt;
    % @end&lt;br /&gt;
&lt;br /&gt;
predicates&lt;br /&gt;
    getAll_nd : () -&amp;gt; @Type Value nondeterm.&lt;br /&gt;
    % @short @Type is nondeterministic iteration of the elements in the collection.&lt;br /&gt;
    % @end&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
end interface collection&amp;lt;/vip&amp;gt;}}&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Ide/Project_Settings&amp;diff=3734</id>
		<title>Ide/Project Settings</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Ide/Project_Settings&amp;diff=3734"/>
		<updated>2013-09-03T10:40:29Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: /* Run Options Tab */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{ideNavbar|IDE Project Settings}}&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Project Settings&amp;#039;&amp;#039;&amp;#039; utility is used to create new Visual Prolog Projects and to change some settings of existing projects. &lt;br /&gt;
&lt;br /&gt;
To activate the &amp;#039;&amp;#039;&amp;#039;Project Settings&amp;#039;&amp;#039;&amp;#039; dialog, select the &amp;#039;&amp;#039;&amp;#039;Project | Settings&amp;#039;&amp;#039;&amp;#039; menu item. &amp;#039;&amp;#039;&amp;#039;Project Settings&amp;#039;&amp;#039;&amp;#039; is also activated when you create a new project (with the &amp;#039;&amp;#039;&amp;#039;Project | New&amp;#039;&amp;#039;&amp;#039; command).&lt;br /&gt;
&lt;br /&gt;
== General Tab ==&lt;br /&gt;
&lt;br /&gt;
When creating a new project the sheet looks like:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_ApplicationExpert_General_Create.png]]&lt;br /&gt;
&lt;br /&gt;
You need to specify a mandatory project name and other options. After the needed information is specified, press the &amp;#039;&amp;#039;&amp;#039;OK&amp;#039;&amp;#039;&amp;#039; button. The &amp;#039;&amp;#039;&amp;#039;Project Settings&amp;#039;&amp;#039;&amp;#039; utility will create the default files, define the {{ide|Make Facility#Build Script|build script}}, etc.&lt;br /&gt;
&lt;br /&gt;
=== Project Name ===&lt;br /&gt;
&lt;br /&gt;
The project name must be specified in the &amp;#039;&amp;#039;&amp;#039;Project Name&amp;#039;&amp;#039;&amp;#039; option while a project creation. &amp;#039;&amp;#039;&amp;#039;Project Settings&amp;#039;&amp;#039;&amp;#039; uses this project name to generate name for the project file: &amp;lt;vpbnf&amp;gt;&amp;lt;ProjectName&amp;gt;.prj6&amp;lt;/vpbnf&amp;gt;. The specified project name is also used as the default name of &amp;#039;&amp;#039;&amp;#039;Subdirectory&amp;#039;&amp;#039;&amp;#039; in which the project is placed.&lt;br /&gt;
&lt;br /&gt;
=== Project Kind ===&lt;br /&gt;
&lt;br /&gt;
Sets which type the application will have.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_ApplicationExpert_UI_Strategy.png]]&lt;br /&gt;
&lt;br /&gt;
The IDE automatically generates different default sets of files (and codes) for each application type.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note.&amp;#039;&amp;#039;&amp;#039; DLL option is available for the Visual Prolog Commercial Edition only.&lt;br /&gt;
&lt;br /&gt;
=== MDI Mode/SDI Mode ===&lt;br /&gt;
&lt;br /&gt;
Specifies whether the IDE creates a &amp;#039;&amp;#039;multi document interface-&amp;#039;&amp;#039; or &amp;#039;&amp;#039;single document interface-&amp;#039;&amp;#039; project template respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note.&amp;#039;&amp;#039;&amp;#039; This option is available for the Visual Prolog Commercial Edition only. Otherwise the &amp;#039;&amp;#039;MDI Mode&amp;#039;&amp;#039; is assumed by the default.&lt;br /&gt;
&lt;br /&gt;
=== Base Directory and Subdirectory ===&lt;br /&gt;
&lt;br /&gt;
The name of the directory, in which the project is placed, is generated from the path specified in &amp;#039;&amp;#039;&amp;#039;Base Directory&amp;#039;&amp;#039;&amp;#039; that is concatenated with the folder name specified in &amp;#039;&amp;#039;&amp;#039;Subdirectory&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Base Directory&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Specifies the base directory for the project being created.With the &amp;#039;&amp;#039;&amp;#039;Browse&amp;#039;&amp;#039;&amp;#039; button, you can open up a directory browser to find a proper &amp;#039;&amp;#039;&amp;#039;Base Directory.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Subdirectory&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Specifies the subdirectory (relative to the &amp;#039;&amp;#039;&amp;#039;Base Directory&amp;#039;&amp;#039;&amp;#039;), which should be the root directory for the project being created.By default the &amp;#039;&amp;#039;&amp;#039;Subdirectory&amp;#039;&amp;#039;&amp;#039; name is equal to the specified &amp;#039;&amp;#039;&amp;#039;Project Name&amp;#039;&amp;#039;&amp;#039;, but it can be changed while the project creation.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note.&amp;#039;&amp;#039;&amp;#039; That if you choose a directory that already contains some project as the directory in which to place the project being created, then the &amp;#039;&amp;#039;&amp;#039;Project Settings&amp;#039;&amp;#039;&amp;#039; utility displays the &amp;#039;&amp;#039;&amp;#039;These files will be overwritten&amp;#039;&amp;#039;&amp;#039; warning dialog. It displays names of already existing files which will be overwritten after you push the &amp;#039;&amp;#039;&amp;#039;Create&amp;#039;&amp;#039;&amp;#039; button. Therefore, it is a good idea to store each project in its own directory.&lt;br /&gt;
&lt;br /&gt;
=== Platform === &lt;br /&gt;
&lt;br /&gt;
Specifies the project target platform as one of the following:&lt;br /&gt;
&lt;br /&gt;
* 32bit&lt;br /&gt;
* 64bit&lt;br /&gt;
* 32bit+64bit&lt;br /&gt;
&lt;br /&gt;
When the two 32bit 64bit platforms are specified as the project target, the active platform can be choosen through the &amp;#039;&amp;#039;&amp;#039;Build&amp;#039;&amp;#039;&amp;#039; menu.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note.&amp;#039;&amp;#039;&amp;#039; This option is available for the Visual Prolog Commercial Edition only. Otherwise the &amp;#039;&amp;#039;32bit&amp;#039;&amp;#039; is assumed by the default.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Manifest File&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
When it is checked &amp;#039;&amp;#039;&amp;#039;ON&amp;#039;&amp;#039;&amp;#039;, then the &amp;#039;&amp;#039;&amp;#039;Manifest&amp;#039;&amp;#039;&amp;#039; file is generated for the project.&lt;br /&gt;
&lt;br /&gt;
A Win32 side-by-side assembly contains a collection of resources—a group of DLLs, windows classes, COM servers, type libraries, or interfaces—that are always provided together with applications. These are described in the assembly &amp;#039;&amp;#039;&amp;#039;Manifest&amp;#039;&amp;#039;&amp;#039; files. For more details about &amp;#039;&amp;#039;&amp;#039;Manifest&amp;#039;&amp;#039;&amp;#039; files see descriptions in MSDN.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Require commctrl v.6&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Specifies that the generated manifest file contains a statement to require the system &amp;#039;&amp;#039;&amp;#039;commctrl.dll&amp;#039;&amp;#039;&amp;#039; version 6 for the application.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Require Administrative Rights&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Specifies that the generated manifest file contains a statement to require the administrative privileges for the application.&lt;br /&gt;
&lt;br /&gt;
To open the &amp;#039;&amp;#039;&amp;#039;Project Settings &amp;#039;&amp;#039;&amp;#039;dialog for the existing project, use the &amp;#039;&amp;#039;&amp;#039;Project | Settings&amp;#039;&amp;#039;&amp;#039; menu item.&lt;br /&gt;
&lt;br /&gt;
The General tab will look, in this case, as foolows:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_ApplicationExpert_General.png]]&lt;br /&gt;
&lt;br /&gt;
== Directories Tab ==&lt;br /&gt;
&lt;br /&gt;
Here you can specify directories that will be used by the project. In &amp;#039;&amp;#039;&amp;#039;Directories&amp;#039;&amp;#039;&amp;#039; tab you can set up the project subdirectories to be used by the compiler, linker, resource generators, etc.&lt;br /&gt;
&lt;br /&gt;
Directory names refer to the {{ide|Make Facility#Build Symbols|build script symbols}}. For example, when giving the name &amp;#039;&amp;#039;&amp;#039;$(ProDir)&amp;#039;&amp;#039;&amp;#039;, it is automatically expanded to the actual path where the Visual Prolog system is installed.&lt;br /&gt;
&lt;br /&gt;
When all these project subdirectories are defined, then it is possible to move a project to another place and still be able to use it without need to redefine the {{ide|Make Facility#Build Script|project build scripts}}  manually. This is possible because:&lt;br /&gt;
&lt;br /&gt;
* Usually these project subdirectories are defined relatively to the project root directory. Therefore, they are automatically redefined when the project is moved.&lt;br /&gt;
* Each of these subdirectories generates correspondent {{ide|Make Facility#Build Symbols|build symbols}} and namely these built symbols are used to define file locations in the {{ide|Make Facility#Build Script|project build scripts}}.&lt;br /&gt;
&lt;br /&gt;
=== Intermediate ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;$(ObjDir)&amp;#039;&amp;#039;&amp;#039; - This directory is used to place all intermediate (temporary) files of the project generated by the IDE. It defines the &amp;#039;&amp;#039;&amp;#039;$(ObjDir)&amp;#039;&amp;#039;&amp;#039; {{ide|Make Facility#Build Symbols|build script symbols}}. The IDE automatically adds suffix &amp;#039;&amp;#039;&amp;#039;64&amp;#039;&amp;#039;&amp;#039; to the intermediate directory name.&lt;br /&gt;
&lt;br /&gt;
=== Final ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;$(ExeDir)&amp;#039;&amp;#039;&amp;#039; - This directory is the place for the generated target module (executable or DLL). It defines the &amp;#039;&amp;#039;&amp;#039;$(ExeDir)&amp;#039;&amp;#039;&amp;#039; {{ide|Make Facility#Build Symbols|build script symbols}}. The IDE automatically adds suffix &amp;#039;&amp;#039;&amp;#039;64&amp;#039;&amp;#039;&amp;#039; to the final directory name.&lt;br /&gt;
&lt;br /&gt;
=== Import Library ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;$(LibDir)&amp;#039;&amp;#039;&amp;#039; - This directory is used for DLL projects to place the generated import library. It defines the &amp;#039;&amp;#039;&amp;#039;$(LibDir)&amp;#039;&amp;#039;&amp;#039; {{ide|Make Facility#Build Symbols|build script symbols}}.&lt;br /&gt;
&lt;br /&gt;
=== Prolog Root ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;$(ProDir)&amp;#039;&amp;#039;&amp;#039; - It is the root directory of the used Visual Prolog version. This directory defines the &amp;#039;&amp;#039;&amp;#039;$(ProDir)&amp;#039;&amp;#039;&amp;#039; {{ide|Make Facility#Build Symbols|build script symbols}}.&lt;br /&gt;
&lt;br /&gt;
=== Include Directories ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;$(IncDir)&amp;#039;&amp;#039;&amp;#039; - This list box displays the list of the project include directories.&lt;br /&gt;
&lt;br /&gt;
Each line contains one directory. In these directories the compiler will search for included files (specified in &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; or &amp;lt;vp&amp;gt;#bininclude&amp;lt;/vp&amp;gt; compiler directives), if the specified filename does not contain an absolute path. A single dot indicates the current directory, which is always the project directory. Two dots indicate the parent directory of the current directory.&lt;br /&gt;
&lt;br /&gt;
You can add a new directory to the list of the project include directories using the &amp;#039;&amp;#039;&amp;#039;Browse&amp;#039;&amp;#039;&amp;#039; button. The &amp;#039;&amp;#039;&amp;#039;Browse&amp;#039;&amp;#039;&amp;#039; button activates the &amp;#039;&amp;#039;&amp;#039;Set New Directory&amp;#039;&amp;#039;&amp;#039; dialog. Also you can use the &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039; button, which activates the &amp;#039;&amp;#039;&amp;#039;Edit Include Directory&amp;#039;&amp;#039;&amp;#039; dialog. In this dialog you can directly type in a path. Using &amp;#039;&amp;#039;&amp;#039;Up&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Down&amp;#039;&amp;#039;&amp;#039; buttons you can change the order in which the compiler will search in the specified include directories.&lt;br /&gt;
&lt;br /&gt;
This directory defines the &amp;#039;&amp;#039;&amp;#039;$(IncDir)&amp;#039;&amp;#039;&amp;#039; {{ide|Make Facility#Build Symbols|build script symbols}}.&lt;br /&gt;
&lt;br /&gt;
== Build Options Tab ==&lt;br /&gt;
&lt;br /&gt;
Here you can edit the project {{ide|Make Facility#Make Rules|build script &amp;#039;&amp;#039;&amp;#039;Rules&amp;#039;&amp;#039;&amp;#039;}} and the project {{ide|Make Facility#Build Script|&amp;#039;&amp;#039;&amp;#039;Build Script&amp;#039;&amp;#039;&amp;#039;}}, specify the &amp;#039;&amp;#039;&amp;#039;Type Library File&amp;#039;&amp;#039;&amp;#039;, etc.&lt;br /&gt;
&lt;br /&gt;
=== Rules ===&lt;br /&gt;
&lt;br /&gt;
Determine how to compile files with given extensions. An example is the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;pack-&amp;gt;obj:$(Compiler) /L:R /L:I /L:STAT $(IncDir) /MAXE:200 /MAXW:1000&lt;br /&gt;
 &amp;quot;$**.pack&amp;quot; /OBJECTFILE:&amp;quot;$(ObjDir)$*.obj&amp;quot; /DEBUGFILE:&amp;quot;$(ObjDir)$*.deb&amp;quot; /debug:full&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more information about {{ide|Make Facility#Make Rules|Rules}} syntax see the {{ide|Make Facility|Make Facility}}.&lt;br /&gt;
&lt;br /&gt;
=== Build Script ===&lt;br /&gt;
&lt;br /&gt;
Describes how to build the final target. An example is the following,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;quot;$(ProDir)Bin\VIP6Link.exe&amp;quot; -F&amp;lt;&amp;lt; -E_VIPStartUp@0 -d -TPE -SGUI -o&amp;quot;$(ExeDir)$*.exe&amp;quot;&lt;br /&gt;
 -M&amp;quot;$(ObjDir)$*.map&amp;quot; $(PROJECT_OBJ) &amp;quot;$(ObjDir)$*.res&amp;quot; $(PROJECT_LIB)&amp;lt;&amp;lt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more information about {{ide|Make Facility#Build Script|Build Scripts}} see the &amp;#039;&amp;#039;&amp;#039;Make Facility&amp;#039;&amp;#039;&amp;#039;, the {{ide|Command Line Tools#Command Line Compiler|Command Line Compiler}}, and the {{ide|Command Line Tools#Command Line Linker|Command Line Linker}}.&lt;br /&gt;
&lt;br /&gt;
=== Definition (.def) File === &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[$(DEF_FILE)]&amp;#039;&amp;#039;&amp;#039;: A {{ide|Command Line Tools#Definition Files|module-definition}} (&amp;#039;&amp;#039;&amp;#039;.DEF&amp;#039;&amp;#039;&amp;#039;) file provides additional input for the linker. The module-definition files describe the essential characteristics of a target application or library.&lt;br /&gt;
&lt;br /&gt;
Ordinary module-definition files should be used when the project target is a DLL or when the target file should use DLLs.&lt;br /&gt;
&lt;br /&gt;
When the project target is a DLL, then names of all predicates exported from the DLL have to be added to the {{ide|Command Line Tools#Definition Files|EXPORT}} section of the module-definition file, which is used to build the DLL.&lt;br /&gt;
&lt;br /&gt;
When an import library is included into the project modules, then the correspondent DLL is linked statically to the application (load-time linking). Such projects must have module-definition files, whose {{ide|Command Line Tools#Definition Files|IMPORTS}} sections should specify names of all predicates imported from the DLL.&lt;br /&gt;
&lt;br /&gt;
See {{ide|Command Line Tools#Definition Files|Definition Files}} in the {{ide|Command Line Tools#Command Line Linker|Command Line Linker}} for more information.&lt;br /&gt;
&lt;br /&gt;
=== Type Library File ===&lt;br /&gt;
&lt;br /&gt;
Here you can use the &amp;#039;&amp;#039;&amp;#039;Browse&amp;#039;&amp;#039;&amp;#039; button to specify a Type Library, which should be used in your project. Usually, you need this when creating COM objects.&lt;br /&gt;
&lt;br /&gt;
== Version Information Tab ==&lt;br /&gt;
&lt;br /&gt;
Here you specify some information about the project: &amp;#039;&amp;#039;&amp;#039;Company&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Author&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Copyright&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;File Version&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Trademarks&amp;#039;&amp;#039;&amp;#039;, etc.&lt;br /&gt;
&lt;br /&gt;
Some of version information attributes can be shown by the operation system &amp;#039;&amp;#039;&amp;#039;File Properties&amp;#039;&amp;#039;&amp;#039; dialog and can be used to validate version of DLL or EXE, before loading them.&lt;br /&gt;
&lt;br /&gt;
Version information contains the following fields:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Company&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Usually is the name of the company that is the Copyright owner to the project.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Author&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Represents information about the author of the project.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Copyright&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Represents the Copyright information, which is visible in the &amp;#039;&amp;#039;&amp;#039;File Properties&amp;#039;&amp;#039;&amp;#039; dialog.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Contains a short description.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;File Version&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Is written in the &amp;lt;span style=&amp;quot;color:Blue&amp;quot;&amp;gt;A.B.C.D&amp;lt;/span&amp;gt; format, where &amp;lt;span style=&amp;quot;color:Blue&amp;quot;&amp;gt;A&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:Blue&amp;quot;&amp;gt;B&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:Blue&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:Blue&amp;quot;&amp;gt;D&amp;lt;/span&amp;gt; are integers. &amp;lt;span style=&amp;quot;color:Blue&amp;quot;&amp;gt;A&amp;lt;/span&amp;gt; means major version.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Product Version&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Is written in format &amp;lt;span style=&amp;quot;color:Blue&amp;quot;&amp;gt;A.B.C.D&amp;lt;/span&amp;gt;, where &amp;lt;span style=&amp;quot;color:Blue&amp;quot;&amp;gt;A&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:Blue&amp;quot;&amp;gt;B&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:Blue&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:Blue&amp;quot;&amp;gt;D&amp;lt;/span&amp;gt; are integers. &amp;lt;span style=&amp;quot;color:Blue&amp;quot;&amp;gt;A&amp;lt;/span&amp;gt; means major version.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Trademarks:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Represents the project Trademarks information.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;File Flags:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:These are flags that describe the target file of the project:&lt;br /&gt;
*#&amp;#039;&amp;#039;&amp;#039;Debug&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*#:This flag means that the project is built with debugging information.&lt;br /&gt;
*#&amp;#039;&amp;#039;&amp;#039;Prerelease&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*#:This flag means that the target file is an intermediate version.&lt;br /&gt;
*#&amp;#039;&amp;#039;&amp;#039;Patched&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*#:This flag means that the target file has been modified comparing with the original file, which has the same version number.&lt;br /&gt;
*#&amp;#039;&amp;#039;&amp;#039;Special Build&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*#:This flag means that the target file was built using standard release procedures but for special purpose.&lt;br /&gt;
*#&amp;#039;&amp;#039;&amp;#039;Private Build&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*#:This flag means that the target file was built for private purpose.&lt;br /&gt;
&lt;br /&gt;
== Run Options Tab ==&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Run Arguments&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Here it is possible to specify command line parameters that will be passed to the target application when it starts from the IDE.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Executable for Run/Debugger&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Here you can specify an executable filename that will be loaded by the IDE for debugging.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;External Project for Debugger&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Here you can specify a project with the debug information that should be used by the IDE while debugging.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Working Directory for Run/Debug&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:If this option is set, a user application will use this directory as a working directory for Run/Debug comands, otherwise the final directory will be used. If the relative path is defined then the path is calculated from the project directory.&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Ide/Debugger/Debugger_Views&amp;diff=3710</id>
		<title>Ide/Debugger/Debugger Views</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Ide/Debugger/Debugger_Views&amp;diff=3710"/>
		<updated>2013-07-08T12:57:04Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: /* Disassembly Window Commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;[[Category:Ide/Debugger]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
== Debugger Views ==&lt;br /&gt;
&lt;br /&gt;
=== Run Stack Window ===&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; consists of three kinds of items:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Continue&amp;#039;&amp;#039;&amp;#039; item – marked with [[Image:Ide_db_RunStack_up.png]]. It describes ordinary executable clauses, which do not produce backtrack points and are not trapped.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;BackTrack&amp;#039;&amp;#039;&amp;#039; item – marked with [[Image:Ide_db_RunStack_dn.png]].It describes a clause of a nondeterministic predicate. The next clause of this predicate can be executed when a program failure of this clause occurs. Such items occur when a clause of a predicate, which creates a &amp;#039;&amp;#039;&amp;#039;backtrack&amp;#039;&amp;#039;&amp;#039; point (can produce more than one solution) is called.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;TrapTrack&amp;#039;&amp;#039;&amp;#039; item – marked with [[Image:Ide_db_RunStack_rh.png]] or [[Image:Ide_db_RunStack_dn_rh.png]]. They describe a continue item (clause), which will be resumed in any case independently whether an error condition occurs or no. For example, such item is created when a predicate call is trapped with the &amp;lt;vp&amp;gt;trap/3&amp;lt;/vp&amp;gt; predicate. The [[Image:Ide_db_RunStack_rh.png]] icon is used to mark trapped clauses of deterministic predicates. The [[Image:Ide_db_RunStack_dn_rh.png]] icon is used to mark trapped clauses of nondeterministic predicates.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;BackTrack&amp;#039;&amp;#039;&amp;#039; (marked with [[Image:Ide_db_RunStack_dn.png]]) and &amp;#039;&amp;#039;&amp;#039;TrapTrack&amp;#039;&amp;#039;&amp;#039; items (marked with [[Image:Ide_db_RunStack_dn_rh.png]]) are backtracking points. The clause, marked by one of these items, will be resumed and the program execution will be continued after the corresponding failure or an error occurs.&lt;br /&gt;
&lt;br /&gt;
The typical example of the &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; window is presented in the following picture:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_RunStack.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pop-up Menu&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; window has the pop-up context menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_RunStack_menu.png]]&lt;br /&gt;
&lt;br /&gt;
For each selected item in the tree, this menu contains items:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Refresh&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:It refreshes all the &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; window contents, rebuilds the tree.&lt;br /&gt;
*:&amp;lt;br/&amp;gt;It also refreshes the {{ide|Debugger#Variables Window|&amp;#039;&amp;#039;&amp;#039;Variables&amp;#039;&amp;#039;&amp;#039;}} window (if it is displayed).&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Go To Code&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Activates the Prolog source editor and places the cursor at the Prolog clause corresponding to the item selected in the &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; window. If the item does not correspond to a Prolog module with debug information, then the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window will be opened and the cursor will be placed onto the corresponding assembler instruction. The same action is caused by double-click a predicate call in the &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; window.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Copy Line&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:It copies the selected line contents to the clipboard.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Show Domains&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This option turns ON/OFF displaying domains of variables.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Show Values&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This option turns ON/OFF displaying values of variables.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; window can be activated by the IDE menu &amp;#039;&amp;#039;&amp;#039;View | Run Stack&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Variables Window ===&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Variables&amp;#039;&amp;#039;&amp;#039; window can be activated either by &amp;#039;&amp;#039;&amp;#039;Ctrl+Alt+V&amp;#039;&amp;#039;&amp;#039; or from the IDE menu &amp;#039;&amp;#039;&amp;#039;View | Variables for Current Clause&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Variables Window Contents&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Variables&amp;#039;&amp;#039;&amp;#039; window displays the tree of all program variables and facts from the traced clause, which are already created by the program at the current tracing step. These are: all variables and all object facts (fact variables), which are created in the clause before the executing instruction, and all class facts (fact variables), which can be used in this clause (declared in this class implementation).&lt;br /&gt;
&lt;br /&gt;
The top line of the window displays the declaration of the predicate, whose clause is executed.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Vars_Top.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Variables&amp;#039;&amp;#039;&amp;#039; window content is updated after every trace step.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pop-up Context Menu&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Variables in the Current Clause&amp;#039;&amp;#039;&amp;#039; window has the following pop-up context menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Vars_Menu.png]]&lt;br /&gt;
&lt;br /&gt;
This menu contains items:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Insert into Watch Window&amp;#039;&amp;#039;&lt;br /&gt;
*:Opens the &amp;#039;&amp;#039;&amp;#039;Watch Window&amp;#039;&amp;#039;&amp;#039; and moves there selected variable.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Copy&amp;#039;&amp;#039;&lt;br /&gt;
*:This command copies the contents of the line selected in the &amp;#039;&amp;#039;&amp;#039;Variables&amp;#039;&amp;#039;&amp;#039; window to the clipboard.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show as Hexadecimal&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows integral values in the hexadecimal format.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show as Decimal&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows integral values in the decimal format.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show as Octal&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows integral values in the octal format.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show Domains&amp;#039;&amp;#039;&lt;br /&gt;
*:This option turns &amp;#039;&amp;#039;&amp;#039;ON/OFF&amp;#039;&amp;#039;&amp;#039; displaying the domains after variable names.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show Variable Addresses&amp;#039;&amp;#039;&lt;br /&gt;
*:This option turns &amp;#039;&amp;#039;&amp;#039;ON/OFF&amp;#039;&amp;#039;&amp;#039; displaying the addresses after variable names.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Find&amp;#039;&amp;#039;&lt;br /&gt;
*:This command allows search variable by name.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Copy Tree&amp;#039;&amp;#039;&lt;br /&gt;
*:This command copies the contents of the window to the clipboard.&lt;br /&gt;
&lt;br /&gt;
=== Facts Window ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Class Facts&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Facts&amp;#039;&amp;#039;&amp;#039; window always shows the current contents of all &amp;#039;&amp;#039;&amp;#039;class&amp;#039;&amp;#039;&amp;#039; fact databases defined in the program being debugged.&lt;br /&gt;
&lt;br /&gt;
Simple example:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Facts_View.png]]&lt;br /&gt;
&lt;br /&gt;
Pressing &amp;#039;&amp;#039;&amp;#039;CTRL+ALT+F&amp;#039;&amp;#039;&amp;#039; opens &amp;#039;&amp;#039;&amp;#039;Facts&amp;#039;&amp;#039;&amp;#039; window:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Facts_View3.png]]&lt;br /&gt;
&lt;br /&gt;
Clicking icons opens sub-trees:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Facts_View4.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Facts&amp;#039;&amp;#039;&amp;#039; window automatically goes to the fact that is selected in the text editor (if any):&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Facts_View11.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Facts_View41.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Objects Facts&amp;#039;&amp;#039;&amp;#039; you cat look like a components of object variables in the {{ide|Debugger#Variables Window|&amp;#039;&amp;#039;&amp;#039;Variables&amp;#039;&amp;#039;&amp;#039; window}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pop-up Context Menu&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Facts Window&amp;#039;&amp;#039;&amp;#039; has the following pop-up context menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Vars_Menu.png]]&lt;br /&gt;
&lt;br /&gt;
This menu contains items:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Insert into Watch Window&amp;#039;&amp;#039;&lt;br /&gt;
*:Opens the &amp;#039;&amp;#039;&amp;#039;Watch Window&amp;#039;&amp;#039;&amp;#039; and moves there selected fact.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Copy&amp;#039;&amp;#039;&lt;br /&gt;
*:This command copies the contents of the line selected in the &amp;#039;&amp;#039;&amp;#039;Facts&amp;#039;&amp;#039;&amp;#039; window to the clipboard.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show as Hexadecimal&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows integral values in the hexadecimal format.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show as Decimal&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows integral values in the decimal format.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show as Octal&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows integral values in the octal format.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show Domains&amp;#039;&amp;#039;&lt;br /&gt;
*:This option turns &amp;#039;&amp;#039;&amp;#039;ON/OFF&amp;#039;&amp;#039;&amp;#039; displaying the domains after facts names.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show Addresses&amp;#039;&amp;#039;&lt;br /&gt;
*:This option turns &amp;#039;&amp;#039;&amp;#039;ON/OFF&amp;#039;&amp;#039;&amp;#039; displaying the addresses after facts names.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Find&amp;#039;&amp;#039;&lt;br /&gt;
*:This command allows search fact by name.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Copy Tree&amp;#039;&amp;#039;&lt;br /&gt;
*:This command copies the contents of the window to the clipboard.&lt;br /&gt;
&lt;br /&gt;
=== Breakpoints Window ===&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Breakpoints&amp;#039;&amp;#039;&amp;#039; window shows all breakpoints, which have been set in the program being debugged.&lt;br /&gt;
&lt;br /&gt;
You can set a breakpoint onto any executable line in program source files (or in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window, where a breakpoint can be set on any instruction of the program being debugged).&lt;br /&gt;
&lt;br /&gt;
There are two kinds of breakpoints: hard and soft. Hard breakpoints are active in any debugging mode. Soft breakpoints are active in normal debugging mode but disabled in a special mode of quick debugging, called &amp;#039;&amp;#039;Fast Forward Mode&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== Breakpoints Window Contents ====&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Breakpoints&amp;#039;&amp;#039;&amp;#039; window for each breakpoint includes &amp;#039;&amp;#039;&amp;#039;Status&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Line&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Count&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Comment&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Action&amp;#039;&amp;#039;&amp;#039;, where:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Status&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows whether the breakpoint is &amp;#039;&amp;#039;hard&amp;#039;&amp;#039; or &amp;#039;&amp;#039;soft&amp;#039;&amp;#039;.&lt;br /&gt;
**&amp;#039;&amp;#039;Hard&amp;#039;&amp;#039;&lt;br /&gt;
**:If a breakpoint is &amp;#039;&amp;#039;hard&amp;#039;&amp;#039; then it will be activated in any debugging mode. A hard breakpoint is marked with the filled circle [[Image:Ide_db_BreakPoints_en.png]] or [[Image:Ide_db_BreakPoints_assembler.png]] (for assembler) or [[Image:Ide_db_BreakPoints_shifted.png]] (for relocated breakpoint).&lt;br /&gt;
**&amp;#039;&amp;#039;Soft&amp;#039;&amp;#039;&lt;br /&gt;
**:If a breakpoint is &amp;#039;&amp;#039;soft&amp;#039;&amp;#039; then it will be activated only in normal (not Fast Forward) debugging mode. A soft breakpoint is marked with the hollow circle [[Image:Ide_db_BreakPoints_dis.png]] or [[Image:Ide_db_BreakPoints_assembler_disabled.png]] (for assembler).&lt;br /&gt;
**&amp;#039;&amp;#039;Invalid&amp;#039;&amp;#039;&lt;br /&gt;
**:A breakpoint is invalid when it is set on a line, which does not contain executable code. An invalid breakpoint is marked with the crossed hollow circle [[Image:Ide_db_BreakPoints_invalid.png]].&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This column shows the source string:&lt;br /&gt;
*:&amp;lt;vipbnf&amp;gt;&amp;lt;SourceName&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*:where:&lt;br /&gt;
*:&amp;#039;&amp;#039;SourceName&amp;#039;&amp;#039;&lt;br /&gt;
*:The description of a predicate in the address space of whose clauses the breakpoint is set:&lt;br /&gt;
*:*If the breakpoint is set in Prolog sources, then &amp;#039;&amp;#039;SourceName&amp;#039;&amp;#039; is the filename in which the breakpoint is set. It is displayed with the format:&lt;br /&gt;
*::&amp;lt;vipbnf&amp;gt;&amp;lt;FileName&amp;gt; &amp;#039;(&amp;#039; &amp;lt;Path&amp;gt; &amp;#039;)&amp;#039;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*::The &amp;#039;&amp;#039;Path&amp;#039;&amp;#039; can use {{ide|Make Facility#Build Symbols|Build script symbols}}.&lt;br /&gt;
*:* If the breakpoint is set in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window, then &amp;#039;&amp;#039;SourceName&amp;#039;&amp;#039; has the format:&lt;br /&gt;
*::&amp;lt;vipbnf&amp;gt;--- assembler: &amp;lt;AddressValue&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*::&amp;#039;&amp;#039;AddressValue&amp;#039;&amp;#039; is the hexadecimal address of the breakpoint in the assembler code of the predicate in which the breakpoint is set.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Line&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:When the breakpoint is set in a Prolog source file, then this column displays the number of the line the breakpoint is set on. &amp;lt;br /&amp;gt; When the breakpoint is set in the Disassembly window, then the number of the line is equal to 0.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Count&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This column displays {{ide|Debugger#Breakpoint Properties|counts}} of breakpoints.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Comment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This column displays {{ide|Debugger#Breakpoint Properties|comment strings}} of breakpoints.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Action&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This column displays the script text of a breakpoint. The script is performed each time the program reaches the breakpoint.&lt;br /&gt;
&lt;br /&gt;
==== Breakpoints in Prolog and Disassembly Windows ====&lt;br /&gt;
&lt;br /&gt;
Breakpoints can be set in Prolog source files and in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window:&lt;br /&gt;
&lt;br /&gt;
* In Prolog sources valid breakpoints can be set only on lines containing executable instructions. That is, breakpoints can be set only in predicate clauses on lines containing predicate calls, otherwise the breakpoints that are set on non-clause lines would be marked as invalid. The breakpoints that are set on clause lines that do not contain predicate calls would be shifted to the lines containing such calls (if any), but the initial line would be marked with [[Image:Ide_db_BreakPoints_shifted.png]]. Valid breakpoints are marked with red circles [[Image:Ide_db_BreakPoints_en.png]] or [[Image:Ide_db_BreakPoints_dis.png]] in Prolog sources and are shown in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window as blue circles [[Image:Ide_db_BreakPoints_assembler.png]] or [[Image:Ide_db_BreakPoints_assembler_disabled.png]]. If a Prolog clause has several assembler implementations (when the clause has several flow patterns), then each breakpoint in Prolog sources can generate several breakpoints in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window.&lt;br /&gt;
* Breakpoints that are set in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window are marked with red circles [[Image:Ide_db_BreakPoints_en.png]] or [[Image:Ide_db_BreakPoints_dis.png]]. Such breakpoint can be later overwritten by a breakpoint (marked with blue circles [[Image:Ide_db_BreakPoints_assembler.png]] or [[Image:Ide_db_BreakPoints_assembler_disabled.png]]) that is set in Prolog sources on the same address as the breakpoint set in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window.&amp;lt;br /&amp;gt; Notice that after modification and recompilation of the project some breakpoints that are set in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window can be cleared (if other instructions are placed at breakpoint addresses.)&lt;br /&gt;
&lt;br /&gt;
All breakpoints which are set in a program are seen in the &amp;#039;&amp;#039;&amp;#039;Breakpoints&amp;#039;&amp;#039;&amp;#039; window.&lt;br /&gt;
&lt;br /&gt;
==== Breakpoint Properties ====&lt;br /&gt;
&lt;br /&gt;
Each breakpoint has properties, which can be modified in the &amp;#039;&amp;#039;&amp;#039;Breakpoint Properties&amp;#039;&amp;#039;&amp;#039; dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_BreakPoint_Properties.png]]&lt;br /&gt;
&lt;br /&gt;
In this dialog:&lt;br /&gt;
&lt;br /&gt;
The top line contains:&lt;br /&gt;
&lt;br /&gt;
* If the breakpoint is set in Prolog sources, then the top line has format:&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;&amp;lt;vipbnf&amp;gt;File: &amp;lt;FileName&amp;gt; Line: &amp;lt;LineNumber&amp;gt;&amp;lt;/vipbnf&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;#039;&amp;#039;FileName&amp;#039;&amp;#039; is the name of the Prolog source file in which the breakpoint is set.&lt;br /&gt;
*:&amp;#039;&amp;#039;LineNumber&amp;#039;&amp;#039; is the number of the line on which the breakpoint is set.&lt;br /&gt;
&lt;br /&gt;
* If the breakpoint is set in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window, then the top line has format:&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;&amp;lt;vipbnf&amp;gt;Breakpoint Address:&amp;lt;Address&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*:&amp;#039;&amp;#039;Address&amp;#039;&amp;#039; is the breakpoint address in the program memory as it is seen in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hard&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:This check box controls the &amp;#039;&amp;#039;Hard/Soft&amp;#039;&amp;#039; state of the breakpoint. When you turn a breakpoint to Hard, then it will be activated in any debugging mode. When you turn a breakpoint to Soft, then it will be activated only in normal (not Fast Forward) debugging mode.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Counter&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;Value&amp;#039;&amp;#039;&lt;br /&gt;
:Shows the current number of activations of the breakpoint since its creation. The user cannot modify this value. This value increases by 1 each time when the program reaches the breakpoint. And resets to 0 at the beginning of the debug session.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Comment&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;Comment string&amp;#039;&amp;#039;&lt;br /&gt;
:In this edit box you can type in a &amp;#039;&amp;#039;Comment string&amp;#039;&amp;#039;. By default it has the value of the corresponding line in the source file.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Action&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;Script text&amp;#039;&amp;#039;&lt;br /&gt;
:In this box you can type in a &amp;#039;&amp;#039;Script text&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== Pop-up Menu ====&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Breakpoints&amp;#039;&amp;#039;&amp;#039; window has the pop-up context menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_BreakPoints_pop_up.png]]&lt;br /&gt;
&lt;br /&gt;
To activate this menu, select a breakpoint and press the right mouse button. This menu contains items:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Go to Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:If the breakpoint is set in the Prolog sources, then the &amp;#039;&amp;#039;&amp;#039;Go to Code&amp;#039;&amp;#039;&amp;#039; activates the Prolog source code editor, and moves the cursor to the Prolog code corresponding to the specified breakpoint. If the breakpoint is set in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window, then the &amp;#039;&amp;#039;&amp;#039;Go to Code&amp;#039;&amp;#039;&amp;#039; moves the view to this breakpoint in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window. The same action is performed by double-click the breakpoint or by pressing the &amp;#039;&amp;#039;&amp;#039;Enter&amp;#039;&amp;#039;&amp;#039; on the breakpoint.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Properties&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Invokes the {{ide|Debugger#Breakpoint Properties|&amp;#039;&amp;#039;&amp;#039;Breakpoint Properties&amp;#039;&amp;#039;&amp;#039;}} dialog for the selected breakpoint.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Toggle (Turn to Hard/Soft)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Switches the &amp;#039;&amp;#039;Hard/Soft&amp;#039;&amp;#039; state of the selected breakpoints.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Deletes the selected breakpoints.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Turn to Hard All&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Sets the state of all breakpoints that are set in the program to &amp;#039;&amp;#039;Hard&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Turn to Soft All&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Sets the state of all breakpoints that are set in the program to &amp;#039;&amp;#039;Soft&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Remove All&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Removes all breakpoints that are set in the program.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Breakpoints&amp;#039;&amp;#039;&amp;#039; window is auto-updated for any breakpoint updating.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Breakpoints&amp;#039;&amp;#039;&amp;#039; window can be activated either by &amp;#039;&amp;#039;&amp;#039;Ctrl+Alt+B&amp;#039;&amp;#039;&amp;#039; or from the IDE menu &amp;#039;&amp;#039;&amp;#039;View | Breakpoints&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Threads Window ===&lt;br /&gt;
----&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Threads&amp;#039;&amp;#039;&amp;#039; window shows information about the process being debugged and its threads.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Threads&amp;#039;&amp;#039;&amp;#039; window looks like following:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Threads.png]]&lt;br /&gt;
&lt;br /&gt;
Names displayed in the header of the window columns are the following:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;TID&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This column displays thread identifiers of all threads created by the process being debugged.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Current&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This column identifies the current thread by the &amp;lt;vp&amp;gt;*&amp;lt;/vp&amp;gt; sign. In the {{ide|Debugger#Variables Window|Variables}} window you can see only variables of predicates executed in the current thread.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;State&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Displays states of threads. States can be &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Running&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Stopped&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Suspend&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
*:&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Running&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;  The thread has been started, it is not suspended (see &amp;lt;vp&amp;gt;thread::suspend/0-&amp;gt;&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt; syncObject::wait/0-&amp;gt;&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;syncObject::wait/1-&amp;gt;&amp;lt;/vp&amp;gt;) or terminated (see &amp;lt;vp&amp;gt;thread::terminate/1&amp;lt;/vp&amp;gt;).&lt;br /&gt;
*:&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Suspend&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;  The thread is in suspended state (see &amp;lt;vp&amp;gt;thread::createSuspended/3&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;thread::suspend/0-&amp;gt;&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;syncObject::wait/0-&amp;gt;&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;syncObject::wait/1-&amp;gt;&amp;lt;/vp&amp;gt;).&lt;br /&gt;
*:&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Stopped&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; The thread was created and then stopped on a breakpoint, but it is not suspended (see &amp;lt;vp&amp;gt;thread::suspend/0-&amp;gt;&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;syncObject::wait/0-&amp;gt;&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;syncObject::wait/1-&amp;gt;&amp;lt;/vp&amp;gt;). If you set suspended state to a &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Stopped&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; thread, then it turns into the &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Suspend&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; state.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Thread creation time.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;User time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Processor time in the user-mode used by the thread.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Kernel Time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Processor time in the kernel-mode used by the thread.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Priority&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:The priority level of the thread. Here can be displayed the following numbers &amp;lt;vp&amp;gt;2, 1, 0, -1, -2&amp;lt;/vp&amp;gt;.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Predicate&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This field contains the name of the currently executed thread&amp;#039;s predicate (if it is possible to determine it).&lt;br /&gt;
&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
! Displayed Number&lt;br /&gt;
! Priority Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Highest&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The thread can be scheduled before threads with any other priority.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;AboveNormal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The thread can be scheduled after threads with &amp;#039;&amp;#039;&amp;#039;Highest&amp;#039;&amp;#039;&amp;#039; priority and before those with &amp;#039;&amp;#039;&amp;#039;Normal&amp;#039;&amp;#039;&amp;#039; priority.&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Normal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The thread can be scheduled after threads with &amp;#039;&amp;#039;&amp;#039;AboveNormal&amp;#039;&amp;#039;&amp;#039; priority and before those with &amp;#039;&amp;#039;&amp;#039;BelowNormal&amp;#039;&amp;#039;&amp;#039; priority. Threads have Normal priority by default.&lt;br /&gt;
|-&lt;br /&gt;
| -1&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;BelowNormal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The thread can be scheduled after threads with &amp;#039;&amp;#039;&amp;#039;Normal&amp;#039;&amp;#039;&amp;#039; priority and before those with &amp;#039;&amp;#039;&amp;#039;Lowest&amp;#039;&amp;#039;&amp;#039; priority.&lt;br /&gt;
|-&lt;br /&gt;
| -2&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Lowest&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The thread can be scheduled after threads with any other priority.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pop-up Menu&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Threads&amp;#039;&amp;#039;&amp;#039; window has the pop-up context menu. The same commands can be activated from the &amp;#039;&amp;#039;&amp;#039;Thread&amp;#039;&amp;#039;&amp;#039; sub-menu of the IDE task menu.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Threads_popup.png]]&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Goto Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Opens the text editor and places the cursor onto the predicate, which created the selected thread.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Set Current&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Sets the selected thread as current.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Resume&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Resumes the run of the selected thread.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Suspend&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Suspends the selected thread.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Copy&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Copies the contents of the line selected in the &amp;#039;&amp;#039;&amp;#039;Threads&amp;#039;&amp;#039;&amp;#039; window to the clipboard.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Copy All&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Copies the contents of the &amp;#039;&amp;#039;&amp;#039;Threads&amp;#039;&amp;#039;&amp;#039; window to the clipboard.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Threads&amp;#039;&amp;#039;&amp;#039; window is updated after changing any displayed parameter.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Threads&amp;#039;&amp;#039;&amp;#039; window can be activated either by &amp;#039;&amp;#039;&amp;#039;CTRL+Alt+H&amp;#039;&amp;#039;&amp;#039; or from the IDE menu &amp;#039;&amp;#039;&amp;#039;View | Threads&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Disassembly Window ===&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window shows the assembly language interpretation of the inspected code.&lt;br /&gt;
&lt;br /&gt;
The disassembly starts from the specified top address toward the upper memory and prints each instruction on a new line.&lt;br /&gt;
&lt;br /&gt;
Each line is printed by the pattern:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;LineMarkers&amp;gt; &amp;lt;Address&amp;gt; [ &amp;lt;HexCode&amp;gt; ] &amp;lt;AssemblerCommand&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;LineMarkers&amp;#039;&amp;#039;&lt;br /&gt;
:Are the {{ide|Debugger#Debug Menu Commands|&amp;#039;&amp;#039;instruction pointer&amp;#039;&amp;#039;}} [[Image:Ide_db_InstructionPointer.png]] and the breakpoint[[Image:Ide_db_BreakPoints_en.png]] (or [[Image:Ide_db_BreakPoints_dis.png]]) markers, which can mark this line.&lt;br /&gt;
&amp;#039;&amp;#039;Address&amp;#039;&amp;#039;&lt;br /&gt;
:The start address of the instruction code.&lt;br /&gt;
&amp;#039;&amp;#039;HexCode&amp;#039;&amp;#039;&lt;br /&gt;
:This is the hexadecimal instruction code. This field can be shown/hidden from the pop-up menu of the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window by checking the &amp;#039;&amp;#039;&amp;#039;Show OpCodes&amp;#039;&amp;#039;&amp;#039; item.&lt;br /&gt;
&amp;#039;&amp;#039;AssemblerCommand&amp;#039;&amp;#039;&lt;br /&gt;
:This is the assembler command corresponding to the instruction code. Assembler commands have the Intel standard assembler abbreviation. If a certain address is resolved to an external name, then this name will be printed in the command column.&lt;br /&gt;
:&amp;lt;br/&amp;gt;The instruction, which will be executed at the next trace step, is marked with the [[Image:Ide_db_InstructionPointer.png]] &amp;#039;&amp;#039;Instruction pointer&amp;#039;&amp;#039; in the &amp;#039;&amp;#039;LineMarkers&amp;#039;&amp;#039; field.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_DisAsm_View.png]]&lt;br /&gt;
&lt;br /&gt;
==== Pop-up Menu ====&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window has the pop-up context menu with the followin commands:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Go To Address&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Invokes the &amp;#039;&amp;#039;&amp;#039;Go to Address&amp;#039;&amp;#039;&amp;#039; dialog&lt;br /&gt;
*:[[Image:Ide_db_DisAsm_Go2Address.png]]&lt;br /&gt;
*:to type in the address of the instruction, which should be displayed in the top line of the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window. The &amp;#039;&amp;#039;Address&amp;#039;&amp;#039; should be specified in the hexadecimal format. This dialog allows typing symbolic external link names and symbolic CPU register names.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Go To EIP&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Updates the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window and places the cursor at the address of the instruction on which the program execution is suspended.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Breakpoint…&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Allows handling the breakpoint [[Image:Ide_db_BreakPoints_en.png]] (or [[Image:Ide_db_BreakPoints_dis.png]]) for the assembler instruction pointed by the cursor. It has the following sub-commands:&lt;br /&gt;
*:[[Image:Ide_db_DisAsm_PopUp.png]]&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Toggle Breakpoint&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Sets or removes a breakpoint at the instruction with the address pointed by the cursor.&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Enable / Disable&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:&amp;#039;&amp;#039;Enables / Disables&amp;#039;&amp;#039; the breakpoint pointed by the cursor. This item is disabled if there is no breakpoint at the address pointed by the cursor.&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Properties&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Invokes the &amp;#039;&amp;#039;&amp;#039;Breakpoint Properties&amp;#039;&amp;#039;&amp;#039; dialog for the breakpoint pointed by the cursor. This item is disabled if there is no breakpoint at the address pointed by the cursor.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Go To Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Activates the IDE source code editor and sets the cursor at the predicate whose assembler instruction is pointed by the cursor in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window. (When it is possible.)&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Copy&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Copies lines selected in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window to the clipboard. A selection can be performed with the &amp;#039;&amp;#039;&amp;#039;Shift+Up Arrow&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Shift+Down Arrow&amp;#039;&amp;#039;&amp;#039; key combinations.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Show OpCodes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Checking and unchecking this item hides/shows hex images of operation (instruction) codes (&amp;#039;&amp;#039;&amp;#039;OpCodes&amp;#039;&amp;#039;&amp;#039;). These hex instruction codes are shown in the &amp;#039;&amp;#039;HexCode&amp;#039;&amp;#039; field.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Source Annotation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Checking OFF/ON this item hides/shows object names, corresponding to predicate entry points. Each object name is printed on a new line before the corresponding instruction line.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Show Hints&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows additional information about the instruction being executed.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window is updated after each trace step of the debugger.&lt;br /&gt;
&lt;br /&gt;
==== Disassembly Window Commands ====&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Trace Into&amp;#039;&amp;#039;&amp;#039; command&lt;br /&gt;
*:Tracing in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window with the &amp;#039;&amp;#039;&amp;#039;Step Into&amp;#039;&amp;#039;&amp;#039; command performs execution of one assembler instruction (including entering into procedures if any). That is, if the &amp;#039;&amp;#039;&amp;#039;Step Over&amp;#039;&amp;#039;&amp;#039; command will execute a &amp;lt;vp&amp;gt;call&amp;lt;/vp&amp;gt; instruction as one trace step, then the &amp;#039;&amp;#039;&amp;#039;Step Into&amp;#039;&amp;#039;&amp;#039; command will go into the called procedure. It usually executes disassembler instructions line after line.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Step Over&amp;#039;&amp;#039;&amp;#039; command&lt;br /&gt;
*:Tracing in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window with the &amp;#039;&amp;#039;&amp;#039;Step Over&amp;#039;&amp;#039;&amp;#039;  command performs execution of one assembler instruction (including execution of &amp;lt;vp&amp;gt;call&amp;lt;/vp&amp;gt; instructions). So the &amp;#039;&amp;#039;&amp;#039;Step Over&amp;#039;&amp;#039;&amp;#039; command works almost the same way as the &amp;#039;&amp;#039;&amp;#039;Trace Into&amp;#039;&amp;#039;&amp;#039; command except for execution of &amp;lt;vp&amp;gt;call&amp;lt;/vp&amp;gt; instructions. In difference to the &amp;#039;&amp;#039;&amp;#039;Trace Into&amp;#039;&amp;#039;&amp;#039; command, it tries to perform &amp;lt;vp &amp;gt;call&amp;lt;/vp&amp;gt; instructions as one step and reaches the next line only if the called code returns to that line.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Run to Cursor&amp;#039;&amp;#039;&amp;#039; command&lt;br /&gt;
*:Tracing in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window with the &amp;#039;&amp;#039;&amp;#039;Run to Cursor&amp;#039;&amp;#039;&amp;#039; command works in the following way. The debugger places an invisible breakpoint at the address corresponding to the instruction specified by the cursor and performs the &amp;#039;&amp;#039;&amp;#039;Debug Run&amp;#039;&amp;#039;&amp;#039; command. It depends only upon the program code whether the program will reach this instruction or will never reach it.&lt;br /&gt;
&lt;br /&gt;
If the tracing code has no debug information, then the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window is opened initially (when the debugger starts) and the instruction pointer [[Image:Ide_db_InstructionPointer.png]] points to the executing assembler instruction.&lt;br /&gt;
&lt;br /&gt;
=== Registers Window ===&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Registers&amp;#039;&amp;#039;&amp;#039; window shows current values of the CPU (Central Processor Unit) registers:&lt;br /&gt;
&lt;br /&gt;
* General registers&lt;br /&gt;
* Segment registers&lt;br /&gt;
* Flags&lt;br /&gt;
* Floating-point registers&lt;br /&gt;
&lt;br /&gt;
A register value is printed:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:Red&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;red&amp;#039;&amp;#039;&amp;#039;&amp;lt;/span&amp;gt;, if it is changed from the last program trace step&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:Blue&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;blue&amp;#039;&amp;#039;&amp;#039;&amp;lt;/span&amp;gt;, otherwise.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Registers_fpu.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Floating Point&amp;#039;&amp;#039;&amp;#039; command from context pop-up menu can be used to turn ON/OFF the displaying of Floating-point registers.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Registers&amp;#039;&amp;#039;&amp;#039; window can be activated either by &amp;#039;&amp;#039;&amp;#039;Ctr+ Alt+G&amp;#039;&amp;#039;&amp;#039; or from the IDE menu &amp;#039;&amp;#039;&amp;#039;View | Registers&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Modules Window ===&lt;br /&gt;
----&lt;br /&gt;
The Modules Window shows all the modules currently loaded in this debug session. It shows the filename, path, the base address range, the code address range and the type of debug information.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Modules.png]]&lt;br /&gt;
&lt;br /&gt;
=== Memory Dump Window ===&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window shows the virtual memory dump of the program being debugged. Memory dump lines have the length, which is determined by the window width. The number of printed lines window height.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Information Displayed in the Memory Dump Window&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Each line in the &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window is printed by the pattern:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Address&amp;gt; | [ &amp;lt;HexValues&amp;gt; ] [ &amp;lt;ASCIIcharacters&amp;gt; ] [ &amp;lt;UnicodeCharacters&amp;gt;]&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Address&amp;#039;&amp;#039;&lt;br /&gt;
:This is the hexadecimal address of the first byte of the memory displayed in this line.&lt;br /&gt;
&amp;#039;&amp;#039;HexValues&amp;#039;&amp;#039;&lt;br /&gt;
:&amp;lt;vipbnf&amp;gt;&amp;lt;HexValues&amp;gt; : &amp;lt;HexValue&amp;gt; [ &amp;lt;HexValues&amp;gt; ]&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
:This is the hexadecimal format of the memory dump. Each hex value can be an image of one, two, four or eight continued memory bytes (this is contolled by the &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window content pop-up menu).&lt;br /&gt;
&amp;#039;&amp;#039;ASCIIcharacters&amp;#039;&amp;#039;&lt;br /&gt;
:&amp;lt;vipbnf&amp;gt;&amp;lt;ASCIIcharacters&amp;gt; : &amp;lt;ASCIIcharacter&amp;gt; [ &amp;lt;ASCIIcharacters&amp;gt; ]&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
:This is the same memory dump but in the format of ASCII characters (a character represenrs one byte). Unprintable characters are printed as dots.&lt;br /&gt;
&amp;#039;&amp;#039;UnicodeCharacters&amp;#039;&amp;#039;&lt;br /&gt;
:&amp;lt;vipbnf&amp;gt;&amp;lt;UnicodeCharacters&amp;gt; : &amp;lt;UnicodeCharacter&amp;gt; [ &amp;lt;UnicodeCharacters&amp;gt; ]&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
:This is the same memory dump in the format of Unicode characters (a character represents two bytes). Unprintable characters are printed as dots.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Memory_view1.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window title shows the module name, which memory is displayed in the window. If the module name cannot be determined, then the title displays &amp;#039;&amp;#039;Unknown module&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Content Pop-up Menu&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window has the pop-up context menu which contains commands:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Go To Address&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;Ctrl+G&amp;#039;&amp;#039;&amp;#039;. Invokes the &amp;#039;&amp;#039;&amp;#039;Go to Address&amp;#039;&amp;#039;&amp;#039; dialog&lt;br /&gt;
*:[[Image:Ide_db_DisAsm_Go2Address.png]]&lt;br /&gt;
*: to type a new top address in hex format. This dialog allows typing symbolic external link names and symbolic CPU register names. Double-click in the &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window area also activates the &amp;#039;&amp;#039;&amp;#039;Go to Address&amp;#039;&amp;#039;&amp;#039; dialog.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Go To &amp;#039;&amp;#039;Ptr&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;Ctrl+Shift+G&amp;#039;&amp;#039;&amp;#039;. Updates the &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window starting the first line from the address shown as &amp;#039;&amp;#039;Ptr&amp;#039;&amp;#039; (address defined by the memory contents of four or eight continued bytes at which the cursor is pointing if one of &amp;#039;&amp;#039;&amp;#039;4-byte Integer&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;8-byte Integer&amp;#039;&amp;#039;&amp;#039; is selected).&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Undo Go to&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;Alt+Left Arrow&amp;#039;&amp;#039;&amp;#039;. Updates the &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window view to start from the previously used top (the first line) address.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Redo Go to&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;Alt+Right Arrow&amp;#039;&amp;#039;&amp;#039;. This operation is the counterpart to the &amp;#039;&amp;#039;&amp;#039;Undo Go to&amp;#039;&amp;#039;&amp;#039;. It updates the &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window view to start from the &amp;quot;next&amp;quot; top address, which was used before the &amp;#039;&amp;#039;&amp;#039;Undo Go to&amp;#039;&amp;#039;&amp;#039; command was implemented.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Set Memory Breakpoint&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This operation sets a memory breakpoint at address from the left pane.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Remove Memory Breakpoint&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This operation removes a previously set a memory breakpoint.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Copy&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Copies the selected lines to the clipboard. To select a line, click on it while holding the &amp;#039;&amp;#039;&amp;#039;shift&amp;#039;&amp;#039;&amp;#039; key. You can select multiple lines at one time.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Copy &amp;#039;&amp;#039;Ptr&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;Ctrl+C&amp;#039;&amp;#039;&amp;#039;. Copies hexadecimal representation of the specified address (four or eight bytes) to the clipboard.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Refresh&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Refresh the &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window contents.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Write Block&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This command opens the &amp;#039;&amp;#039;&amp;#039;Write Memory Block&amp;#039;&amp;#039;&amp;#039; dialog:&lt;br /&gt;
*:[[Image:Ide_db_Memory_BlockWrite.png]]&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Filename&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Here you should type in the name of a file in which the specified memory block should be saved.&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Start Address&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Here you should specify a hexadecimal start address of the memory block.&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Length&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Here you should specify a hexadecimal length in bytes of the memory block.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Show Hex&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows the column, which displays the memory dump in the hexadecimal format. This is the {{ide|Debugger#Debugger Views|&amp;#039;&amp;#039;HexValues&amp;#039;&amp;#039;}} column in the right pane.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Show ASCII&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows the column, which displays the &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;ASCII&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; format of the memory dump. This is the {{ide|Debugger#Debugger Views|&amp;#039;&amp;#039;ASCIIcharacters&amp;#039;&amp;#039;}} column in the right pane.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Show Unicode&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows the column, which displays the &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Unicode&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; format of the memory dump. This is the {{ide|Debugger#Debugger Views|&amp;#039;&amp;#039;UnicodeCharacters&amp;#039;&amp;#039;}} column in the right pane.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Update Speed...&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Defines the rate of the Memory Dump window updating:&lt;br /&gt;
*:[[Image:iDE_db_Memory_menu1.png]]&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;High&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Performs automatic updating with the high rate.&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Normal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Performs automatic updating with normal rate.&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Low&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Performs automatic updating with low rate.&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Manual&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:No automatic updating.&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window can be activated either by &amp;#039;&amp;#039;&amp;#039;CTRL+Alt+M&amp;#039;&amp;#039;&amp;#039; or from the IDE menu &amp;#039;&amp;#039;&amp;#039;View | Memory Dump&amp;#039;&amp;#039;&amp;#039;.&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Ide/Debugger/Debugger_Views&amp;diff=3709</id>
		<title>Ide/Debugger/Debugger Views</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Ide/Debugger/Debugger_Views&amp;diff=3709"/>
		<updated>2013-07-08T11:08:31Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: /* Breakpoint Properties */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;[[Category:Ide/Debugger]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
== Debugger Views ==&lt;br /&gt;
&lt;br /&gt;
=== Run Stack Window ===&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; consists of three kinds of items:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Continue&amp;#039;&amp;#039;&amp;#039; item – marked with [[Image:Ide_db_RunStack_up.png]]. It describes ordinary executable clauses, which do not produce backtrack points and are not trapped.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;BackTrack&amp;#039;&amp;#039;&amp;#039; item – marked with [[Image:Ide_db_RunStack_dn.png]].It describes a clause of a nondeterministic predicate. The next clause of this predicate can be executed when a program failure of this clause occurs. Such items occur when a clause of a predicate, which creates a &amp;#039;&amp;#039;&amp;#039;backtrack&amp;#039;&amp;#039;&amp;#039; point (can produce more than one solution) is called.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;TrapTrack&amp;#039;&amp;#039;&amp;#039; item – marked with [[Image:Ide_db_RunStack_rh.png]] or [[Image:Ide_db_RunStack_dn_rh.png]]. They describe a continue item (clause), which will be resumed in any case independently whether an error condition occurs or no. For example, such item is created when a predicate call is trapped with the &amp;lt;vp&amp;gt;trap/3&amp;lt;/vp&amp;gt; predicate. The [[Image:Ide_db_RunStack_rh.png]] icon is used to mark trapped clauses of deterministic predicates. The [[Image:Ide_db_RunStack_dn_rh.png]] icon is used to mark trapped clauses of nondeterministic predicates.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;BackTrack&amp;#039;&amp;#039;&amp;#039; (marked with [[Image:Ide_db_RunStack_dn.png]]) and &amp;#039;&amp;#039;&amp;#039;TrapTrack&amp;#039;&amp;#039;&amp;#039; items (marked with [[Image:Ide_db_RunStack_dn_rh.png]]) are backtracking points. The clause, marked by one of these items, will be resumed and the program execution will be continued after the corresponding failure or an error occurs.&lt;br /&gt;
&lt;br /&gt;
The typical example of the &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; window is presented in the following picture:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_RunStack.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pop-up Menu&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; window has the pop-up context menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_RunStack_menu.png]]&lt;br /&gt;
&lt;br /&gt;
For each selected item in the tree, this menu contains items:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Refresh&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:It refreshes all the &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; window contents, rebuilds the tree.&lt;br /&gt;
*:&amp;lt;br/&amp;gt;It also refreshes the {{ide|Debugger#Variables Window|&amp;#039;&amp;#039;&amp;#039;Variables&amp;#039;&amp;#039;&amp;#039;}} window (if it is displayed).&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Go To Code&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Activates the Prolog source editor and places the cursor at the Prolog clause corresponding to the item selected in the &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; window. If the item does not correspond to a Prolog module with debug information, then the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window will be opened and the cursor will be placed onto the corresponding assembler instruction. The same action is caused by double-click a predicate call in the &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; window.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Copy Line&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:It copies the selected line contents to the clipboard.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Show Domains&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This option turns ON/OFF displaying domains of variables.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Show Values&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This option turns ON/OFF displaying values of variables.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; window can be activated by the IDE menu &amp;#039;&amp;#039;&amp;#039;View | Run Stack&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Variables Window ===&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Variables&amp;#039;&amp;#039;&amp;#039; window can be activated either by &amp;#039;&amp;#039;&amp;#039;Ctrl+Alt+V&amp;#039;&amp;#039;&amp;#039; or from the IDE menu &amp;#039;&amp;#039;&amp;#039;View | Variables for Current Clause&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Variables Window Contents&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Variables&amp;#039;&amp;#039;&amp;#039; window displays the tree of all program variables and facts from the traced clause, which are already created by the program at the current tracing step. These are: all variables and all object facts (fact variables), which are created in the clause before the executing instruction, and all class facts (fact variables), which can be used in this clause (declared in this class implementation).&lt;br /&gt;
&lt;br /&gt;
The top line of the window displays the declaration of the predicate, whose clause is executed.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Vars_Top.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Variables&amp;#039;&amp;#039;&amp;#039; window content is updated after every trace step.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pop-up Context Menu&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Variables in the Current Clause&amp;#039;&amp;#039;&amp;#039; window has the following pop-up context menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Vars_Menu.png]]&lt;br /&gt;
&lt;br /&gt;
This menu contains items:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Insert into Watch Window&amp;#039;&amp;#039;&lt;br /&gt;
*:Opens the &amp;#039;&amp;#039;&amp;#039;Watch Window&amp;#039;&amp;#039;&amp;#039; and moves there selected variable.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Copy&amp;#039;&amp;#039;&lt;br /&gt;
*:This command copies the contents of the line selected in the &amp;#039;&amp;#039;&amp;#039;Variables&amp;#039;&amp;#039;&amp;#039; window to the clipboard.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show as Hexadecimal&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows integral values in the hexadecimal format.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show as Decimal&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows integral values in the decimal format.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show as Octal&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows integral values in the octal format.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show Domains&amp;#039;&amp;#039;&lt;br /&gt;
*:This option turns &amp;#039;&amp;#039;&amp;#039;ON/OFF&amp;#039;&amp;#039;&amp;#039; displaying the domains after variable names.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show Variable Addresses&amp;#039;&amp;#039;&lt;br /&gt;
*:This option turns &amp;#039;&amp;#039;&amp;#039;ON/OFF&amp;#039;&amp;#039;&amp;#039; displaying the addresses after variable names.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Find&amp;#039;&amp;#039;&lt;br /&gt;
*:This command allows search variable by name.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Copy Tree&amp;#039;&amp;#039;&lt;br /&gt;
*:This command copies the contents of the window to the clipboard.&lt;br /&gt;
&lt;br /&gt;
=== Facts Window ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Class Facts&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Facts&amp;#039;&amp;#039;&amp;#039; window always shows the current contents of all &amp;#039;&amp;#039;&amp;#039;class&amp;#039;&amp;#039;&amp;#039; fact databases defined in the program being debugged.&lt;br /&gt;
&lt;br /&gt;
Simple example:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Facts_View.png]]&lt;br /&gt;
&lt;br /&gt;
Pressing &amp;#039;&amp;#039;&amp;#039;CTRL+ALT+F&amp;#039;&amp;#039;&amp;#039; opens &amp;#039;&amp;#039;&amp;#039;Facts&amp;#039;&amp;#039;&amp;#039; window:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Facts_View3.png]]&lt;br /&gt;
&lt;br /&gt;
Clicking icons opens sub-trees:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Facts_View4.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Facts&amp;#039;&amp;#039;&amp;#039; window automatically goes to the fact that is selected in the text editor (if any):&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Facts_View11.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Facts_View41.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Objects Facts&amp;#039;&amp;#039;&amp;#039; you cat look like a components of object variables in the {{ide|Debugger#Variables Window|&amp;#039;&amp;#039;&amp;#039;Variables&amp;#039;&amp;#039;&amp;#039; window}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pop-up Context Menu&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Facts Window&amp;#039;&amp;#039;&amp;#039; has the following pop-up context menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Vars_Menu.png]]&lt;br /&gt;
&lt;br /&gt;
This menu contains items:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Insert into Watch Window&amp;#039;&amp;#039;&lt;br /&gt;
*:Opens the &amp;#039;&amp;#039;&amp;#039;Watch Window&amp;#039;&amp;#039;&amp;#039; and moves there selected fact.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Copy&amp;#039;&amp;#039;&lt;br /&gt;
*:This command copies the contents of the line selected in the &amp;#039;&amp;#039;&amp;#039;Facts&amp;#039;&amp;#039;&amp;#039; window to the clipboard.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show as Hexadecimal&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows integral values in the hexadecimal format.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show as Decimal&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows integral values in the decimal format.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show as Octal&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows integral values in the octal format.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show Domains&amp;#039;&amp;#039;&lt;br /&gt;
*:This option turns &amp;#039;&amp;#039;&amp;#039;ON/OFF&amp;#039;&amp;#039;&amp;#039; displaying the domains after facts names.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Show Addresses&amp;#039;&amp;#039;&lt;br /&gt;
*:This option turns &amp;#039;&amp;#039;&amp;#039;ON/OFF&amp;#039;&amp;#039;&amp;#039; displaying the addresses after facts names.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Find&amp;#039;&amp;#039;&lt;br /&gt;
*:This command allows search fact by name.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Copy Tree&amp;#039;&amp;#039;&lt;br /&gt;
*:This command copies the contents of the window to the clipboard.&lt;br /&gt;
&lt;br /&gt;
=== Breakpoints Window ===&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Breakpoints&amp;#039;&amp;#039;&amp;#039; window shows all breakpoints, which have been set in the program being debugged.&lt;br /&gt;
&lt;br /&gt;
You can set a breakpoint onto any executable line in program source files (or in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window, where a breakpoint can be set on any instruction of the program being debugged).&lt;br /&gt;
&lt;br /&gt;
There are two kinds of breakpoints: hard and soft. Hard breakpoints are active in any debugging mode. Soft breakpoints are active in normal debugging mode but disabled in a special mode of quick debugging, called &amp;#039;&amp;#039;Fast Forward Mode&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== Breakpoints Window Contents ====&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Breakpoints&amp;#039;&amp;#039;&amp;#039; window for each breakpoint includes &amp;#039;&amp;#039;&amp;#039;Status&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Line&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Count&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Comment&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Action&amp;#039;&amp;#039;&amp;#039;, where:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Status&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows whether the breakpoint is &amp;#039;&amp;#039;hard&amp;#039;&amp;#039; or &amp;#039;&amp;#039;soft&amp;#039;&amp;#039;.&lt;br /&gt;
**&amp;#039;&amp;#039;Hard&amp;#039;&amp;#039;&lt;br /&gt;
**:If a breakpoint is &amp;#039;&amp;#039;hard&amp;#039;&amp;#039; then it will be activated in any debugging mode. A hard breakpoint is marked with the filled circle [[Image:Ide_db_BreakPoints_en.png]] or [[Image:Ide_db_BreakPoints_assembler.png]] (for assembler) or [[Image:Ide_db_BreakPoints_shifted.png]] (for relocated breakpoint).&lt;br /&gt;
**&amp;#039;&amp;#039;Soft&amp;#039;&amp;#039;&lt;br /&gt;
**:If a breakpoint is &amp;#039;&amp;#039;soft&amp;#039;&amp;#039; then it will be activated only in normal (not Fast Forward) debugging mode. A soft breakpoint is marked with the hollow circle [[Image:Ide_db_BreakPoints_dis.png]] or [[Image:Ide_db_BreakPoints_assembler_disabled.png]] (for assembler).&lt;br /&gt;
**&amp;#039;&amp;#039;Invalid&amp;#039;&amp;#039;&lt;br /&gt;
**:A breakpoint is invalid when it is set on a line, which does not contain executable code. An invalid breakpoint is marked with the crossed hollow circle [[Image:Ide_db_BreakPoints_invalid.png]].&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This column shows the source string:&lt;br /&gt;
*:&amp;lt;vipbnf&amp;gt;&amp;lt;SourceName&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*:where:&lt;br /&gt;
*:&amp;#039;&amp;#039;SourceName&amp;#039;&amp;#039;&lt;br /&gt;
*:The description of a predicate in the address space of whose clauses the breakpoint is set:&lt;br /&gt;
*:*If the breakpoint is set in Prolog sources, then &amp;#039;&amp;#039;SourceName&amp;#039;&amp;#039; is the filename in which the breakpoint is set. It is displayed with the format:&lt;br /&gt;
*::&amp;lt;vipbnf&amp;gt;&amp;lt;FileName&amp;gt; &amp;#039;(&amp;#039; &amp;lt;Path&amp;gt; &amp;#039;)&amp;#039;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*::The &amp;#039;&amp;#039;Path&amp;#039;&amp;#039; can use {{ide|Make Facility#Build Symbols|Build script symbols}}.&lt;br /&gt;
*:* If the breakpoint is set in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window, then &amp;#039;&amp;#039;SourceName&amp;#039;&amp;#039; has the format:&lt;br /&gt;
*::&amp;lt;vipbnf&amp;gt;--- assembler: &amp;lt;AddressValue&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*::&amp;#039;&amp;#039;AddressValue&amp;#039;&amp;#039; is the hexadecimal address of the breakpoint in the assembler code of the predicate in which the breakpoint is set.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Line&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:When the breakpoint is set in a Prolog source file, then this column displays the number of the line the breakpoint is set on. &amp;lt;br /&amp;gt; When the breakpoint is set in the Disassembly window, then the number of the line is equal to 0.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Count&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This column displays {{ide|Debugger#Breakpoint Properties|counts}} of breakpoints.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Comment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This column displays {{ide|Debugger#Breakpoint Properties|comment strings}} of breakpoints.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Action&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This column displays the script text of a breakpoint. The script is performed each time the program reaches the breakpoint.&lt;br /&gt;
&lt;br /&gt;
==== Breakpoints in Prolog and Disassembly Windows ====&lt;br /&gt;
&lt;br /&gt;
Breakpoints can be set in Prolog source files and in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window:&lt;br /&gt;
&lt;br /&gt;
* In Prolog sources valid breakpoints can be set only on lines containing executable instructions. That is, breakpoints can be set only in predicate clauses on lines containing predicate calls, otherwise the breakpoints that are set on non-clause lines would be marked as invalid. The breakpoints that are set on clause lines that do not contain predicate calls would be shifted to the lines containing such calls (if any), but the initial line would be marked with [[Image:Ide_db_BreakPoints_shifted.png]]. Valid breakpoints are marked with red circles [[Image:Ide_db_BreakPoints_en.png]] or [[Image:Ide_db_BreakPoints_dis.png]] in Prolog sources and are shown in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window as blue circles [[Image:Ide_db_BreakPoints_assembler.png]] or [[Image:Ide_db_BreakPoints_assembler_disabled.png]]. If a Prolog clause has several assembler implementations (when the clause has several flow patterns), then each breakpoint in Prolog sources can generate several breakpoints in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window.&lt;br /&gt;
* Breakpoints that are set in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window are marked with red circles [[Image:Ide_db_BreakPoints_en.png]] or [[Image:Ide_db_BreakPoints_dis.png]]. Such breakpoint can be later overwritten by a breakpoint (marked with blue circles [[Image:Ide_db_BreakPoints_assembler.png]] or [[Image:Ide_db_BreakPoints_assembler_disabled.png]]) that is set in Prolog sources on the same address as the breakpoint set in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window.&amp;lt;br /&amp;gt; Notice that after modification and recompilation of the project some breakpoints that are set in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window can be cleared (if other instructions are placed at breakpoint addresses.)&lt;br /&gt;
&lt;br /&gt;
All breakpoints which are set in a program are seen in the &amp;#039;&amp;#039;&amp;#039;Breakpoints&amp;#039;&amp;#039;&amp;#039; window.&lt;br /&gt;
&lt;br /&gt;
==== Breakpoint Properties ====&lt;br /&gt;
&lt;br /&gt;
Each breakpoint has properties, which can be modified in the &amp;#039;&amp;#039;&amp;#039;Breakpoint Properties&amp;#039;&amp;#039;&amp;#039; dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_BreakPoint_Properties.png]]&lt;br /&gt;
&lt;br /&gt;
In this dialog:&lt;br /&gt;
&lt;br /&gt;
The top line contains:&lt;br /&gt;
&lt;br /&gt;
* If the breakpoint is set in Prolog sources, then the top line has format:&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;&amp;lt;vipbnf&amp;gt;File: &amp;lt;FileName&amp;gt; Line: &amp;lt;LineNumber&amp;gt;&amp;lt;/vipbnf&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;#039;&amp;#039;FileName&amp;#039;&amp;#039; is the name of the Prolog source file in which the breakpoint is set.&lt;br /&gt;
*:&amp;#039;&amp;#039;LineNumber&amp;#039;&amp;#039; is the number of the line on which the breakpoint is set.&lt;br /&gt;
&lt;br /&gt;
* If the breakpoint is set in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window, then the top line has format:&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;&amp;lt;vipbnf&amp;gt;Breakpoint Address:&amp;lt;Address&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*:&amp;#039;&amp;#039;Address&amp;#039;&amp;#039; is the breakpoint address in the program memory as it is seen in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hard&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:This check box controls the &amp;#039;&amp;#039;Hard/Soft&amp;#039;&amp;#039; state of the breakpoint. When you turn a breakpoint to Hard, then it will be activated in any debugging mode. When you turn a breakpoint to Soft, then it will be activated only in normal (not Fast Forward) debugging mode.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Counter&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;Value&amp;#039;&amp;#039;&lt;br /&gt;
:Shows the current number of activations of the breakpoint since its creation. The user cannot modify this value. This value increases by 1 each time when the program reaches the breakpoint. And resets to 0 at the beginning of the debug session.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Comment&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;Comment string&amp;#039;&amp;#039;&lt;br /&gt;
:In this edit box you can type in a &amp;#039;&amp;#039;Comment string&amp;#039;&amp;#039;. By default it has the value of the corresponding line in the source file.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Action&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;Script text&amp;#039;&amp;#039;&lt;br /&gt;
:In this box you can type in a &amp;#039;&amp;#039;Script text&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== Pop-up Menu ====&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Breakpoints&amp;#039;&amp;#039;&amp;#039; window has the pop-up context menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_BreakPoints_pop_up.png]]&lt;br /&gt;
&lt;br /&gt;
To activate this menu, select a breakpoint and press the right mouse button. This menu contains items:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Go to Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:If the breakpoint is set in the Prolog sources, then the &amp;#039;&amp;#039;&amp;#039;Go to Code&amp;#039;&amp;#039;&amp;#039; activates the Prolog source code editor, and moves the cursor to the Prolog code corresponding to the specified breakpoint. If the breakpoint is set in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window, then the &amp;#039;&amp;#039;&amp;#039;Go to Code&amp;#039;&amp;#039;&amp;#039; moves the view to this breakpoint in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window. The same action is performed by double-click the breakpoint or by pressing the &amp;#039;&amp;#039;&amp;#039;Enter&amp;#039;&amp;#039;&amp;#039; on the breakpoint.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Properties&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Invokes the {{ide|Debugger#Breakpoint Properties|&amp;#039;&amp;#039;&amp;#039;Breakpoint Properties&amp;#039;&amp;#039;&amp;#039;}} dialog for the selected breakpoint.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Toggle (Turn to Hard/Soft)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Switches the &amp;#039;&amp;#039;Hard/Soft&amp;#039;&amp;#039; state of the selected breakpoints.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Deletes the selected breakpoints.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Turn to Hard All&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Sets the state of all breakpoints that are set in the program to &amp;#039;&amp;#039;Hard&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Turn to Soft All&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Sets the state of all breakpoints that are set in the program to &amp;#039;&amp;#039;Soft&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Remove All&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Removes all breakpoints that are set in the program.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Breakpoints&amp;#039;&amp;#039;&amp;#039; window is auto-updated for any breakpoint updating.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Breakpoints&amp;#039;&amp;#039;&amp;#039; window can be activated either by &amp;#039;&amp;#039;&amp;#039;Ctrl+Alt+B&amp;#039;&amp;#039;&amp;#039; or from the IDE menu &amp;#039;&amp;#039;&amp;#039;View | Breakpoints&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Threads Window ===&lt;br /&gt;
----&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Threads&amp;#039;&amp;#039;&amp;#039; window shows information about the process being debugged and its threads.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Threads&amp;#039;&amp;#039;&amp;#039; window looks like following:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Threads.png]]&lt;br /&gt;
&lt;br /&gt;
Names displayed in the header of the window columns are the following:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;TID&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This column displays thread identifiers of all threads created by the process being debugged.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Current&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This column identifies the current thread by the &amp;lt;vp&amp;gt;*&amp;lt;/vp&amp;gt; sign. In the {{ide|Debugger#Variables Window|Variables}} window you can see only variables of predicates executed in the current thread.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;State&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Displays states of threads. States can be &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Running&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Stopped&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Suspend&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
*:&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Running&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;  The thread has been started, it is not suspended (see &amp;lt;vp&amp;gt;thread::suspend/0-&amp;gt;&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt; syncObject::wait/0-&amp;gt;&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;syncObject::wait/1-&amp;gt;&amp;lt;/vp&amp;gt;) or terminated (see &amp;lt;vp&amp;gt;thread::terminate/1&amp;lt;/vp&amp;gt;).&lt;br /&gt;
*:&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Suspend&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;  The thread is in suspended state (see &amp;lt;vp&amp;gt;thread::createSuspended/3&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;thread::suspend/0-&amp;gt;&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;syncObject::wait/0-&amp;gt;&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;syncObject::wait/1-&amp;gt;&amp;lt;/vp&amp;gt;).&lt;br /&gt;
*:&amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Stopped&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; The thread was created and then stopped on a breakpoint, but it is not suspended (see &amp;lt;vp&amp;gt;thread::suspend/0-&amp;gt;&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;syncObject::wait/0-&amp;gt;&amp;lt;/vp&amp;gt;, &amp;lt;vp&amp;gt;syncObject::wait/1-&amp;gt;&amp;lt;/vp&amp;gt;). If you set suspended state to a &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Stopped&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; thread, then it turns into the &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Suspend&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; state.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Thread creation time.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;User time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Processor time in the user-mode used by the thread.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Kernel Time&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Processor time in the kernel-mode used by the thread.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Priority&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:The priority level of the thread. Here can be displayed the following numbers &amp;lt;vp&amp;gt;2, 1, 0, -1, -2&amp;lt;/vp&amp;gt;.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Predicate&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This field contains the name of the currently executed thread&amp;#039;s predicate (if it is possible to determine it).&lt;br /&gt;
&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
! Displayed Number&lt;br /&gt;
! Priority Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Highest&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The thread can be scheduled before threads with any other priority.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;AboveNormal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The thread can be scheduled after threads with &amp;#039;&amp;#039;&amp;#039;Highest&amp;#039;&amp;#039;&amp;#039; priority and before those with &amp;#039;&amp;#039;&amp;#039;Normal&amp;#039;&amp;#039;&amp;#039; priority.&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Normal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The thread can be scheduled after threads with &amp;#039;&amp;#039;&amp;#039;AboveNormal&amp;#039;&amp;#039;&amp;#039; priority and before those with &amp;#039;&amp;#039;&amp;#039;BelowNormal&amp;#039;&amp;#039;&amp;#039; priority. Threads have Normal priority by default.&lt;br /&gt;
|-&lt;br /&gt;
| -1&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;BelowNormal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The thread can be scheduled after threads with &amp;#039;&amp;#039;&amp;#039;Normal&amp;#039;&amp;#039;&amp;#039; priority and before those with &amp;#039;&amp;#039;&amp;#039;Lowest&amp;#039;&amp;#039;&amp;#039; priority.&lt;br /&gt;
|-&lt;br /&gt;
| -2&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Lowest&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The thread can be scheduled after threads with any other priority.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pop-up Menu&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Threads&amp;#039;&amp;#039;&amp;#039; window has the pop-up context menu. The same commands can be activated from the &amp;#039;&amp;#039;&amp;#039;Thread&amp;#039;&amp;#039;&amp;#039; sub-menu of the IDE task menu.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Threads_popup.png]]&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Goto Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Opens the text editor and places the cursor onto the predicate, which created the selected thread.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Set Current&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Sets the selected thread as current.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Resume&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Resumes the run of the selected thread.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Suspend&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Suspends the selected thread.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Copy&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Copies the contents of the line selected in the &amp;#039;&amp;#039;&amp;#039;Threads&amp;#039;&amp;#039;&amp;#039; window to the clipboard.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Copy All&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Copies the contents of the &amp;#039;&amp;#039;&amp;#039;Threads&amp;#039;&amp;#039;&amp;#039; window to the clipboard.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Threads&amp;#039;&amp;#039;&amp;#039; window is updated after changing any displayed parameter.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Threads&amp;#039;&amp;#039;&amp;#039; window can be activated either by &amp;#039;&amp;#039;&amp;#039;CTRL+Alt+H&amp;#039;&amp;#039;&amp;#039; or from the IDE menu &amp;#039;&amp;#039;&amp;#039;View | Threads&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Disassembly Window ===&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window shows the assembly language interpretation of the inspected code.&lt;br /&gt;
&lt;br /&gt;
The disassembly starts from the specified top address toward the upper memory and prints each instruction on a new line.&lt;br /&gt;
&lt;br /&gt;
Each line is printed by the pattern:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;LineMarkers&amp;gt; &amp;lt;Address&amp;gt; [ &amp;lt;HexCode&amp;gt; ] &amp;lt;AssemblerCommand&amp;gt;&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;LineMarkers&amp;#039;&amp;#039;&lt;br /&gt;
:Are the {{ide|Debugger#Debug Menu Commands|&amp;#039;&amp;#039;instruction pointer&amp;#039;&amp;#039;}} [[Image:Ide_db_InstructionPointer.png]] and the breakpoint[[Image:Ide_db_BreakPoints_en.png]] (or [[Image:Ide_db_BreakPoints_dis.png]]) markers, which can mark this line.&lt;br /&gt;
&amp;#039;&amp;#039;Address&amp;#039;&amp;#039;&lt;br /&gt;
:The start address of the instruction code.&lt;br /&gt;
&amp;#039;&amp;#039;HexCode&amp;#039;&amp;#039;&lt;br /&gt;
:This is the hexadecimal instruction code. This field can be shown/hidden from the pop-up menu of the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window by checking the &amp;#039;&amp;#039;&amp;#039;Show OpCodes&amp;#039;&amp;#039;&amp;#039; item.&lt;br /&gt;
&amp;#039;&amp;#039;AssemblerCommand&amp;#039;&amp;#039;&lt;br /&gt;
:This is the assembler command corresponding to the instruction code. Assembler commands have the Intel standard assembler abbreviation. If a certain address is resolved to an external name, then this name will be printed in the command column.&lt;br /&gt;
:&amp;lt;br/&amp;gt;The instruction, which will be executed at the next trace step, is marked with the [[Image:Ide_db_InstructionPointer.png]] &amp;#039;&amp;#039;Instruction pointer&amp;#039;&amp;#039; in the &amp;#039;&amp;#039;LineMarkers&amp;#039;&amp;#039; field.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_DisAsm_View.png]]&lt;br /&gt;
&lt;br /&gt;
==== Pop-up Menu ====&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window has the pop-up context menu with the followin commands:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Go To Address&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Invokes the &amp;#039;&amp;#039;&amp;#039;Go to Address&amp;#039;&amp;#039;&amp;#039; dialog&lt;br /&gt;
*:[[Image:Ide_db_DisAsm_Go2Address.png]]&lt;br /&gt;
*:to type in the address of the instruction, which should be displayed in the top line of the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window. The &amp;#039;&amp;#039;Address&amp;#039;&amp;#039; should be specified in the hexadecimal format. This dialog allows typing symbolic external link names and symbolic CPU register names.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Go To EIP&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Updates the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window and places the cursor at the address of the instruction on which the program execution is suspended.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Breakpoint…&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Allows handling the breakpoint [[Image:Ide_db_BreakPoints_en.png]] (or [[Image:Ide_db_BreakPoints_dis.png]]) for the assembler instruction pointed by the cursor. It has the following sub-commands:&lt;br /&gt;
*:[[Image:Ide_db_DisAsm_PopUp.png]]&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Toggle Breakpoint&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Sets or removes a breakpoint at the instruction with the address pointed by the cursor.&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Enable / Disable&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:&amp;#039;&amp;#039;Enables / Disables&amp;#039;&amp;#039; the breakpoint pointed by the cursor. This item is disabled if there is no breakpoint at the address pointed by the cursor.&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Properties&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Invokes the &amp;#039;&amp;#039;&amp;#039;Breakpoint Properties&amp;#039;&amp;#039;&amp;#039; dialog for the breakpoint pointed by the cursor. This item is disabled if there is no breakpoint at the address pointed by the cursor.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Go To Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Activates the IDE source code editor and sets the cursor at the predicate whose assembler instruction is pointed by the cursor in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window. (When it is possible.)&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Copy&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Copies lines selected in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window to the clipboard. A selection can be performed with the &amp;#039;&amp;#039;&amp;#039;Shift+Up Arrow&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Shift+Down Arrow&amp;#039;&amp;#039;&amp;#039; key combinations.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Show OpCodes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Checking and unchecking this item hides/shows hex images of operation (instruction) codes (&amp;#039;&amp;#039;&amp;#039;OpCodes&amp;#039;&amp;#039;&amp;#039;). These hex instruction codes are shown in the &amp;#039;&amp;#039;HexCode&amp;#039;&amp;#039; field.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Source Annotation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Checking OFF/ON this item hides/shows object names, corresponding to predicate entry points. Each object name is printed on a new line before the corresponding instruction line.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Show Hints&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows additional information about the instruction being executed.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window is updated after each trace step of the debugger.&lt;br /&gt;
&lt;br /&gt;
==== Disassembly Window Commands ====&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Trace Into&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;F11&amp;#039;&amp;#039;&amp;#039;) command&lt;br /&gt;
*:Tracing in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window with the &amp;#039;&amp;#039;&amp;#039;Step Into&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;F7&amp;#039;&amp;#039;&amp;#039;) command performs execution of one assembler instruction (including entering into procedures if any). That is, if the &amp;#039;&amp;#039;&amp;#039;Step Over&amp;#039;&amp;#039;&amp;#039; command will execute a &amp;lt;vp&amp;gt;call&amp;lt;/vp&amp;gt; instruction as one trace step, then the &amp;#039;&amp;#039;&amp;#039;Step Into&amp;#039;&amp;#039;&amp;#039; command will go into the called procedure. It usually executes disassembler instructions line after line.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Step Over&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;F10&amp;#039;&amp;#039;&amp;#039;) command&lt;br /&gt;
*:Tracing in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window with the &amp;#039;&amp;#039;&amp;#039;Step Over&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;F10)&amp;#039;&amp;#039;&amp;#039; command performs execution of one assembler instruction (including execution of &amp;lt;vp&amp;gt;call&amp;lt;/vp&amp;gt; instructions). So the &amp;#039;&amp;#039;&amp;#039;Step Over&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;F10&amp;#039;&amp;#039;&amp;#039;) command works almost the same way as the &amp;#039;&amp;#039;&amp;#039;Trace Into&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;F11&amp;#039;&amp;#039;&amp;#039;) command except for execution of &amp;lt;vp&amp;gt;call&amp;lt;/vp&amp;gt; instructions. In difference to the &amp;#039;&amp;#039;&amp;#039;Trace Into&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;F11&amp;#039;&amp;#039;&amp;#039;) command, it tries to perform &amp;lt;vp &amp;gt;call&amp;lt;/vp&amp;gt; instructions as one step and reaches the next line only if the called code returns to that line.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Run to Cursor&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;CTRL+F10&amp;#039;&amp;#039;&amp;#039;) command&lt;br /&gt;
*:Tracing in the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window with the &amp;#039;&amp;#039;&amp;#039;Run to Cursor&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;CTRL+F10&amp;#039;&amp;#039;&amp;#039;) command works in the following way. The debugger places an invisible breakpoint at the address corresponding to the instruction specified by the cursor and performs the &amp;#039;&amp;#039;&amp;#039;Debug Run&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;F5&amp;#039;&amp;#039;&amp;#039;) command. It depends only upon the program code whether the program will reach this instruction or will never reach it.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window can be activated:&lt;br /&gt;
&lt;br /&gt;
* by &amp;#039;&amp;#039;&amp;#039;Shift+Alt+1&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* by &amp;#039;&amp;#039;&amp;#039;Ctrl+D&amp;#039;&amp;#039;&amp;#039; from the traceable source code. The topmost line of the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window displays the address of the disassembler instruction corresponding to the predicate pointed by the cursor in the source code.&lt;br /&gt;
* from the IDE menu &amp;#039;&amp;#039;&amp;#039;View | Disassembly&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If the tracing code has no debug information, then the &amp;#039;&amp;#039;&amp;#039;Disassembly&amp;#039;&amp;#039;&amp;#039; window is opened initially (when the debugger starts) and the instruction pointer [[Image:Ide_db_InstructionPointer.png]] points to the executing assembler instruction.&lt;br /&gt;
&lt;br /&gt;
=== Registers Window ===&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Registers&amp;#039;&amp;#039;&amp;#039; window shows current values of the CPU (Central Processor Unit) registers:&lt;br /&gt;
&lt;br /&gt;
* General registers&lt;br /&gt;
* Segment registers&lt;br /&gt;
* Flags&lt;br /&gt;
* Floating-point registers&lt;br /&gt;
&lt;br /&gt;
A register value is printed:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:Red&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;red&amp;#039;&amp;#039;&amp;#039;&amp;lt;/span&amp;gt;, if it is changed from the last program trace step&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:Blue&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;blue&amp;#039;&amp;#039;&amp;#039;&amp;lt;/span&amp;gt;, otherwise.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Registers_fpu.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Floating Point&amp;#039;&amp;#039;&amp;#039; command from context pop-up menu can be used to turn ON/OFF the displaying of Floating-point registers.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Registers&amp;#039;&amp;#039;&amp;#039; window can be activated either by &amp;#039;&amp;#039;&amp;#039;Ctr+ Alt+G&amp;#039;&amp;#039;&amp;#039; or from the IDE menu &amp;#039;&amp;#039;&amp;#039;View | Registers&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Modules Window ===&lt;br /&gt;
----&lt;br /&gt;
The Modules Window shows all the modules currently loaded in this debug session. It shows the filename, path, the base address range, the code address range and the type of debug information.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Modules.png]]&lt;br /&gt;
&lt;br /&gt;
=== Memory Dump Window ===&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window shows the virtual memory dump of the program being debugged. Memory dump lines have the length, which is determined by the window width. The number of printed lines window height.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Information Displayed in the Memory Dump Window&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Each line in the &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window is printed by the pattern:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vipbnf&amp;gt;&amp;lt;Address&amp;gt; | [ &amp;lt;HexValues&amp;gt; ] [ &amp;lt;ASCIIcharacters&amp;gt; ] [ &amp;lt;UnicodeCharacters&amp;gt;]&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Address&amp;#039;&amp;#039;&lt;br /&gt;
:This is the hexadecimal address of the first byte of the memory displayed in this line.&lt;br /&gt;
&amp;#039;&amp;#039;HexValues&amp;#039;&amp;#039;&lt;br /&gt;
:&amp;lt;vipbnf&amp;gt;&amp;lt;HexValues&amp;gt; : &amp;lt;HexValue&amp;gt; [ &amp;lt;HexValues&amp;gt; ]&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
:This is the hexadecimal format of the memory dump. Each hex value can be an image of one, two, four or eight continued memory bytes (this is contolled by the &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window content pop-up menu).&lt;br /&gt;
&amp;#039;&amp;#039;ASCIIcharacters&amp;#039;&amp;#039;&lt;br /&gt;
:&amp;lt;vipbnf&amp;gt;&amp;lt;ASCIIcharacters&amp;gt; : &amp;lt;ASCIIcharacter&amp;gt; [ &amp;lt;ASCIIcharacters&amp;gt; ]&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
:This is the same memory dump but in the format of ASCII characters (a character represenrs one byte). Unprintable characters are printed as dots.&lt;br /&gt;
&amp;#039;&amp;#039;UnicodeCharacters&amp;#039;&amp;#039;&lt;br /&gt;
:&amp;lt;vipbnf&amp;gt;&amp;lt;UnicodeCharacters&amp;gt; : &amp;lt;UnicodeCharacter&amp;gt; [ &amp;lt;UnicodeCharacters&amp;gt; ]&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
:This is the same memory dump in the format of Unicode characters (a character represents two bytes). Unprintable characters are printed as dots.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_db_Memory_view1.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window title shows the module name, which memory is displayed in the window. If the module name cannot be determined, then the title displays &amp;#039;&amp;#039;Unknown module&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Content Pop-up Menu&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window has the pop-up context menu which contains commands:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Go To Address&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;Ctrl+G&amp;#039;&amp;#039;&amp;#039;. Invokes the &amp;#039;&amp;#039;&amp;#039;Go to Address&amp;#039;&amp;#039;&amp;#039; dialog&lt;br /&gt;
*:[[Image:Ide_db_DisAsm_Go2Address.png]]&lt;br /&gt;
*: to type a new top address in hex format. This dialog allows typing symbolic external link names and symbolic CPU register names. Double-click in the &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window area also activates the &amp;#039;&amp;#039;&amp;#039;Go to Address&amp;#039;&amp;#039;&amp;#039; dialog.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Go To &amp;#039;&amp;#039;Ptr&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;Ctrl+Shift+G&amp;#039;&amp;#039;&amp;#039;. Updates the &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window starting the first line from the address shown as &amp;#039;&amp;#039;Ptr&amp;#039;&amp;#039; (address defined by the memory contents of four or eight continued bytes at which the cursor is pointing if one of &amp;#039;&amp;#039;&amp;#039;4-byte Integer&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;8-byte Integer&amp;#039;&amp;#039;&amp;#039; is selected).&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Undo Go to&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;Alt+Left Arrow&amp;#039;&amp;#039;&amp;#039;. Updates the &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window view to start from the previously used top (the first line) address.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Redo Go to&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;Alt+Right Arrow&amp;#039;&amp;#039;&amp;#039;. This operation is the counterpart to the &amp;#039;&amp;#039;&amp;#039;Undo Go to&amp;#039;&amp;#039;&amp;#039;. It updates the &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window view to start from the &amp;quot;next&amp;quot; top address, which was used before the &amp;#039;&amp;#039;&amp;#039;Undo Go to&amp;#039;&amp;#039;&amp;#039; command was implemented.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Set Memory Breakpoint&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This operation sets a memory breakpoint at address from the left pane.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Remove Memory Breakpoint&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This operation removes a previously set a memory breakpoint.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Copy&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Copies the selected lines to the clipboard. To select a line, click on it while holding the &amp;#039;&amp;#039;&amp;#039;shift&amp;#039;&amp;#039;&amp;#039; key. You can select multiple lines at one time.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Copy &amp;#039;&amp;#039;Ptr&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;Ctrl+C&amp;#039;&amp;#039;&amp;#039;. Copies hexadecimal representation of the specified address (four or eight bytes) to the clipboard.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Refresh&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Refresh the &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window contents.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Write Block&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:This command opens the &amp;#039;&amp;#039;&amp;#039;Write Memory Block&amp;#039;&amp;#039;&amp;#039; dialog:&lt;br /&gt;
*:[[Image:Ide_db_Memory_BlockWrite.png]]&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Filename&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Here you should type in the name of a file in which the specified memory block should be saved.&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Start Address&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Here you should specify a hexadecimal start address of the memory block.&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Length&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Here you should specify a hexadecimal length in bytes of the memory block.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Show Hex&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows the column, which displays the memory dump in the hexadecimal format. This is the {{ide|Debugger#Debugger Views|&amp;#039;&amp;#039;HexValues&amp;#039;&amp;#039;}} column in the right pane.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Show ASCII&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows the column, which displays the &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;ASCII&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; format of the memory dump. This is the {{ide|Debugger#Debugger Views|&amp;#039;&amp;#039;ASCIIcharacters&amp;#039;&amp;#039;}} column in the right pane.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Show Unicode&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Shows the column, which displays the &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Unicode&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; format of the memory dump. This is the {{ide|Debugger#Debugger Views|&amp;#039;&amp;#039;UnicodeCharacters&amp;#039;&amp;#039;}} column in the right pane.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Update Speed...&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Defines the rate of the Memory Dump window updating:&lt;br /&gt;
*:[[Image:iDE_db_Memory_menu1.png]]&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;High&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Performs automatic updating with the high rate.&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Normal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Performs automatic updating with normal rate.&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Low&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:Performs automatic updating with low rate.&lt;br /&gt;
*:*&amp;#039;&amp;#039;&amp;#039;Manual&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:*:No automatic updating.&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Memory Dump&amp;#039;&amp;#039;&amp;#039; window can be activated either by &amp;#039;&amp;#039;&amp;#039;CTRL+Alt+M&amp;#039;&amp;#039;&amp;#039; or from the IDE menu &amp;#039;&amp;#039;&amp;#039;View | Memory Dump&amp;#039;&amp;#039;&amp;#039;.&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Ide/Resource_Editor/Editing_a_Dialog&amp;diff=3619</id>
		<title>Ide/Resource Editor/Editing a Dialog</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Ide/Resource_Editor/Editing_a_Dialog&amp;diff=3619"/>
		<updated>2013-05-23T09:24:46Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: /* Using Anchors for Positioning GUI Controls while Dialog Resizing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;[[Category:Ide]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To edit a dialog, in the project tree (in the Project window) double click (or press &amp;#039;&amp;#039;&amp;#039;Enter&amp;#039;&amp;#039;&amp;#039;) the name of a file with a dialog description (the &amp;#039;&amp;#039;&amp;#039;.dlg&amp;#039;&amp;#039;&amp;#039; filename extension). The &lt;br /&gt;
{{ide|Resource Editor#IDE Designer|&amp;#039;&amp;#039;&amp;#039;IDE Designer&amp;#039;&amp;#039;&amp;#039;}} appears and you can edit whatever form of a dialog you wish.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_MyDialog_Editor.png|center]]&lt;br /&gt;
&lt;br /&gt;
The IDE Designer After Creation of a New Dialog&lt;br /&gt;
&lt;br /&gt;
When a new dialog is created, it will by default have three push button controls: &amp;#039;&amp;#039;&amp;#039;OK&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Cancel&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Help&amp;#039;&amp;#039;&amp;#039;. These can freely be rearranged or deleted.&lt;br /&gt;
&lt;br /&gt;
==== Controls ====&lt;br /&gt;
&lt;br /&gt;
Each control in a dialog must have an identifying name (constant in VPI style dialogs), which is unique within that dialog. While two controls within one dialog may not have the same name (or constant value), it is actually a good idea if controls in different dialogs, which perform the same action have the same names (or constants).&lt;br /&gt;
&lt;br /&gt;
===== Types of Controls =====&lt;br /&gt;
&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_PushButton.png]]&lt;br /&gt;
| A &amp;#039;&amp;#039;&amp;#039;Push Button&amp;#039;&amp;#039;&amp;#039; control serves to initiate a specialized action in an application.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_CheckBox.png]]&lt;br /&gt;
| A &amp;#039;&amp;#039;&amp;#039;Check Box&amp;#039;&amp;#039;&amp;#039; control lets you indicate a choice among two alternatives. For example some facility may be switched ON or switched OFF.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_RadioButton.png]]&lt;br /&gt;
| A group of &amp;#039;&amp;#039;&amp;#039;Radio Button&amp;#039;&amp;#039;&amp;#039; controls serves to indicate one choice from among a list of alternatives.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_StaticText.png]]&lt;br /&gt;
| A &amp;#039;&amp;#039;&amp;#039;Static Text&amp;#039;&amp;#039;&amp;#039; control reserves an area for the text in the dialog. Although called static, in fact the application can change the text during execution. This is often used for prompts or field names relating to other controls.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_EditControl.png]]&lt;br /&gt;
| An &amp;#039;&amp;#039;&amp;#039;Edit Control&amp;#039;&amp;#039;&amp;#039; reserves an area for text editing (e.g. names, numbers, text constants etc.). Editing text strings with multiple lines is possible.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_ListBox.png]]&lt;br /&gt;
| A &amp;#039;&amp;#039;&amp;#039;List Box&amp;#039;&amp;#039;&amp;#039; allows you to view a list of elements and to select one - or several - elements from this list.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_ListButton.png]]&lt;br /&gt;
| A &amp;#039;&amp;#039;&amp;#039;List Button&amp;#039;&amp;#039;&amp;#039; control serves for choosing one from the pop-out set of the alternatives revealed by pressing the button. Pressing the button again pops the list back in again.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_ListEdit.png]]&lt;br /&gt;
| A &amp;#039;&amp;#039;&amp;#039;List Edit&amp;#039;&amp;#039;&amp;#039; control allows single line text editing like an &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039; control, or selection from a list of elements.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_VerticalScrollBar.png]]  [[Image:Ide_HorizontalScrollBar.png]]&lt;br /&gt;
| The &amp;#039;&amp;#039;&amp;#039;Vertical Scroll Bar&amp;#039;&amp;#039;&amp;#039; and the &amp;#039;&amp;#039;&amp;#039;Horizontal Scroll Bar&amp;#039;&amp;#039;&amp;#039; controls serve to select a value within a scale of values.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_GroupBox.png]]&lt;br /&gt;
| A &amp;#039;&amp;#039;&amp;#039;Group Box&amp;#039;&amp;#039;&amp;#039; control serves for assembling together a number of controls in a functional group with a Group Name. Its only function is a visual one.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Icon.png]]&lt;br /&gt;
| An &amp;#039;&amp;#039;&amp;#039;Icon&amp;#039;&amp;#039;&amp;#039; control reserves an area for an icon image.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_CustomControl.png]]&lt;br /&gt;
| A &amp;#039;&amp;#039;&amp;#039;Custom Control&amp;#039;&amp;#039;&amp;#039; can be either IDE Controls created in the project, it can be VPI user-defined control with a window class defined by &amp;lt;vp&amp;gt;vpi::classCreate&amp;lt;/vp&amp;gt;, or it can be controls imported as {{ide|Creating new Project Items#Creating a COM Package|COM packages}} from DLLs, VBXs or OCXs.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Inserting Controls =====&lt;br /&gt;
&lt;br /&gt;
To insert a new control in a dialog, click the icon of the desired control type in the &amp;#039;&amp;#039;&amp;#039;Controls toolbar&amp;#039;&amp;#039;&amp;#039;. (You can also select the desired control type in the &amp;#039;&amp;#039;&amp;#039;Controls&amp;#039;&amp;#039;&amp;#039; sub-menu of the main IDE menu or in the pop-up menu in the {{ide|Resource Editor#IDE Designer|&amp;#039;&amp;#039;&amp;#039;IDE Designer&amp;#039;&amp;#039;&amp;#039;}}.)&lt;br /&gt;
&lt;br /&gt;
===== Controls Toolbar =====&lt;br /&gt;
&lt;br /&gt;
Originally the &amp;#039;&amp;#039;&amp;#039;Controls toolbar&amp;#039;&amp;#039;&amp;#039; is displayed below the {{ide|Resource Editor#IDE Designer|&amp;#039;&amp;#039;&amp;#039;IDE Designer&amp;#039;&amp;#039;&amp;#039;}} window. You see it in the following picture:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_Controls.png|center|frame|&amp;#039;&amp;#039;&amp;#039;The Controls Toolbar&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
Clicking icons in the &amp;#039;&amp;#039;&amp;#039;Controls toolbar&amp;#039;&amp;#039;&amp;#039; you select a type of a control to be placed into the edited dialog/window/form/IDE control (sometimes we will use the term &amp;#039;&amp;#039;container&amp;#039;&amp;#039; instead of dialog/window/form/IDE control). When you click a control type icon, then the current cursor is replaced with the cursor correspondent to the control type to be inserted. Move the cursor to some position in the container client area and click the mouse button. The control with the default size will be inserted at the specified position.&lt;br /&gt;
&lt;br /&gt;
Instead of dropping a control into a container with a click, it is possible to drag out the rectangle (in the container client area) where a control should be placed; so you can specify not only the control position but also the control size.&lt;br /&gt;
&lt;br /&gt;
After a VPI control is placed with the mouse into a {{ide|Resource_Editor#GUI and VPI Style Resources|VPI style container}}, the correspondent VPI control Attributes dialog appears. In this dialog you can change some control attributes, when you close the dialog, the control appears at the specified location in the container.&lt;br /&gt;
&lt;br /&gt;
After a GUI control is placed with the mouse into a {{ide|Resource_Editor#GUI and VPI Style Resources|GUI style container}}, it immediately appears at the specified location in the container. To change properties of the GUI control, one should select it then the list of GUI control properties appears in the {{ide|Resource Editor#GUI Control Properties Table|GUI control Properties table}}.&lt;br /&gt;
&lt;br /&gt;
There are the following icons in the &amp;#039;&amp;#039;&amp;#039;Controls toolbar:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
! Icon&lt;br /&gt;
! Insert a new:&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_PushBtn.png]]&lt;br /&gt;
| Push Button&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_PushBtn.png]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_CheckBx.png]]&lt;br /&gt;
| Check Box&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_Check.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_RadioBtn.png]]&lt;br /&gt;
| Radio Button&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_RB.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_StaText.png]]&lt;br /&gt;
| Static Text Control&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_Text.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_EditCtrl.png]]&lt;br /&gt;
| Edit Control&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_Edit.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_ListBox.png]]&lt;br /&gt;
| List Box&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_ListBox.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_ListBtn.png]]&lt;br /&gt;
| List Button&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_ListBtn.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_ListEdit.png]]&lt;br /&gt;
| List Edit&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_ListEdit.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_HScroll.png]]&lt;br /&gt;
| Horizontal Scroll Bar&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_HScroll.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_VScroll.png]]&lt;br /&gt;
| Vertical Scroll Bar&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_VScroll.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_GroupBox.png]]&lt;br /&gt;
| Group Box&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_Group.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_Icon.png]]&lt;br /&gt;
| Icon Control&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_Icon.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_Custom.png]]&lt;br /&gt;
| Custom Control&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_Custom.png]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Selecting and Deselecting Controls =====&lt;br /&gt;
&lt;br /&gt;
Click inside a control to select one control. A frame appears around the selected control.&lt;br /&gt;
&lt;br /&gt;
To select a group of controls move the mouse pointer to the point in the dialog you want to be one corner of the selected area and press and hold the left mouse button. While holding the left mouse button move the mouse until all the desired controls in the dialog are inside the selected area. Then release the mouse button. All controls inside the specified rectangle will be selected.&lt;br /&gt;
&lt;br /&gt;
Also after one or more controls are already selected, you can include one extra control in the selection by holding down the &amp;#039;&amp;#039;&amp;#039;Ctrl&amp;#039;&amp;#039;&amp;#039; key and click the control.&lt;br /&gt;
&lt;br /&gt;
To deselect the control or group of controls click outside the selecting frame. Deselected controls lose their frame.&lt;br /&gt;
&lt;br /&gt;
===== Resizing Controls =====&lt;br /&gt;
&lt;br /&gt;
Once a control has been inserted in the dialog, it has a default size. To re-size a control, first click inside the control area to select it. Then move the cursor to the sizing handles on the selection frame. A new shape of cursor indicates the direction in which you can re-size the control. Press and hold the mouse button, drag until the selected control has the size you want, then release the mouse button.&lt;br /&gt;
&lt;br /&gt;
You can also change the size of a control by double-clicking it to activate the dialog for control attributes setting. Select the position you want to change and after specifying a new position or size, press enter to return to the dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Remark:&amp;#039;&amp;#039;&amp;#039; You cannot change the size of icons. You can only change their location.&lt;br /&gt;
&lt;br /&gt;
===== Moving Controls =====&lt;br /&gt;
&lt;br /&gt;
To move a control or a group of controls first select them. Then move the cursor inside the selection frame, press and hold the mouse button, drag the mouse pointer to a new location and release the mouse. Also, when one or more controls are selected, it is possible to use the cursor keys to move the selection in small steps (corresponding to the &amp;#039;&amp;#039;&amp;#039;Grid&amp;#039;&amp;#039;&amp;#039; settings).&lt;br /&gt;
&lt;br /&gt;
===== Arranging Controls =====&lt;br /&gt;
&lt;br /&gt;
To arrange a group of controls first select the group. Then click an appropriate button in the &amp;#039;&amp;#039;&amp;#039;Layout&amp;#039;&amp;#039;&amp;#039; toolbar or a menu item in the &amp;#039;&amp;#039;&amp;#039;Layout&amp;#039;&amp;#039;&amp;#039; menu of the IDE menu (or in the pop-up menu).&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_Layout.png|center|frame|&amp;#039;&amp;#039;&amp;#039;The Layout Toolbar&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Layout&amp;#039;&amp;#039;&amp;#039; commands for justifying and resizing controls:&lt;br /&gt;
&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Layout_AllignLeft.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Align Left&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Align the selected controls along their left sides.&lt;br /&gt;
|- &lt;br /&gt;
| [[Image:Ide_Layout_CenterVertically.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Align Center&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Center the selected controls vertically.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Layout_AllignRight.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Align Right&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Align the selected controls along their right sides.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Layout_AllignTops.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Align Top&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Align the selected controls along their tops.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Layout_CenterHorizontally.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Align Middle&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Center the selected controls horizontally.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Layout_AllignBottom.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Align Bottom&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Align the selected controls along their bottoms.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Layout_SpacingHorizontally.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Even Horizontal Spacing&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Spacing the selected controls evenly between the leftmost and the rightmost controls.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_GridButton.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Grid&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Toggle the Grid (see below).&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Layout_SpacingVertically.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Even Vertical Spacing&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Spacing the selected controls evenly between the topmost and the bottom-most controls.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Layout_SameSize.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Make Same Size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Make the selected controls the same size as a model control.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Layout_SameHorizontal.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Make Same Horizontal Size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Make the selected controls the same width as a model control.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Layout_SameVertical.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Make Same Vertical Size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Make the selected controls the same height as a model control.&lt;br /&gt;
|-&lt;br /&gt;
|   &lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Size To Contents&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Resize the selected controls to optimally display its titles (caption texts).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Editing Properties of GUI Controls ====&lt;br /&gt;
&lt;br /&gt;
When you open a GUI dialog or a Form (GUI window) in the &amp;#039;&amp;#039;&amp;#039;IDE Designer&amp;#039;&amp;#039;&amp;#039;, then near from the opened dialog (form) the {{ide|Resource Editor#GUI Control Properties Table|&amp;#039;&amp;#039;&amp;#039;Control Properties table&amp;#039;&amp;#039;&amp;#039;}} appears.&lt;br /&gt;
&lt;br /&gt;
To change &amp;#039;&amp;#039;properties&amp;#039;&amp;#039; of a GUI package control first select this control (by clicking in it) in the dialog (form). The current set of the control properties appears in the &amp;#039;&amp;#039;&amp;#039;Control Properties&amp;#039;&amp;#039;&amp;#039; table. Now you can edit the displayed GUI control properties.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Click here to view {{ide|Resource Editor#GUI Control Properties Table|GUI Control Properties table}}&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The displayed set of properties depends on the control type. The {{ide|Resource Editor#GUI Control Properties Table|&amp;#039;&amp;#039;&amp;#039;Control Properties table&amp;#039;&amp;#039;&amp;#039;}} contains two types of properties. General properties are common to all types of controls and some properties, which are individual to different kinds of controls.&lt;br /&gt;
&lt;br /&gt;
Initially this &amp;#039;&amp;#039;&amp;#039;Control Properties&amp;#039;&amp;#039;&amp;#039; table is empty. However, as soon as one of controls in the edited dialog (form) is selected this table starts to display properties of the selected control.&lt;br /&gt;
&lt;br /&gt;
If the &amp;#039;&amp;#039;&amp;#039;Control Properties&amp;#039;&amp;#039;&amp;#039; table is closed, then double-click a control - the &amp;#039;&amp;#039;&amp;#039;Control Properties&amp;#039;&amp;#039;&amp;#039; table appears. Also the &amp;#039;&amp;#039;&amp;#039;Control Attributes&amp;#039;&amp;#039;&amp;#039; command, from the &amp;#039;&amp;#039;&amp;#039;IDE Designer&amp;#039;&amp;#039;&amp;#039; {{ide|Resource Editor#Speed Menu|speed menu}}, can be used to open the &amp;#039;&amp;#039;&amp;#039;Control Properties&amp;#039;&amp;#039;&amp;#039; table.&lt;br /&gt;
{{:ide/Resource Editor/GUI Control Properties Table}}&lt;br /&gt;
&lt;br /&gt;
==== Editing Attributes of VPI Controls ====&lt;br /&gt;
&lt;br /&gt;
To change attributes of a VPI package control double-click it or select the control and activates the &amp;#039;&amp;#039;&amp;#039;Control Attributes&amp;#039;&amp;#039;&amp;#039; command from the &amp;#039;&amp;#039;&amp;#039;IDE Designer&amp;#039;&amp;#039;&amp;#039; {{ide|Resource Editor#Speed Menu|speed menu}}. Then the &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;ControlType&amp;gt;&amp;#039;&amp;#039; Attributes&amp;#039;&amp;#039;&amp;#039; dialog appears.&lt;br /&gt;
&lt;br /&gt;
These dialogs contains two levels of attributes. The general group contains attributes, which are common to all types of controls: the &amp;#039;&amp;#039;&amp;#039;Text&amp;#039;&amp;#039;&amp;#039; determines the control title, the &amp;#039;&amp;#039;&amp;#039;Constant&amp;#039;&amp;#039;&amp;#039; (name) is used as the control identifier, and the &amp;#039;&amp;#039;&amp;#039;Control Size&amp;#039;&amp;#039;&amp;#039; group determines position and size of the control.&lt;br /&gt;
&lt;br /&gt;
Notice that the &amp;#039;&amp;#039;&amp;#039;Text&amp;#039;&amp;#039;&amp;#039; property/attribute is not used for some controls, for instance, it is not used for scroll bars.&lt;br /&gt;
&lt;br /&gt;
Notice that in the &amp;#039;&amp;#039;&amp;#039;Text&amp;#039;&amp;#039;&amp;#039; fields the ampersand symbol &amp;lt;vp&amp;gt;&amp;amp;&amp;lt;/vp&amp;gt; is reserved for indicating that the next to it character is to be underlined. For example, if you use the text string &amp;#039;&amp;#039;&amp;#039;E&amp;amp;xit&amp;#039;&amp;#039;&amp;#039; as a control name, then this control will be displayed with the title &amp;#039;&amp;#039;&amp;#039;E&amp;lt;u&amp;gt;x&amp;lt;/u&amp;gt;it&amp;#039;&amp;#039;&amp;#039; at runtime. I.e. the char &amp;#039;&amp;#039;&amp;#039;&amp;lt;u&amp;gt;x&amp;lt;/u&amp;gt;&amp;#039;&amp;#039;&amp;#039; will be displayed underlined (thus visually indicating that the &amp;#039;&amp;#039;&amp;#039;&amp;lt;u&amp;gt;x&amp;lt;/u&amp;gt;&amp;#039;&amp;#039;&amp;#039; is an accelerator key). If you need to display the ampersand &amp;lt;vp&amp;gt;&amp;amp;&amp;lt;/vp&amp;gt; symbol in the &amp;#039;&amp;#039;&amp;#039;Text&amp;#039;&amp;#039;&amp;#039; of a control, then use two of them &amp;lt;vp&amp;gt;&amp;amp;&amp;amp;&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Other attributes are individual to different kinds of controls.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Using Anchors for Positioning GUI Controls while Dialog Resizing ====&lt;br /&gt;
&lt;br /&gt;
VPI controls remember in their attributes only their absolute positions and sizes. Therefore, when a VPI dialog or a VPI window containing such VPI controls are resized, these VPI controls do not change their positions and sizes!&lt;br /&gt;
&lt;br /&gt;
In difference to them GUI controls have additional &amp;#039;&amp;#039;Anchor&amp;#039;&amp;#039; properties, which help to reposition (and may be resize) GUI controls when containing them GUI dialog (or form) is resized.&lt;br /&gt;
&lt;br /&gt;
Each GUI control has four anchor properties: &amp;#039;&amp;#039;&amp;#039;Left Anchor&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Top Anchor&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Right Anchor&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;Bottom Anchor&amp;#039;&amp;#039;&amp;#039; (see {{ide|Resource Editor#GUI Control Properties Table|&amp;#039;&amp;#039;&amp;#039;Anchor Properties of GUI Controls&amp;#039;&amp;#039;&amp;#039;}}).&lt;br /&gt;
&lt;br /&gt;
Each anchor determines that the specified (&amp;#039;&amp;#039;&amp;#039;Left&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Top&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Right&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;Bottom&amp;#039;&amp;#039;&amp;#039;) control boundary should be &amp;#039;&amp;#039;&amp;#039;always&amp;#039;&amp;#039;&amp;#039; positioned on the stated distance from the nearest (correspondent) border of the dialog (frame).&lt;br /&gt;
&lt;br /&gt;
Each of anchors can have the &amp;#039;&amp;#039;&amp;#039;True&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;False&amp;#039;&amp;#039;&amp;#039; values. When the anchor value is &amp;#039;&amp;#039;&amp;#039;True&amp;#039;&amp;#039;&amp;#039;, then this anchor is active (used to position the correspondent control).&lt;br /&gt;
&lt;br /&gt;
For example, when the &amp;#039;&amp;#039;&amp;#039;Left Anchor&amp;#039;&amp;#039;&amp;#039; is active (has the &amp;#039;&amp;#039;&amp;#039;True&amp;#039;&amp;#039;&amp;#039; value), then the &amp;#039;&amp;#039;left&amp;#039;&amp;#039; control boundary should be positioned on the stated distance from the nearest (&amp;#039;&amp;#039;left&amp;#039;&amp;#039;) border of the dialog (frame).&lt;br /&gt;
&lt;br /&gt;
The simplest way to see which anchors are active for a control, is to select this control. Then some red arrows between control boundaries and correspondent boundaries of the dialog can bee seen. Each arrow specifies, that the correspondent anchor is active. For example, the arrow from the control top to the dialog top identifies, that the &amp;#039;&amp;#039;&amp;#039;Top Anchor&amp;#039;&amp;#039;&amp;#039; is active. In the picture below, you see three arrows, which specify that the &amp;#039;&amp;#039;&amp;#039;Left&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Top&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;Right&amp;#039;&amp;#039;&amp;#039; anchors are active to the &amp;#039;&amp;#039;&amp;#039;Push Button&amp;#039;&amp;#039;&amp;#039; control.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_de_Anchors.png|center]]&lt;br /&gt;
&lt;br /&gt;
Numbers near such arrows show distances (in Dialog Base Units) between the correspondent boundaries of the control and the dialog.&lt;br /&gt;
&lt;br /&gt;
Normally each control has one active horizontal and one active vertical anchors. When the dialog is resized, then such control is always positioned on the specified distances from the specified boundaries of the dialog. The size of the control is not changed!&lt;br /&gt;
&lt;br /&gt;
When a control has both horizontal (or/and both vertical) anchors active, then both horizontal (or/and both vertical) boundaries of the control should be placed on some specified distances from the correspondent horizontal (vertical) boundaries of the dialog. Therefore, when the dialog is resized, then such control is also resized accordingly to keep the specified distances.&lt;br /&gt;
&lt;br /&gt;
When no one of horizontal (or vertical) anchors of a control are active, then no one of horizontal (or vertical) boundaries of the control are bounded to the correspondent horizontal (vertical) boundaries of the dialog. Coordinates of such controls are handles on the &amp;quot;proportional basis&amp;quot;. For example, when the dialog width is increased onto &amp;lt;vp&amp;gt;Delta&amp;lt;/vp&amp;gt; dialog base units, then the &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; coordinate of the control is also increased, but it is increased two times smaller. That is the &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; coordinate of the control is increased only onto &amp;lt;vp&amp;gt;Delta/2&amp;lt;/vp&amp;gt; dialog base units.&lt;br /&gt;
&lt;br /&gt;
==== Cut, Copy and Paste, Undo and Redo ====&lt;br /&gt;
&lt;br /&gt;
You can &amp;#039;&amp;#039;&amp;#039;Cut&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;Copy&amp;#039;&amp;#039;&amp;#039; a group of selected controls onto the Windows clipboard, and &amp;#039;&amp;#039;&amp;#039;Paste&amp;#039;&amp;#039;&amp;#039; controls from the clipboard back into a dialog. The &amp;#039;&amp;#039;&amp;#039;Undo&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Redo&amp;#039;&amp;#039;&amp;#039; commands serve to delete or restore the last editing operations of your dialog.&lt;br /&gt;
&lt;br /&gt;
==== Grid ====&lt;br /&gt;
&lt;br /&gt;
When the menu (or the pop-up menu) entry &amp;#039;&amp;#039;&amp;#039;Resource | Grid&amp;#039;&amp;#039;&amp;#039; is activated, or when the [[Image:Ide_GridButton.png]] button from the &amp;#039;&amp;#039;&amp;#039;Layout&amp;#039;&amp;#039;&amp;#039; toolbar is pressed, the following dialog appears:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_GridSpecification.png|center|frame|&amp;#039;&amp;#039;&amp;#039;The Dialog to Specify the Grid Properties&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
With a grid in place, arranging the controls inside a dialog is easier. Also it is possible to tell the {{ide|Resource Editor#IDE Designer|&amp;#039;&amp;#039;&amp;#039;IDE Designer&amp;#039;&amp;#039;&amp;#039;}} by the &amp;#039;&amp;#039;&amp;#039;Snap to Grid&amp;#039;&amp;#039;&amp;#039; that it should place controls at the grid intersections to give a satisfactory result.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_MyDialog_withGrid.png|center|frame|&amp;#039;&amp;#039;&amp;#039;Using a grid in the Dialog/Window/Form Editor&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
==== Test Mode ====&lt;br /&gt;
&lt;br /&gt;
The {{ide|Resource Editor#IDE Designer|&amp;#039;&amp;#039;&amp;#039;IDE Designer&amp;#039;&amp;#039;&amp;#039;}} has the &amp;#039;&amp;#039;&amp;#039;Test Mode&amp;#039;&amp;#039;&amp;#039;, so it is possible to see how the dialog with the created controls behaves. To illustrate the &amp;#039;&amp;#039;&amp;#039;Test Mode&amp;#039;&amp;#039;&amp;#039; we will assign some default values to the controls. The test mode is activated and deactivated from the &amp;#039;&amp;#039;&amp;#039;Resource&amp;#039;&amp;#039;&amp;#039; menu (or from the pop-up menu).&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_MyDialog_TestMode.png|center|frame|&amp;#039;&amp;#039;&amp;#039;Test Mode for a Dialog&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
==== Tab Stops ====&lt;br /&gt;
&lt;br /&gt;
When activating the menu (or the pop-up menu) entry &amp;#039;&amp;#039;&amp;#039;Resource | Tabstops&amp;#039;&amp;#039;&amp;#039;, it is possible to specify to which controls you can Tab to in the dialog. When this command is activated a small button with the &amp;lt;vp&amp;gt;+&amp;lt;/vp&amp;gt; or &amp;lt;vp&amp;gt;-&amp;lt;/vp&amp;gt; appears on controls depending upon whether the control has a tab stop or not. By clicking the small buttons, it is possible to toggle the setting.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_MyDialog_TabStops.png|center|frame|&amp;#039;&amp;#039;&amp;#039;Specifying Tab Stops for a Dialog&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
To exit the tab stop mode, just click in the dialog but outside of any controls.&lt;br /&gt;
&lt;br /&gt;
==== Visit Order ====&lt;br /&gt;
&lt;br /&gt;
When the tab stops have been specified for a dialog, then it is possible to specify the order in which controls will receive focus when tabbing.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_MyDialog_VisitOrder.png|center|frame|&amp;#039;&amp;#039;&amp;#039;Displaying the Visit Order&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
To change the visit order, click a small rectangle displaying the visit order number for a control that has an incorrect sequence number and this will bring up another dialog to change this sequence:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_MyDialog_ChangeVisitOrder.png|center|frame|&amp;#039;&amp;#039;&amp;#039;Changing the Visit Order&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
To stop the visit order mode, just click in the dialog outside any controls.&lt;br /&gt;
&lt;br /&gt;
==== Speed Menu ====&lt;br /&gt;
&lt;br /&gt;
When you are in the {{ide|Resource Editor#IDE Designer|&amp;#039;&amp;#039;&amp;#039;IDE Designer&amp;#039;&amp;#039;&amp;#039;}} you can click the right mouse button to activate the Speed Menu. From this menu you can easily call any {{ide|Resource Editor#IDE Designer|&amp;#039;&amp;#039;&amp;#039;IDE Designer&amp;#039;&amp;#039;&amp;#039;}} command:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_We_SpeedMenu.png|center|frame|&amp;#039;&amp;#039;&amp;#039;The IDE Designer Speed Menu&amp;#039;&amp;#039;&amp;#039;]]&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Ide/Resource_Editor/Editing_a_Dialog&amp;diff=3618</id>
		<title>Ide/Resource Editor/Editing a Dialog</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Ide/Resource_Editor/Editing_a_Dialog&amp;diff=3618"/>
		<updated>2013-05-23T09:23:41Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: /* Attributes of VPI Controls */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;[[Category:Ide]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To edit a dialog, in the project tree (in the Project window) double click (or press &amp;#039;&amp;#039;&amp;#039;Enter&amp;#039;&amp;#039;&amp;#039;) the name of a file with a dialog description (the &amp;#039;&amp;#039;&amp;#039;.dlg&amp;#039;&amp;#039;&amp;#039; filename extension). The &lt;br /&gt;
{{ide|Resource Editor#IDE Designer|&amp;#039;&amp;#039;&amp;#039;IDE Designer&amp;#039;&amp;#039;&amp;#039;}} appears and you can edit whatever form of a dialog you wish.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_MyDialog_Editor.png|center]]&lt;br /&gt;
&lt;br /&gt;
The IDE Designer After Creation of a New Dialog&lt;br /&gt;
&lt;br /&gt;
When a new dialog is created, it will by default have three push button controls: &amp;#039;&amp;#039;&amp;#039;OK&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Cancel&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Help&amp;#039;&amp;#039;&amp;#039;. These can freely be rearranged or deleted.&lt;br /&gt;
&lt;br /&gt;
==== Controls ====&lt;br /&gt;
&lt;br /&gt;
Each control in a dialog must have an identifying name (constant in VPI style dialogs), which is unique within that dialog. While two controls within one dialog may not have the same name (or constant value), it is actually a good idea if controls in different dialogs, which perform the same action have the same names (or constants).&lt;br /&gt;
&lt;br /&gt;
===== Types of Controls =====&lt;br /&gt;
&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_PushButton.png]]&lt;br /&gt;
| A &amp;#039;&amp;#039;&amp;#039;Push Button&amp;#039;&amp;#039;&amp;#039; control serves to initiate a specialized action in an application.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_CheckBox.png]]&lt;br /&gt;
| A &amp;#039;&amp;#039;&amp;#039;Check Box&amp;#039;&amp;#039;&amp;#039; control lets you indicate a choice among two alternatives. For example some facility may be switched ON or switched OFF.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_RadioButton.png]]&lt;br /&gt;
| A group of &amp;#039;&amp;#039;&amp;#039;Radio Button&amp;#039;&amp;#039;&amp;#039; controls serves to indicate one choice from among a list of alternatives.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_StaticText.png]]&lt;br /&gt;
| A &amp;#039;&amp;#039;&amp;#039;Static Text&amp;#039;&amp;#039;&amp;#039; control reserves an area for the text in the dialog. Although called static, in fact the application can change the text during execution. This is often used for prompts or field names relating to other controls.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_EditControl.png]]&lt;br /&gt;
| An &amp;#039;&amp;#039;&amp;#039;Edit Control&amp;#039;&amp;#039;&amp;#039; reserves an area for text editing (e.g. names, numbers, text constants etc.). Editing text strings with multiple lines is possible.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_ListBox.png]]&lt;br /&gt;
| A &amp;#039;&amp;#039;&amp;#039;List Box&amp;#039;&amp;#039;&amp;#039; allows you to view a list of elements and to select one - or several - elements from this list.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_ListButton.png]]&lt;br /&gt;
| A &amp;#039;&amp;#039;&amp;#039;List Button&amp;#039;&amp;#039;&amp;#039; control serves for choosing one from the pop-out set of the alternatives revealed by pressing the button. Pressing the button again pops the list back in again.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_ListEdit.png]]&lt;br /&gt;
| A &amp;#039;&amp;#039;&amp;#039;List Edit&amp;#039;&amp;#039;&amp;#039; control allows single line text editing like an &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039; control, or selection from a list of elements.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_VerticalScrollBar.png]]  [[Image:Ide_HorizontalScrollBar.png]]&lt;br /&gt;
| The &amp;#039;&amp;#039;&amp;#039;Vertical Scroll Bar&amp;#039;&amp;#039;&amp;#039; and the &amp;#039;&amp;#039;&amp;#039;Horizontal Scroll Bar&amp;#039;&amp;#039;&amp;#039; controls serve to select a value within a scale of values.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_GroupBox.png]]&lt;br /&gt;
| A &amp;#039;&amp;#039;&amp;#039;Group Box&amp;#039;&amp;#039;&amp;#039; control serves for assembling together a number of controls in a functional group with a Group Name. Its only function is a visual one.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Icon.png]]&lt;br /&gt;
| An &amp;#039;&amp;#039;&amp;#039;Icon&amp;#039;&amp;#039;&amp;#039; control reserves an area for an icon image.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_CustomControl.png]]&lt;br /&gt;
| A &amp;#039;&amp;#039;&amp;#039;Custom Control&amp;#039;&amp;#039;&amp;#039; can be either IDE Controls created in the project, it can be VPI user-defined control with a window class defined by &amp;lt;vp&amp;gt;vpi::classCreate&amp;lt;/vp&amp;gt;, or it can be controls imported as {{ide|Creating new Project Items#Creating a COM Package|COM packages}} from DLLs, VBXs or OCXs.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Inserting Controls =====&lt;br /&gt;
&lt;br /&gt;
To insert a new control in a dialog, click the icon of the desired control type in the &amp;#039;&amp;#039;&amp;#039;Controls toolbar&amp;#039;&amp;#039;&amp;#039;. (You can also select the desired control type in the &amp;#039;&amp;#039;&amp;#039;Controls&amp;#039;&amp;#039;&amp;#039; sub-menu of the main IDE menu or in the pop-up menu in the {{ide|Resource Editor#IDE Designer|&amp;#039;&amp;#039;&amp;#039;IDE Designer&amp;#039;&amp;#039;&amp;#039;}}.)&lt;br /&gt;
&lt;br /&gt;
===== Controls Toolbar =====&lt;br /&gt;
&lt;br /&gt;
Originally the &amp;#039;&amp;#039;&amp;#039;Controls toolbar&amp;#039;&amp;#039;&amp;#039; is displayed below the {{ide|Resource Editor#IDE Designer|&amp;#039;&amp;#039;&amp;#039;IDE Designer&amp;#039;&amp;#039;&amp;#039;}} window. You see it in the following picture:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_Controls.png|center|frame|&amp;#039;&amp;#039;&amp;#039;The Controls Toolbar&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
Clicking icons in the &amp;#039;&amp;#039;&amp;#039;Controls toolbar&amp;#039;&amp;#039;&amp;#039; you select a type of a control to be placed into the edited dialog/window/form/IDE control (sometimes we will use the term &amp;#039;&amp;#039;container&amp;#039;&amp;#039; instead of dialog/window/form/IDE control). When you click a control type icon, then the current cursor is replaced with the cursor correspondent to the control type to be inserted. Move the cursor to some position in the container client area and click the mouse button. The control with the default size will be inserted at the specified position.&lt;br /&gt;
&lt;br /&gt;
Instead of dropping a control into a container with a click, it is possible to drag out the rectangle (in the container client area) where a control should be placed; so you can specify not only the control position but also the control size.&lt;br /&gt;
&lt;br /&gt;
After a VPI control is placed with the mouse into a {{ide|Resource_Editor#GUI and VPI Style Resources|VPI style container}}, the correspondent VPI control Attributes dialog appears. In this dialog you can change some control attributes, when you close the dialog, the control appears at the specified location in the container.&lt;br /&gt;
&lt;br /&gt;
After a GUI control is placed with the mouse into a {{ide|Resource_Editor#GUI and VPI Style Resources|GUI style container}}, it immediately appears at the specified location in the container. To change properties of the GUI control, one should select it then the list of GUI control properties appears in the {{ide|Resource Editor#GUI Control Properties Table|GUI control Properties table}}.&lt;br /&gt;
&lt;br /&gt;
There are the following icons in the &amp;#039;&amp;#039;&amp;#039;Controls toolbar:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
! Icon&lt;br /&gt;
! Insert a new:&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_PushBtn.png]]&lt;br /&gt;
| Push Button&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_PushBtn.png]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_CheckBx.png]]&lt;br /&gt;
| Check Box&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_Check.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_RadioBtn.png]]&lt;br /&gt;
| Radio Button&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_RB.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_StaText.png]]&lt;br /&gt;
| Static Text Control&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_Text.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_EditCtrl.png]]&lt;br /&gt;
| Edit Control&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_Edit.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_ListBox.png]]&lt;br /&gt;
| List Box&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_ListBox.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_ListBtn.png]]&lt;br /&gt;
| List Button&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_ListBtn.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_ListEdit.png]]&lt;br /&gt;
| List Edit&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_ListEdit.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_HScroll.png]]&lt;br /&gt;
| Horizontal Scroll Bar&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_HScroll.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_VScroll.png]]&lt;br /&gt;
| Vertical Scroll Bar&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_VScroll.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_GroupBox.png]]&lt;br /&gt;
| Group Box&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_Group.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_Icon.png]]&lt;br /&gt;
| Icon Control&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_Icon.png]].&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Ctrl_Custom.png]]&lt;br /&gt;
| Custom Control&lt;br /&gt;
| After selection of this control the cursor becomes [[Image:Ide_Cursor_Custom.png]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Selecting and Deselecting Controls =====&lt;br /&gt;
&lt;br /&gt;
Click inside a control to select one control. A frame appears around the selected control.&lt;br /&gt;
&lt;br /&gt;
To select a group of controls move the mouse pointer to the point in the dialog you want to be one corner of the selected area and press and hold the left mouse button. While holding the left mouse button move the mouse until all the desired controls in the dialog are inside the selected area. Then release the mouse button. All controls inside the specified rectangle will be selected.&lt;br /&gt;
&lt;br /&gt;
Also after one or more controls are already selected, you can include one extra control in the selection by holding down the &amp;#039;&amp;#039;&amp;#039;Ctrl&amp;#039;&amp;#039;&amp;#039; key and click the control.&lt;br /&gt;
&lt;br /&gt;
To deselect the control or group of controls click outside the selecting frame. Deselected controls lose their frame.&lt;br /&gt;
&lt;br /&gt;
===== Resizing Controls =====&lt;br /&gt;
&lt;br /&gt;
Once a control has been inserted in the dialog, it has a default size. To re-size a control, first click inside the control area to select it. Then move the cursor to the sizing handles on the selection frame. A new shape of cursor indicates the direction in which you can re-size the control. Press and hold the mouse button, drag until the selected control has the size you want, then release the mouse button.&lt;br /&gt;
&lt;br /&gt;
You can also change the size of a control by double-clicking it to activate the dialog for control attributes setting. Select the position you want to change and after specifying a new position or size, press enter to return to the dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Remark:&amp;#039;&amp;#039;&amp;#039; You cannot change the size of icons. You can only change their location.&lt;br /&gt;
&lt;br /&gt;
===== Moving Controls =====&lt;br /&gt;
&lt;br /&gt;
To move a control or a group of controls first select them. Then move the cursor inside the selection frame, press and hold the mouse button, drag the mouse pointer to a new location and release the mouse. Also, when one or more controls are selected, it is possible to use the cursor keys to move the selection in small steps (corresponding to the &amp;#039;&amp;#039;&amp;#039;Grid&amp;#039;&amp;#039;&amp;#039; settings).&lt;br /&gt;
&lt;br /&gt;
===== Arranging Controls =====&lt;br /&gt;
&lt;br /&gt;
To arrange a group of controls first select the group. Then click an appropriate button in the &amp;#039;&amp;#039;&amp;#039;Layout&amp;#039;&amp;#039;&amp;#039; toolbar or a menu item in the &amp;#039;&amp;#039;&amp;#039;Layout&amp;#039;&amp;#039;&amp;#039; menu of the IDE menu (or in the pop-up menu).&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_Layout.png|center|frame|&amp;#039;&amp;#039;&amp;#039;The Layout Toolbar&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Layout&amp;#039;&amp;#039;&amp;#039; commands for justifying and resizing controls:&lt;br /&gt;
&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Layout_AllignLeft.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Align Left&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Align the selected controls along their left sides.&lt;br /&gt;
|- &lt;br /&gt;
| [[Image:Ide_Layout_CenterVertically.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Align Center&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Center the selected controls vertically.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Layout_AllignRight.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Align Right&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Align the selected controls along their right sides.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Layout_AllignTops.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Align Top&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Align the selected controls along their tops.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Layout_CenterHorizontally.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Align Middle&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Center the selected controls horizontally.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Layout_AllignBottom.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Align Bottom&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Align the selected controls along their bottoms.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Layout_SpacingHorizontally.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Even Horizontal Spacing&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Spacing the selected controls evenly between the leftmost and the rightmost controls.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_GridButton.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Grid&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Toggle the Grid (see below).&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Layout_SpacingVertically.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Even Vertical Spacing&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Spacing the selected controls evenly between the topmost and the bottom-most controls.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Layout_SameSize.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Make Same Size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Make the selected controls the same size as a model control.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Layout_SameHorizontal.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Make Same Horizontal Size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Make the selected controls the same width as a model control.&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Ide_Layout_SameVertical.png]]&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Make Same Vertical Size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Make the selected controls the same height as a model control.&lt;br /&gt;
|-&lt;br /&gt;
|   &lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Size To Contents&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Resize the selected controls to optimally display its titles (caption texts).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Editing Properties of GUI Controls ====&lt;br /&gt;
&lt;br /&gt;
When you open a GUI dialog or a Form (GUI window) in the &amp;#039;&amp;#039;&amp;#039;IDE Designer&amp;#039;&amp;#039;&amp;#039;, then near from the opened dialog (form) the {{ide|Resource Editor#GUI Control Properties Table|&amp;#039;&amp;#039;&amp;#039;Control Properties table&amp;#039;&amp;#039;&amp;#039;}} appears.&lt;br /&gt;
&lt;br /&gt;
To change &amp;#039;&amp;#039;properties&amp;#039;&amp;#039; of a GUI package control first select this control (by clicking in it) in the dialog (form). The current set of the control properties appears in the &amp;#039;&amp;#039;&amp;#039;Control Properties&amp;#039;&amp;#039;&amp;#039; table. Now you can edit the displayed GUI control properties.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Click here to view {{ide|Resource Editor#GUI Control Properties Table|GUI Control Properties table}}&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The displayed set of properties depends on the control type. The {{ide|Resource Editor#GUI Control Properties Table|&amp;#039;&amp;#039;&amp;#039;Control Properties table&amp;#039;&amp;#039;&amp;#039;}} contains two types of properties. General properties are common to all types of controls and some properties, which are individual to different kinds of controls.&lt;br /&gt;
&lt;br /&gt;
Initially this &amp;#039;&amp;#039;&amp;#039;Control Properties&amp;#039;&amp;#039;&amp;#039; table is empty. However, as soon as one of controls in the edited dialog (form) is selected this table starts to display properties of the selected control.&lt;br /&gt;
&lt;br /&gt;
If the &amp;#039;&amp;#039;&amp;#039;Control Properties&amp;#039;&amp;#039;&amp;#039; table is closed, then double-click a control - the &amp;#039;&amp;#039;&amp;#039;Control Properties&amp;#039;&amp;#039;&amp;#039; table appears. Also the &amp;#039;&amp;#039;&amp;#039;Control Attributes&amp;#039;&amp;#039;&amp;#039; command, from the &amp;#039;&amp;#039;&amp;#039;IDE Designer&amp;#039;&amp;#039;&amp;#039; {{ide|Resource Editor#Speed Menu|speed menu}}, can be used to open the &amp;#039;&amp;#039;&amp;#039;Control Properties&amp;#039;&amp;#039;&amp;#039; table.&lt;br /&gt;
{{:ide/Resource Editor/GUI Control Properties Table}}&lt;br /&gt;
&lt;br /&gt;
==== Editing Attributes of VPI Controls ====&lt;br /&gt;
&lt;br /&gt;
To change attributes of a VPI package control double-click it or select the control and activates the &amp;#039;&amp;#039;&amp;#039;Control Attributes&amp;#039;&amp;#039;&amp;#039; command from the &amp;#039;&amp;#039;&amp;#039;IDE Designer&amp;#039;&amp;#039;&amp;#039; {{ide|Resource Editor#Speed Menu|speed menu}}. Then the &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;ControlType&amp;gt;&amp;#039;&amp;#039; Attributes&amp;#039;&amp;#039;&amp;#039; dialog appears.&lt;br /&gt;
&lt;br /&gt;
These dialogs contains two levels of attributes. The general group contains attributes, which are common to all types of controls: the &amp;#039;&amp;#039;&amp;#039;Text&amp;#039;&amp;#039;&amp;#039; determines the control title, the &amp;#039;&amp;#039;&amp;#039;Constant&amp;#039;&amp;#039;&amp;#039; (name) is used as the control identifier, and the &amp;#039;&amp;#039;&amp;#039;Control Size&amp;#039;&amp;#039;&amp;#039; group determines position and size of the control.&lt;br /&gt;
&lt;br /&gt;
Notice that the &amp;#039;&amp;#039;&amp;#039;Text&amp;#039;&amp;#039;&amp;#039; property/attribute is not used for some controls, for instance, it is not used for scroll bars.&lt;br /&gt;
&lt;br /&gt;
Notice that in the &amp;#039;&amp;#039;&amp;#039;Text&amp;#039;&amp;#039;&amp;#039; fields the ampersand symbol &amp;lt;vp&amp;gt;&amp;amp;&amp;lt;/vp&amp;gt; is reserved for indicating that the next to it character is to be underlined. For example, if you use the text string &amp;#039;&amp;#039;&amp;#039;E&amp;amp;xit&amp;#039;&amp;#039;&amp;#039; as a control name, then this control will be displayed with the title &amp;#039;&amp;#039;&amp;#039;E&amp;lt;u&amp;gt;x&amp;lt;/u&amp;gt;it&amp;#039;&amp;#039;&amp;#039; at runtime. I.e. the char &amp;#039;&amp;#039;&amp;#039;&amp;lt;u&amp;gt;x&amp;lt;/u&amp;gt;&amp;#039;&amp;#039;&amp;#039; will be displayed underlined (thus visually indicating that the &amp;#039;&amp;#039;&amp;#039;&amp;lt;u&amp;gt;x&amp;lt;/u&amp;gt;&amp;#039;&amp;#039;&amp;#039; is an accelerator key). If you need to display the ampersand &amp;lt;vp&amp;gt;&amp;amp;&amp;lt;/vp&amp;gt; symbol in the &amp;#039;&amp;#039;&amp;#039;Text&amp;#039;&amp;#039;&amp;#039; of a control, then use two of them &amp;lt;vp&amp;gt;&amp;amp;&amp;amp;&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Other attributes are individual to different kinds of controls.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Using Anchors for Positioning GUI Controls while Dialog Resizing ====&lt;br /&gt;
&lt;br /&gt;
VPI controls remember in their attributes ({{ide|Resource Editor#Attributes of VPI Controls|&amp;#039;&amp;#039;&amp;#039;Attributes of VPI Controls&amp;#039;&amp;#039;&amp;#039;}}) only their absolute positions and sizes. Therefore, when a VPI dialog or a VPI window containing such VPI controls are resized, these VPI controls do not change their positions and sizes!&lt;br /&gt;
&lt;br /&gt;
In difference to them GUI controls have additional &amp;#039;&amp;#039;Anchor&amp;#039;&amp;#039; properties, which help to reposition (and may be resize) GUI controls when containing them GUI dialog (or form) is resized.&lt;br /&gt;
&lt;br /&gt;
Each GUI control has four anchor properties: &amp;#039;&amp;#039;&amp;#039;Left Anchor&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Top Anchor&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Right Anchor&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;Bottom Anchor&amp;#039;&amp;#039;&amp;#039; (see {{ide|Resource Editor#GUI Control Properties Table|&amp;#039;&amp;#039;&amp;#039;Anchor Properties of GUI Controls&amp;#039;&amp;#039;&amp;#039;}}).&lt;br /&gt;
&lt;br /&gt;
Each anchor determines that the specified (&amp;#039;&amp;#039;&amp;#039;Left&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Top&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Right&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;Bottom&amp;#039;&amp;#039;&amp;#039;) control boundary should be &amp;#039;&amp;#039;&amp;#039;always&amp;#039;&amp;#039;&amp;#039; positioned on the stated distance from the nearest (correspondent) border of the dialog (frame).&lt;br /&gt;
&lt;br /&gt;
Each of anchors can have the &amp;#039;&amp;#039;&amp;#039;True&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;False&amp;#039;&amp;#039;&amp;#039; values. When the anchor value is &amp;#039;&amp;#039;&amp;#039;True&amp;#039;&amp;#039;&amp;#039;, then this anchor is active (used to position the correspondent control).&lt;br /&gt;
&lt;br /&gt;
For example, when the &amp;#039;&amp;#039;&amp;#039;Left Anchor&amp;#039;&amp;#039;&amp;#039; is active (has the &amp;#039;&amp;#039;&amp;#039;True&amp;#039;&amp;#039;&amp;#039; value), then the &amp;#039;&amp;#039;left&amp;#039;&amp;#039; control boundary should be positioned on the stated distance from the nearest (&amp;#039;&amp;#039;left&amp;#039;&amp;#039;) border of the dialog (frame).&lt;br /&gt;
&lt;br /&gt;
The simplest way to see which anchors are active for a control, is to select this control. Then some red arrows between control boundaries and correspondent boundaries of the dialog can bee seen. Each arrow specifies, that the correspondent anchor is active. For example, the arrow from the control top to the dialog top identifies, that the &amp;#039;&amp;#039;&amp;#039;Top Anchor&amp;#039;&amp;#039;&amp;#039; is active. In the picture below, you see three arrows, which specify that the &amp;#039;&amp;#039;&amp;#039;Left&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Top&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;Right&amp;#039;&amp;#039;&amp;#039; anchors are active to the &amp;#039;&amp;#039;&amp;#039;Push Button&amp;#039;&amp;#039;&amp;#039; control.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_de_Anchors.png|center]]&lt;br /&gt;
&lt;br /&gt;
Numbers near such arrows show distances (in Dialog Base Units) between the correspondent boundaries of the control and the dialog.&lt;br /&gt;
&lt;br /&gt;
Normally each control has one active horizontal and one active vertical anchors. When the dialog is resized, then such control is always positioned on the specified distances from the specified boundaries of the dialog. The size of the control is not changed!&lt;br /&gt;
&lt;br /&gt;
When a control has both horizontal (or/and both vertical) anchors active, then both horizontal (or/and both vertical) boundaries of the control should be placed on some specified distances from the correspondent horizontal (vertical) boundaries of the dialog. Therefore, when the dialog is resized, then such control is also resized accordingly to keep the specified distances.&lt;br /&gt;
&lt;br /&gt;
When no one of horizontal (or vertical) anchors of a control are active, then no one of horizontal (or vertical) boundaries of the control are bounded to the correspondent horizontal (vertical) boundaries of the dialog. Coordinates of such controls are handles on the &amp;quot;proportional basis&amp;quot;. For example, when the dialog width is increased onto &amp;lt;vp&amp;gt;Delta&amp;lt;/vp&amp;gt; dialog base units, then the &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; coordinate of the control is also increased, but it is increased two times smaller. That is the &amp;lt;vp&amp;gt;X&amp;lt;/vp&amp;gt; coordinate of the control is increased only onto &amp;lt;vp&amp;gt;Delta/2&amp;lt;/vp&amp;gt; dialog base units.&lt;br /&gt;
&lt;br /&gt;
==== Cut, Copy and Paste, Undo and Redo ====&lt;br /&gt;
&lt;br /&gt;
You can &amp;#039;&amp;#039;&amp;#039;Cut&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;Copy&amp;#039;&amp;#039;&amp;#039; a group of selected controls onto the Windows clipboard, and &amp;#039;&amp;#039;&amp;#039;Paste&amp;#039;&amp;#039;&amp;#039; controls from the clipboard back into a dialog. The &amp;#039;&amp;#039;&amp;#039;Undo&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Redo&amp;#039;&amp;#039;&amp;#039; commands serve to delete or restore the last editing operations of your dialog.&lt;br /&gt;
&lt;br /&gt;
==== Grid ====&lt;br /&gt;
&lt;br /&gt;
When the menu (or the pop-up menu) entry &amp;#039;&amp;#039;&amp;#039;Resource | Grid&amp;#039;&amp;#039;&amp;#039; is activated, or when the [[Image:Ide_GridButton.png]] button from the &amp;#039;&amp;#039;&amp;#039;Layout&amp;#039;&amp;#039;&amp;#039; toolbar is pressed, the following dialog appears:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_GridSpecification.png|center|frame|&amp;#039;&amp;#039;&amp;#039;The Dialog to Specify the Grid Properties&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
With a grid in place, arranging the controls inside a dialog is easier. Also it is possible to tell the {{ide|Resource Editor#IDE Designer|&amp;#039;&amp;#039;&amp;#039;IDE Designer&amp;#039;&amp;#039;&amp;#039;}} by the &amp;#039;&amp;#039;&amp;#039;Snap to Grid&amp;#039;&amp;#039;&amp;#039; that it should place controls at the grid intersections to give a satisfactory result.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_MyDialog_withGrid.png|center|frame|&amp;#039;&amp;#039;&amp;#039;Using a grid in the Dialog/Window/Form Editor&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
==== Test Mode ====&lt;br /&gt;
&lt;br /&gt;
The {{ide|Resource Editor#IDE Designer|&amp;#039;&amp;#039;&amp;#039;IDE Designer&amp;#039;&amp;#039;&amp;#039;}} has the &amp;#039;&amp;#039;&amp;#039;Test Mode&amp;#039;&amp;#039;&amp;#039;, so it is possible to see how the dialog with the created controls behaves. To illustrate the &amp;#039;&amp;#039;&amp;#039;Test Mode&amp;#039;&amp;#039;&amp;#039; we will assign some default values to the controls. The test mode is activated and deactivated from the &amp;#039;&amp;#039;&amp;#039;Resource&amp;#039;&amp;#039;&amp;#039; menu (or from the pop-up menu).&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_MyDialog_TestMode.png|center|frame|&amp;#039;&amp;#039;&amp;#039;Test Mode for a Dialog&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
==== Tab Stops ====&lt;br /&gt;
&lt;br /&gt;
When activating the menu (or the pop-up menu) entry &amp;#039;&amp;#039;&amp;#039;Resource | Tabstops&amp;#039;&amp;#039;&amp;#039;, it is possible to specify to which controls you can Tab to in the dialog. When this command is activated a small button with the &amp;lt;vp&amp;gt;+&amp;lt;/vp&amp;gt; or &amp;lt;vp&amp;gt;-&amp;lt;/vp&amp;gt; appears on controls depending upon whether the control has a tab stop or not. By clicking the small buttons, it is possible to toggle the setting.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_MyDialog_TabStops.png|center|frame|&amp;#039;&amp;#039;&amp;#039;Specifying Tab Stops for a Dialog&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
To exit the tab stop mode, just click in the dialog but outside of any controls.&lt;br /&gt;
&lt;br /&gt;
==== Visit Order ====&lt;br /&gt;
&lt;br /&gt;
When the tab stops have been specified for a dialog, then it is possible to specify the order in which controls will receive focus when tabbing.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_MyDialog_VisitOrder.png|center|frame|&amp;#039;&amp;#039;&amp;#039;Displaying the Visit Order&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
To change the visit order, click a small rectangle displaying the visit order number for a control that has an incorrect sequence number and this will bring up another dialog to change this sequence:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_MyDialog_ChangeVisitOrder.png|center|frame|&amp;#039;&amp;#039;&amp;#039;Changing the Visit Order&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
To stop the visit order mode, just click in the dialog outside any controls.&lt;br /&gt;
&lt;br /&gt;
==== Speed Menu ====&lt;br /&gt;
&lt;br /&gt;
When you are in the {{ide|Resource Editor#IDE Designer|&amp;#039;&amp;#039;&amp;#039;IDE Designer&amp;#039;&amp;#039;&amp;#039;}} you can click the right mouse button to activate the Speed Menu. From this menu you can easily call any {{ide|Resource Editor#IDE Designer|&amp;#039;&amp;#039;&amp;#039;IDE Designer&amp;#039;&amp;#039;&amp;#039;}} command:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_We_SpeedMenu.png|center|frame|&amp;#039;&amp;#039;&amp;#039;The IDE Designer Speed Menu&amp;#039;&amp;#039;&amp;#039;]]&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Ide/Creating_new_Project_Items/Creating_a_COM_Package&amp;diff=3617</id>
		<title>Ide/Creating new Project Items/Creating a COM Package</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Ide/Creating_new_Project_Items/Creating_a_COM_Package&amp;diff=3617"/>
		<updated>2013-05-23T09:22:51Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: /* Options */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;[[Category:Ide]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;How to Import an Existing COM Component&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
=== Terminology Used in COM ===&lt;br /&gt;
&lt;br /&gt;
The Component Object Model (COM) is a way for software components to communicate with each other. It is a binary standard that allows any two components to communicate regardless of what machine they are running on (as long as the machines are connected), what operating systems the machines are running (as long as they support COM), and what language the components are written in. COM provides location transparency: it does not matter whether components are in DLLs or in EXEs. COM components are binary units of code that include packaging and registration code and that create COM objects. Each COM component, in the COM programming model, is a programming structure encapsulating both data and functionality. It is defined and allocated as a single unit and the only public access to the COM data and functionality is through the programming interfaces.&lt;br /&gt;
&lt;br /&gt;
Each COM is simply a program module: a DLL or an EXE file. It can contain one or more COM &amp;#039;&amp;#039;components&amp;#039;&amp;#039;. (In Microsoft MSDN terminology &amp;#039;&amp;#039;components&amp;#039;&amp;#039; are &amp;#039;&amp;#039;coclasses&amp;#039;&amp;#039;.) Each component knows about several interfaces. (In MSDN terminology - each component can support several interfaces.) Each component supports the default interface &amp;#039;&amp;#039;&amp;#039;iUnknown&amp;#039;&amp;#039;&amp;#039;. Using the &amp;#039;&amp;#039;&amp;#039;iUnknown::queryInterface/2-&amp;gt;&amp;#039;&amp;#039;&amp;#039; predicate from the &amp;#039;&amp;#039;&amp;#039;iUnknown&amp;#039;&amp;#039;&amp;#039; interface, one can retrieve references to all interfaces known to a component. Each interface can provide several predicates (methods).&lt;br /&gt;
&lt;br /&gt;
The main aim of importing a COM component into your project is using predicates defined in this COM component. Therefore, the COM package generated for an imported COM component has to provide some wrapper (glue code) to methods implemented in the COM component. That is, the generated COM package must provide declarations of correspondent interfaces, predicates, and domains.&lt;br /&gt;
&lt;br /&gt;
=== How to Create a New COM Package ===&lt;br /&gt;
&lt;br /&gt;
To create a COM package providing the interface (wrapper) to some COM component, you should activate the &amp;#039;&amp;#039;&amp;#039;File | New&amp;#039;&amp;#039;&amp;#039; IDE command. Then in the left pane of the opened &amp;#039;&amp;#039;&amp;#039;Create Project Item&amp;#039;&amp;#039;&amp;#039; dialog you should select &amp;#039;&amp;#039;&amp;#039;COM Package&amp;#039;&amp;#039;&amp;#039;. Then the dialog accepts the following shape:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_How_COMPackage.png|center|frame|Creating &amp;#039;&amp;#039;&amp;#039;New COM Package&amp;#039;&amp;#039;&amp;#039; Dialog]]&lt;br /&gt;
&lt;br /&gt;
After you fill in all required COM package settings, you can press the &amp;#039;&amp;#039;&amp;#039;Create&amp;#039;&amp;#039;&amp;#039; button. Then the IDE creates the package subdirectory, the package header file (&amp;lt;vp&amp;gt;XML.ph&amp;lt;/vp&amp;gt; for the above picture), and the package implementation file (&amp;lt;vp&amp;gt;XML.pack&amp;lt;/vp&amp;gt; for the above picture). They appear in the project tree in the Project Window after the created package is compiled.&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Name:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:In the &amp;#039;&amp;#039;&amp;#039;Name&amp;#039;&amp;#039;&amp;#039; edit control you should type in the name (&amp;lt;vp&amp;gt;XML&amp;lt;/vp&amp;gt; on the picture) of the COM package (wrapping package) being created.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parent Directory&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:In the &amp;#039;&amp;#039;&amp;#039;Parent Directory&amp;#039;&amp;#039;&amp;#039; you should type in or select (using the &amp;#039;&amp;#039;&amp;#039;Browse&amp;#039;&amp;#039;&amp;#039; button) the &amp;#039;&amp;#039;parent directory&amp;#039;&amp;#039; for the package. The package will be placed into the subdirectory of this &amp;#039;&amp;#039;parent directory&amp;#039;&amp;#039;. If you specify a non-existing name, then this directory will be created. By default, &amp;#039;&amp;#039;&amp;#039;Parent Directory&amp;#039;&amp;#039;&amp;#039; displays the directory selected in the project tree when you activate this dialog. If this directory is one of the project subdirectories, then its path is displayed relatively to the project root directory. If &amp;#039;&amp;#039;&amp;#039;Parent Directory&amp;#039;&amp;#039;&amp;#039; is empty, than it is equal to the project root directory.&lt;br /&gt;
:In the &amp;#039;&amp;#039;&amp;#039;Parent Directory&amp;#039;&amp;#039;&amp;#039; the IDE creates the new subdirectory with the name correspondent to the specified package name. (It is &amp;lt;vp&amp;gt;XML&amp;lt;/vp&amp;gt; for the above picture.). The package will be placed into this subdirectory.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039; Group Box&lt;br /&gt;
&lt;br /&gt;
Controls in this group box are used to specify a COM module (&amp;#039;&amp;#039;&amp;#039;DLL&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;EXE&amp;#039;&amp;#039;&amp;#039;) from which a component should be imported. It contains the following controls:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Type Library&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:When this option is checked ON, then in the edit control you should specify a file that contains the &amp;#039;&amp;#039;type library&amp;#039;&amp;#039; describing the COM component.&lt;br /&gt;
*:Press the &amp;#039;&amp;#039;&amp;#039;Load&amp;#039;&amp;#039;&amp;#039; button to activate the &amp;#039;&amp;#039;&amp;#039;Load Type Library File&amp;#039;&amp;#039;&amp;#039; dialog using which you can find and insert the name of the type library file into the edit control.&lt;br /&gt;
*:&amp;lt;br /&amp;gt;&amp;lt;u&amp;gt;&amp;#039;&amp;#039;&amp;#039;Attention!&amp;#039;&amp;#039;&amp;#039;&amp;lt;/u&amp;gt; Notice that you &amp;#039;&amp;#039;&amp;#039;HAVE to&amp;#039;&amp;#039;&amp;#039; press the &amp;#039;&amp;#039;&amp;#039;Load&amp;#039;&amp;#039;&amp;#039; button to enforce the IDE to load the COM information from the specified type library even if you directly type in the type library filename into the edit control.&lt;br /&gt;
*:&amp;lt;br /&amp;gt;If a COM client (our program importing COM server components) needs using COM server predicates, then the client application must have information about predicates in COM server components. Predicates often return values and accept parameters. The COM client requires declarations of all these predicates (and domains) in order to use them. This information can be made known in several ways. The Microsoft recommended way is to create a type library. (Remember that type libraries do not provide Prolog declarations.) Type library information can be stored in files with the following filename extensions: &amp;#039;&amp;#039;&amp;#039;.tlb&amp;#039;&amp;#039;&amp;#039; (type library itself), &amp;#039;&amp;#039;&amp;#039;.olb&amp;#039;&amp;#039;&amp;#039; (multiple type libraries or foreign object libraries), &amp;#039;&amp;#039;&amp;#039;.dll&amp;#039;&amp;#039;&amp;#039; (COM DLLs can embed type library resources), &amp;#039;&amp;#039;&amp;#039;.exe&amp;#039;&amp;#039;&amp;#039; (COM EXEs can embed type library resources), &amp;#039;&amp;#039;&amp;#039;.ocx&amp;#039;&amp;#039;&amp;#039; (ActiveX controls).&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;TypeLib ID&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:When this option is checked ON, then in the edit control you should specify the &amp;#039;&amp;#039;&amp;#039;TypeLib ID&amp;#039;&amp;#039;&amp;#039; of the &amp;#039;&amp;#039;type library&amp;#039;&amp;#039; for the COM component that you wish to import. The &amp;#039;&amp;#039;&amp;#039;TypeLib ID&amp;#039;&amp;#039;&amp;#039; is a universally unique identifier (UUID) under which the type library is registered in the Windows system registry. (See &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; for more information.) The &amp;#039;&amp;#039;&amp;#039;TypeLib ID&amp;#039;&amp;#039;&amp;#039; should be specified as a string of hexadecimal numbers with the following format:&lt;br /&gt;
*: &amp;lt;vipbnf&amp;gt;{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*:Then you &amp;#039;&amp;#039;&amp;#039;MUST&amp;#039;&amp;#039;&amp;#039; press the &amp;#039;&amp;#039;&amp;#039;Load&amp;#039;&amp;#039;&amp;#039; button to enforce the IDE to load COM information from the type library registered with this &amp;#039;&amp;#039;&amp;#039;TypeLib ID&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
*:In the system registry database you can find all registered &amp;#039;&amp;#039;&amp;#039;TypeLib ID&amp;#039;&amp;#039;&amp;#039;s under:&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;&amp;lt;vipbnf&amp;gt;HKEY_CLASSES_ROOT\TypeLib = {TypeLib ID}&amp;lt;/vipbnf&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:When this option is checked ON, then in the edit control you should specify the &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; of the COM component that you wish to import. The &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; should be specified as a string of hexadecimal numbers with the following format:&lt;br /&gt;
*:&amp;lt;vipbnf&amp;gt;{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*:Then you &amp;#039;&amp;#039;&amp;#039;MUST&amp;#039;&amp;#039;&amp;#039; press the &amp;#039;&amp;#039;&amp;#039;Load&amp;#039;&amp;#039;&amp;#039; button to enforce the IDE to load COM information from the COM module that embeds the COM component with the specified &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
*:&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;&amp;#039;Note.&amp;#039;&amp;#039;&amp;#039; Really a COM module can embed several COM components. If you wish to import one of these COM components, then you can specify a CLSID registered to any COM component in this COM module. (Later you will be able to specify the required COM component (or interface) in the list box.&lt;br /&gt;
*:&amp;lt;br /&amp;gt;In MSDN terminology, &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; is a class identifier. In the Visual Prolog PFC terminology (see the COM package description in the PFC) &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; is a COM component identifier.&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; is a universally unique identifier (UUID) that identifies the type of a COM component. Each COM component has its &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; in the Windows system registry database so that it can be loaded and used by other applications. For example, a spreadsheet can create worksheet components, chart components, and macrosheet components. Each of these components has its own &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; that uniquely identifies this component to the system. That is, if your COM module (COM server or COM container) allows linking to its embedded components, then you need to register the special &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; for each COM component embedded into the COM module.&lt;br /&gt;
*:The &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; is stored in the Windows registry database under the following registry key:&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;&amp;lt;vipbnf&amp;gt;HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID = {CLSID}&amp;lt;/vipbnf&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:The &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; is a 128-bit number (in the hexadecimal format) within a pair of curly braces. Typically, &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039;s (and other UUID values) are represented as strings of hexadecimal numbers with the following format:&lt;br /&gt;
*:&amp;lt;vipbnf&amp;gt;{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*:For example,&lt;br /&gt;
*:&amp;lt;vipbnf&amp;gt;{4208fb66-e22a-11d1-a7d7-00a0c982c00d}&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*:You can use the &amp;#039;&amp;#039;&amp;#039;UUIDGEN.exe&amp;#039;&amp;#039;&amp;#039; tool to create a new UUID.&lt;br /&gt;
*:When you find a &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; you can find the associated &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039; under the following registry sub-key:&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;&amp;lt;vipbnf&amp;gt;HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{CLSID}\ProgID = &amp;lt;programatic identifier&amp;gt;&amp;lt;/vipbnf&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:See the &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039; options description below.&lt;br /&gt;
*:&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;&amp;#039;Universally unique identifier (UUID)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;lt;br /&amp;gt;The universally unique identifier (UUID) is also known as the globally unique identifier (GUID). The UUID, or GUID, is a unique, 128-bit value used to identify objects. Objects can be OLE servers, interfaces, client objects, etc. Beginning from this moment objects will be identified with UUIDs.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:When this option is checked ON. In the edit control you should specify the &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039; of the COM module from which you wish to import the COM component. The &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039; should be specified as a string of the following format:&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;&amp;lt;Program&amp;gt;.&amp;lt;Component&amp;gt;.&amp;lt;Version&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;lt;br /&amp;gt;Words are separated by dots as in &amp;lt;vp&amp;gt;Word.Document.6&amp;lt;/vp&amp;gt;. (Blank spaces cannot be used.)&lt;br /&gt;
*:Then you &amp;#039;&amp;#039;&amp;#039;MUST&amp;#039;&amp;#039;&amp;#039; press the &amp;#039;&amp;#039;&amp;#039;Load&amp;#039;&amp;#039;&amp;#039; button to enforce the IDE to load COM information from the COM module registered with this &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039;s are versioned programmatic identifiers. &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039;s present human-readable versions of class identifiers (&amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039;) used to identify COM components. &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039; is a registry entry that can be associated with &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039;. Like &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039; identifies a COM component but with less precision because it is not guaranteed to be globally unique. The &amp;#039;&amp;#039;&amp;lt;vp&amp;gt;Version&amp;lt;/vp&amp;gt;&amp;#039;&amp;#039; portion is optional but strongly recommended. Using &amp;#039;&amp;#039;&amp;lt;vp&amp;gt;Version&amp;lt;/vp&amp;gt;&amp;#039;&amp;#039;, even if there is only one version of the &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039;, helps to avoid conflicts. It enables different versions of a component coexist without overwriting &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039;s. If you do not specify a version for a &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039;, the default &amp;#039;&amp;#039;&amp;lt;vp&amp;gt;Version&amp;lt;/vp&amp;gt;&amp;#039;&amp;#039; &amp;lt;vp&amp;gt;= 1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
*:How to find &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039; entries in the registry is described in the &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;IID&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:When this option is checked ON, then in the edit control you should specify the &amp;#039;&amp;#039;&amp;#039;IID&amp;#039;&amp;#039;&amp;#039; of the COM component interface that you wish to import.&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;IID&amp;#039;&amp;#039;&amp;#039; is a universally unique identifier (UUID) that uniquely identifies a particular COM interface. &amp;#039;&amp;#039;&amp;#039;IID&amp;#039;&amp;#039;&amp;#039; should be specified as a string of hexadecimal numbers with the following format:&lt;br /&gt;
*:&amp;lt;vipbnf&amp;gt;{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*:Then you &amp;#039;&amp;#039;&amp;#039;MUST&amp;#039;&amp;#039;&amp;#039; press the &amp;#039;&amp;#039;&amp;#039;Load&amp;#039;&amp;#039;&amp;#039; button to enforce the IDE to load COM information from the COM module that embeds the interface with the specified &amp;#039;&amp;#039;&amp;#039;IID&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
*:Really you can specify an &amp;#039;&amp;#039;&amp;#039;IID&amp;#039;&amp;#039;&amp;#039; registered to any interface embedded into the same COM module that embeds the interface you wish to import. (Later you will be able to specify the required COM component (or interface) in the list box.&lt;br /&gt;
*:In the system registry database you can find all registered &amp;#039;&amp;#039;&amp;#039;IID&amp;#039;&amp;#039;&amp;#039;s under:&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;&amp;lt;vipbnf&amp;gt;HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface&amp;lt;/vipbnf&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Ide/Creating_new_Project_Items/Creating_a_COM_Package&amp;diff=3616</id>
		<title>Ide/Creating new Project Items/Creating a COM Package</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Ide/Creating_new_Project_Items/Creating_a_COM_Package&amp;diff=3616"/>
		<updated>2013-05-23T09:18:59Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: /* Options */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;[[Category:Ide]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;How to Import an Existing COM Component&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
=== Terminology Used in COM ===&lt;br /&gt;
&lt;br /&gt;
The Component Object Model (COM) is a way for software components to communicate with each other. It is a binary standard that allows any two components to communicate regardless of what machine they are running on (as long as the machines are connected), what operating systems the machines are running (as long as they support COM), and what language the components are written in. COM provides location transparency: it does not matter whether components are in DLLs or in EXEs. COM components are binary units of code that include packaging and registration code and that create COM objects. Each COM component, in the COM programming model, is a programming structure encapsulating both data and functionality. It is defined and allocated as a single unit and the only public access to the COM data and functionality is through the programming interfaces.&lt;br /&gt;
&lt;br /&gt;
Each COM is simply a program module: a DLL or an EXE file. It can contain one or more COM &amp;#039;&amp;#039;components&amp;#039;&amp;#039;. (In Microsoft MSDN terminology &amp;#039;&amp;#039;components&amp;#039;&amp;#039; are &amp;#039;&amp;#039;coclasses&amp;#039;&amp;#039;.) Each component knows about several interfaces. (In MSDN terminology - each component can support several interfaces.) Each component supports the default interface &amp;#039;&amp;#039;&amp;#039;iUnknown&amp;#039;&amp;#039;&amp;#039;. Using the &amp;#039;&amp;#039;&amp;#039;iUnknown::queryInterface/2-&amp;gt;&amp;#039;&amp;#039;&amp;#039; predicate from the &amp;#039;&amp;#039;&amp;#039;iUnknown&amp;#039;&amp;#039;&amp;#039; interface, one can retrieve references to all interfaces known to a component. Each interface can provide several predicates (methods).&lt;br /&gt;
&lt;br /&gt;
The main aim of importing a COM component into your project is using predicates defined in this COM component. Therefore, the COM package generated for an imported COM component has to provide some wrapper (glue code) to methods implemented in the COM component. That is, the generated COM package must provide declarations of correspondent interfaces, predicates, and domains.&lt;br /&gt;
&lt;br /&gt;
=== How to Create a New COM Package ===&lt;br /&gt;
&lt;br /&gt;
To create a COM package providing the interface (wrapper) to some COM component, you should activate the &amp;#039;&amp;#039;&amp;#039;File | New&amp;#039;&amp;#039;&amp;#039; IDE command. Then in the left pane of the opened &amp;#039;&amp;#039;&amp;#039;Create Project Item&amp;#039;&amp;#039;&amp;#039; dialog you should select &amp;#039;&amp;#039;&amp;#039;COM Package&amp;#039;&amp;#039;&amp;#039;. Then the dialog accepts the following shape:&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_How_COMPackage.png|center|frame|Creating &amp;#039;&amp;#039;&amp;#039;New COM Package&amp;#039;&amp;#039;&amp;#039; Dialog]]&lt;br /&gt;
&lt;br /&gt;
After you fill in all required COM package settings, you can press the &amp;#039;&amp;#039;&amp;#039;Create&amp;#039;&amp;#039;&amp;#039; button. Then the IDE creates the package subdirectory, the package header file (&amp;lt;vp&amp;gt;XML.ph&amp;lt;/vp&amp;gt; for the above picture), and the package implementation file (&amp;lt;vp&amp;gt;XML.pack&amp;lt;/vp&amp;gt; for the above picture). They appear in the project tree in the Project Window after the created package is compiled.&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Name:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:In the &amp;#039;&amp;#039;&amp;#039;Name&amp;#039;&amp;#039;&amp;#039; edit control you should type in the name (&amp;lt;vp&amp;gt;XML&amp;lt;/vp&amp;gt; on the picture) of the COM package (wrapping package) being created.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parent Directory&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:In the &amp;#039;&amp;#039;&amp;#039;Parent Directory&amp;#039;&amp;#039;&amp;#039; you should type in or select (using the &amp;#039;&amp;#039;&amp;#039;Browse&amp;#039;&amp;#039;&amp;#039; button) the &amp;#039;&amp;#039;parent directory&amp;#039;&amp;#039; for the package. The package will be placed into the subdirectory of this &amp;#039;&amp;#039;parent directory&amp;#039;&amp;#039;. If you specify a non-existing name, then this directory will be created. By default, &amp;#039;&amp;#039;&amp;#039;Parent Directory&amp;#039;&amp;#039;&amp;#039; displays the directory selected in the project tree when you activate this dialog. If this directory is one of the project subdirectories, then its path is displayed relatively to the project root directory. If &amp;#039;&amp;#039;&amp;#039;Parent Directory&amp;#039;&amp;#039;&amp;#039; is empty, than it is equal to the project root directory.&lt;br /&gt;
:In the &amp;#039;&amp;#039;&amp;#039;Parent Directory&amp;#039;&amp;#039;&amp;#039; the IDE creates the new subdirectory with the name correspondent to the specified package name. (It is &amp;lt;vp&amp;gt;XML&amp;lt;/vp&amp;gt; for the above picture.). The package will be placed into this subdirectory.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039; Group Box&lt;br /&gt;
&lt;br /&gt;
Controls in this group box are used to specify a COM module (&amp;#039;&amp;#039;&amp;#039;DLL&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;EXE&amp;#039;&amp;#039;&amp;#039;) from which a component should be imported. It contains the following controls:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Type Library&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:When this option is checked ON, then in the edit control you should specify a file that contains the &amp;#039;&amp;#039;type library&amp;#039;&amp;#039; describing the COM component.&lt;br /&gt;
*:Press the &amp;#039;&amp;#039;&amp;#039;Load&amp;#039;&amp;#039;&amp;#039; button to activate the &amp;#039;&amp;#039;&amp;#039;Load Type Library File&amp;#039;&amp;#039;&amp;#039; dialog using which you can find and insert the name of the type library file into the edit control.&lt;br /&gt;
*:&amp;lt;br /&amp;gt;&amp;lt;u&amp;gt;&amp;#039;&amp;#039;&amp;#039;Attention!&amp;#039;&amp;#039;&amp;#039;&amp;lt;/u&amp;gt; Notice that you &amp;#039;&amp;#039;&amp;#039;HAVE to&amp;#039;&amp;#039;&amp;#039; press the &amp;#039;&amp;#039;&amp;#039;Load&amp;#039;&amp;#039;&amp;#039; button to enforce the IDE to load the COM information from the specified type library even if you directly type in the type library filename into the edit control.&lt;br /&gt;
*:&amp;lt;br /&amp;gt;If a COM client (our program importing COM server components) needs using COM server predicates, then the client application must have information about predicates in COM server components. Predicates often return values and accept parameters. The COM client requires declarations of all these predicates (and domains) in order to use them. This information can be made known in several ways. The Microsoft recommended way is to create a type library. (Remember that type libraries do not provide Prolog declarations.) Type library information can be stored in files with the following filename extensions: &amp;#039;&amp;#039;&amp;#039;.tlb&amp;#039;&amp;#039;&amp;#039; (type library itself), &amp;#039;&amp;#039;&amp;#039;.olb&amp;#039;&amp;#039;&amp;#039; (multiple type libraries or foreign object libraries), &amp;#039;&amp;#039;&amp;#039;.dll&amp;#039;&amp;#039;&amp;#039; (COM DLLs can embed type library resources), &amp;#039;&amp;#039;&amp;#039;.exe&amp;#039;&amp;#039;&amp;#039; (COM EXEs can embed type library resources), &amp;#039;&amp;#039;&amp;#039;.ocx&amp;#039;&amp;#039;&amp;#039; (ActiveX controls).&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;TypeLib ID&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:When this option is checked ON, then in the edit control you should specify the &amp;#039;&amp;#039;&amp;#039;TypeLib ID&amp;#039;&amp;#039;&amp;#039; of the &amp;#039;&amp;#039;type library&amp;#039;&amp;#039; for the COM component that you wish to import. The &amp;#039;&amp;#039;&amp;#039;TypeLib ID&amp;#039;&amp;#039;&amp;#039; is a universally unique identifier (UUID) under which the type library is registered in the Windows system registry. (See &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; for more information.) The &amp;#039;&amp;#039;&amp;#039;TypeLib ID&amp;#039;&amp;#039;&amp;#039; should be specified as a string of hexadecimal numbers with the following format:&lt;br /&gt;
*: &amp;lt;vipbnf&amp;gt;{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*:Then you &amp;#039;&amp;#039;&amp;#039;MUST&amp;#039;&amp;#039;&amp;#039; press the &amp;#039;&amp;#039;&amp;#039;Load&amp;#039;&amp;#039;&amp;#039; button to enforce the IDE to load COM information from the type library registered with this &amp;#039;&amp;#039;&amp;#039;TypeLib ID&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
*:In the system registry database you can find all registered &amp;#039;&amp;#039;&amp;#039;TypeLib ID&amp;#039;&amp;#039;&amp;#039;s under:&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;&amp;lt;vipbnf&amp;gt;HKEY_CLASSES_ROOT\TypeLib = {TypeLib ID}&amp;lt;/vipbnf&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:When this option is checked ON, then in the edit control you should specify the &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; of the COM component that you wish to import. The &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; should be specified as a string of hexadecimal numbers with the following format:&lt;br /&gt;
*:&amp;lt;vipbnf&amp;gt;{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*:Then you &amp;#039;&amp;#039;&amp;#039;MUST&amp;#039;&amp;#039;&amp;#039; press the &amp;#039;&amp;#039;&amp;#039;Load&amp;#039;&amp;#039;&amp;#039; button to enforce the IDE to load COM information from the COM module that embeds the COM component with the specified &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
*:&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;&amp;#039;Note.&amp;#039;&amp;#039;&amp;#039; Really a COM module can embed several COM components. If you wish to import one of these COM components, then you can specify a CLSID registered to any COM component in this COM module. (Later you will be able to specify the required COM component (or interface) in the list box in the  &amp;#039;&amp;#039;&amp;#039;Import&amp;#039;&amp;#039;&amp;#039; group box.)&lt;br /&gt;
*:&amp;lt;br /&amp;gt;In MSDN terminology, &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; is a class identifier. In the Visual Prolog PFC terminology (see the COM package description in the PFC) &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; is a COM component identifier.&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; is a universally unique identifier (UUID) that identifies the type of a COM component. Each COM component has its &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; in the Windows system registry database so that it can be loaded and used by other applications. For example, a spreadsheet can create worksheet components, chart components, and macrosheet components. Each of these components has its own &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; that uniquely identifies this component to the system. That is, if your COM module (COM server or COM container) allows linking to its embedded components, then you need to register the special &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; for each COM component embedded into the COM module.&lt;br /&gt;
*:The &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; is stored in the Windows registry database under the following registry key:&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;&amp;lt;vipbnf&amp;gt;HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID = {CLSID}&amp;lt;/vipbnf&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:The &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; is a 128-bit number (in the hexadecimal format) within a pair of curly braces. Typically, &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039;s (and other UUID values) are represented as strings of hexadecimal numbers with the following format:&lt;br /&gt;
*:&amp;lt;vipbnf&amp;gt;{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*:For example,&lt;br /&gt;
*:&amp;lt;vipbnf&amp;gt;{4208fb66-e22a-11d1-a7d7-00a0c982c00d}&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*:You can use the &amp;#039;&amp;#039;&amp;#039;UUIDGEN.exe&amp;#039;&amp;#039;&amp;#039; tool to create a new UUID.&lt;br /&gt;
*:When you find a &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039; you can find the associated &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039; under the following registry sub-key:&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;&amp;lt;vipbnf&amp;gt;HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{CLSID}\ProgID = &amp;lt;programatic identifier&amp;gt;&amp;lt;/vipbnf&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:See the &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039; options description below.&lt;br /&gt;
*:&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;&amp;#039;Universally unique identifier (UUID)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;lt;br /&amp;gt;The universally unique identifier (UUID) is also known as the globally unique identifier (GUID). The UUID, or GUID, is a unique, 128-bit value used to identify objects. Objects can be OLE servers, interfaces, client objects, etc. Beginning from this moment objects will be identified with UUIDs.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:When this option is checked ON. In the edit control you should specify the &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039; of the COM module from which you wish to import the COM component. The &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039; should be specified as a string of the following format:&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;&amp;lt;Program&amp;gt;.&amp;lt;Component&amp;gt;.&amp;lt;Version&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:&amp;lt;br /&amp;gt;Words are separated by dots as in &amp;lt;vp&amp;gt;Word.Document.6&amp;lt;/vp&amp;gt;. (Blank spaces cannot be used.)&lt;br /&gt;
*:Then you &amp;#039;&amp;#039;&amp;#039;MUST&amp;#039;&amp;#039;&amp;#039; press the &amp;#039;&amp;#039;&amp;#039;Load&amp;#039;&amp;#039;&amp;#039; button to enforce the IDE to load COM information from the COM module registered with this &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039;s are versioned programmatic identifiers. &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039;s present human-readable versions of class identifiers (&amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039;) used to identify COM components. &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039; is a registry entry that can be associated with &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039;. Like &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039; identifies a COM component but with less precision because it is not guaranteed to be globally unique. The &amp;#039;&amp;#039;&amp;lt;vp&amp;gt;Version&amp;lt;/vp&amp;gt;&amp;#039;&amp;#039; portion is optional but strongly recommended. Using &amp;#039;&amp;#039;&amp;lt;vp&amp;gt;Version&amp;lt;/vp&amp;gt;&amp;#039;&amp;#039;, even if there is only one version of the &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039;, helps to avoid conflicts. It enables different versions of a component coexist without overwriting &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039;s. If you do not specify a version for a &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039;, the default &amp;#039;&amp;#039;&amp;lt;vp&amp;gt;Version&amp;lt;/vp&amp;gt;&amp;#039;&amp;#039; &amp;lt;vp&amp;gt;= 1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
*:How to find &amp;#039;&amp;#039;&amp;#039;PROGID&amp;#039;&amp;#039;&amp;#039; entries in the registry is described in the &amp;#039;&amp;#039;&amp;#039;CLSID&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;IID&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:When this option is checked ON, then in the edit control you should specify the &amp;#039;&amp;#039;&amp;#039;IID&amp;#039;&amp;#039;&amp;#039; of the COM component interface that you wish to import.&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;IID&amp;#039;&amp;#039;&amp;#039; is a universally unique identifier (UUID) that uniquely identifies a particular COM interface. &amp;#039;&amp;#039;&amp;#039;IID&amp;#039;&amp;#039;&amp;#039; should be specified as a string of hexadecimal numbers with the following format:&lt;br /&gt;
*:&amp;lt;vipbnf&amp;gt;{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}&amp;lt;/vipbnf&amp;gt;&lt;br /&gt;
*:Then you &amp;#039;&amp;#039;&amp;#039;MUST&amp;#039;&amp;#039;&amp;#039; press the &amp;#039;&amp;#039;&amp;#039;Load&amp;#039;&amp;#039;&amp;#039; button to enforce the IDE to load COM information from the COM module that embeds the interface with the specified &amp;#039;&amp;#039;&amp;#039;IID&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
*:Really you can specify an &amp;#039;&amp;#039;&amp;#039;IID&amp;#039;&amp;#039;&amp;#039; registered to any interface embedded into the same COM module that embeds the interface you wish to import. (Later you will be able to specify the required COM component (or interface) in the list box.&lt;br /&gt;
*:In the system registry database you can find all registered &amp;#039;&amp;#039;&amp;#039;IID&amp;#039;&amp;#039;&amp;#039;s under:&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;#039;&amp;lt;vipbnf&amp;gt;HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface&amp;lt;/vipbnf&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Ide/Key_Bindings&amp;diff=3600</id>
		<title>Ide/Key Bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Ide/Key_Bindings&amp;diff=3600"/>
		<updated>2013-05-07T07:51:34Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: fix Ctrl+K, need F6...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{ideNavbar|Key Bindings}}&lt;br /&gt;
&lt;br /&gt;
A number of Visual Prolog menu entries have accelerator keys (hot keys) associated with them.&lt;br /&gt;
&lt;br /&gt;
Beginning with Visual Prolog 7.0 some key binding have been changed to comply with Microsoft de facto standards. &lt;br /&gt;
The table below shows Visual Prolog 7.2 accelerator keys by functions.&lt;br /&gt;
&lt;br /&gt;
:{| {{prettytable}}&lt;br /&gt;
|- class=&amp;quot;header2&amp;quot;&lt;br /&gt;
|align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Function&lt;br /&gt;
|align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Key&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Edit&lt;br /&gt;
|-&lt;br /&gt;
| Copy&lt;br /&gt;
| Ctrl-C&lt;br /&gt;
|-&lt;br /&gt;
| Cut&lt;br /&gt;
| Ctrl-X&lt;br /&gt;
|-&lt;br /&gt;
| Paste&lt;br /&gt;
| Ctrl-V&lt;br /&gt;
|-&lt;br /&gt;
| Paste&lt;br /&gt;
| Ctrl-Ins&lt;br /&gt;
|-&lt;br /&gt;
| Undo&lt;br /&gt;
| Ctrl-Z&lt;br /&gt;
|-&lt;br /&gt;
| Redo&lt;br /&gt;
| Ctrl-Y&lt;br /&gt;
|-&lt;br /&gt;
| Redo&lt;br /&gt;
| Ctrl-Shift-Z&lt;br /&gt;
|-&lt;br /&gt;
| Select All&lt;br /&gt;
| Ctrl-A&lt;br /&gt;
|-&lt;br /&gt;
| Select Current Word&lt;br /&gt;
| Ctrl-W&lt;br /&gt;
|-&lt;br /&gt;
| Box Editor: Size To Content&lt;br /&gt;
| Shift-F6&lt;br /&gt;
|-&lt;br /&gt;
| Code Expert&lt;br /&gt;
| Ctrl+Shift+W&lt;br /&gt;
|-&lt;br /&gt;
| Delete Line&lt;br /&gt;
| Ctrl-Shift-L&lt;br /&gt;
|-&lt;br /&gt;
| Delete to End of Line&lt;br /&gt;
| Ctrl-Shift-E&lt;br /&gt;
|-&lt;br /&gt;
| Word Delete To End&lt;br /&gt;
Delete Object from Facts Tree&lt;br /&gt;
Retract Fact(s)&lt;br /&gt;
| Ctrl-Del&lt;br /&gt;
|-&lt;br /&gt;
| Insert Predicate&lt;br /&gt;
| Ctrl-Shift-I&lt;br /&gt;
|-&lt;br /&gt;
| Replace&lt;br /&gt;
| Ctrl-H&lt;br /&gt;
|-&lt;br /&gt;
| Lower Case&lt;br /&gt;
| Ctrl-U&lt;br /&gt;
|-&lt;br /&gt;
| Upper Case&lt;br /&gt;
| Ctrl-Shift-U&lt;br /&gt;
|-&lt;br /&gt;
| Toggle Case&lt;br /&gt;
| Ctrl-Alt-U&lt;br /&gt;
|-&lt;br /&gt;
| Zoom In&lt;br /&gt;
| Ctrl-[+] or Ctrl-Scroll mouse wheel up&lt;br /&gt;
|-&lt;br /&gt;
| Zoom Out&lt;br /&gt;
| Ctrl-[-] or Ctrl-Scroll mouse wheel down&lt;br /&gt;
|-&lt;br /&gt;
| Zoom to Normal&lt;br /&gt;
| Ctrl-0&lt;br /&gt;
|-&lt;br /&gt;
| Comment Line(s)&lt;br /&gt;
| Ctrl-Alt-5&lt;br /&gt;
|-&lt;br /&gt;
| Uncomment Line(s)&lt;br /&gt;
| Ctrl-Alt-Shift-5&lt;br /&gt;
|-&lt;br /&gt;
| Insert Date Stamp&lt;br /&gt;
| Ctrl-Shift-Y&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Navigation&lt;br /&gt;
|-&lt;br /&gt;
| Find&lt;br /&gt;
| Ctrl-F&lt;br /&gt;
|-&lt;br /&gt;
| Find in Files&lt;br /&gt;
| Ctrl-Shift-F&lt;br /&gt;
|-&lt;br /&gt;
| Find Next&lt;br /&gt;
| F3&lt;br /&gt;
|-&lt;br /&gt;
| Locate in Project Tree&lt;br /&gt;
| Ctrl-T&lt;br /&gt;
|-&lt;br /&gt;
| View Current Position&lt;br /&gt;
| Shift-F4&lt;br /&gt;
|-&lt;br /&gt;
| Go Back&lt;br /&gt;
| Ctrl+Shift+F8&lt;br /&gt;
|-&lt;br /&gt;
| Go to Address&lt;br /&gt;
| Ctrl-G&lt;br /&gt;
|-&lt;br /&gt;
| Go to Definition&lt;br /&gt;
| F12&lt;br /&gt;
Ctrl-Shift-C&lt;br /&gt;
|-&lt;br /&gt;
| Go To Declaration&lt;br /&gt;
| Ctrl-F12&lt;br /&gt;
Ctrl-Shift-D&lt;br /&gt;
|-&lt;br /&gt;
| Go To Definition&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Go to Executing Predicate Source&lt;br /&gt;
| Ctrl-E&lt;br /&gt;
|-&lt;br /&gt;
| Go To Facts Database&lt;br /&gt;
| Ctrl+Alt+F&lt;br /&gt;
|-&lt;br /&gt;
| Go To Line&lt;br /&gt;
| Ctrl-F2&lt;br /&gt;
|-&lt;br /&gt;
| Go To Next Error&lt;br /&gt;
| F8&lt;br /&gt;
|-&lt;br /&gt;
| Go To Position on Clipboard&lt;br /&gt;
| Shift-F2&lt;br /&gt;
|-&lt;br /&gt;
| Go To Previous Error&lt;br /&gt;
| Shift-F8&lt;br /&gt;
|-&lt;br /&gt;
| Window Navigation Dialog&lt;br /&gt;
| Ctrl-Tab or Ctrl-F6&lt;br /&gt;
|-&lt;br /&gt;
| Set/Remove bookmark&lt;br /&gt;
| Ctrl-K&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Compile&lt;br /&gt;
|-&lt;br /&gt;
| Build&lt;br /&gt;
| Ctrl-Shift-B&lt;br /&gt;
|-&lt;br /&gt;
| Stop Build&lt;br /&gt;
| Ctrl-Break&lt;br /&gt;
|-&lt;br /&gt;
| Build Resource Only&lt;br /&gt;
| Alt-F8&lt;br /&gt;
|-&lt;br /&gt;
| Compile&lt;br /&gt;
| Ctrl-F7&lt;br /&gt;
|-&lt;br /&gt;
| Rebuild Project&lt;br /&gt;
| Ctrl-Shift-Alt-B&lt;br /&gt;
|-&lt;br /&gt;
| Run&lt;br /&gt;
| Ctrl-F5&lt;br /&gt;
|-&lt;br /&gt;
| Run in Window&lt;br /&gt;
| Alt-F5&lt;br /&gt;
|-&lt;br /&gt;
| Locate in Project Tree&lt;br /&gt;
| Ctrl-T&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Debug&lt;br /&gt;
|-&lt;br /&gt;
| Start Debugging &lt;br /&gt;
| F5&lt;br /&gt;
|-&lt;br /&gt;
| Stop Debugging&lt;br /&gt;
| Shift-F5&lt;br /&gt;
|-&lt;br /&gt;
| Breakpoint Properties&lt;br /&gt;
| Alt-F9&lt;br /&gt;
|-&lt;br /&gt;
| Refresh Debug Window&lt;br /&gt;
| Ctrl-R&lt;br /&gt;
|-&lt;br /&gt;
| Registers window&lt;br /&gt;
| Ctrl-Alt-G&lt;br /&gt;
|-&lt;br /&gt;
| Breakpoints Window&lt;br /&gt;
| Ctrl-Alt-B&lt;br /&gt;
|-&lt;br /&gt;
| CallStack Window&lt;br /&gt;
| Ctrl-Alt-C&lt;br /&gt;
|-&lt;br /&gt;
| Disassembly Window&lt;br /&gt;
| Ctrl-Alt-D&lt;br /&gt;
|-&lt;br /&gt;
| Variable window&lt;br /&gt;
| Ctrl-Alt-V&lt;br /&gt;
|-&lt;br /&gt;
| Memory Dump 1 Window&lt;br /&gt;
| Ctrl-Alt-M&lt;br /&gt;
|-&lt;br /&gt;
| Threads Window&lt;br /&gt;
| Ctrl-Alt-H&lt;br /&gt;
|-&lt;br /&gt;
| Enable Breakpoint&lt;br /&gt;
| Ctrl-F9&lt;br /&gt;
|-&lt;br /&gt;
| Toggle Breakpoint&lt;br /&gt;
| F9&lt;br /&gt;
|-&lt;br /&gt;
| Step Into&lt;br /&gt;
| F11&lt;br /&gt;
|-&lt;br /&gt;
| Step out of&lt;br /&gt;
| Shift-F11&lt;br /&gt;
|-&lt;br /&gt;
| Step Over&lt;br /&gt;
| F10&lt;br /&gt;
|-&lt;br /&gt;
| Run To Cursor&lt;br /&gt;
| Ctrl-F10&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Project&lt;br /&gt;
|-&lt;br /&gt;
| New Project&lt;br /&gt;
| Ctrl-Shift-N&lt;br /&gt;
|-&lt;br /&gt;
| Open Project&lt;br /&gt;
| Ctrl-Shift-O&lt;br /&gt;
|-&lt;br /&gt;
| Add Module to Project&lt;br /&gt;
| Ctrl-Shift-A&lt;br /&gt;
|-&lt;br /&gt;
| Create Project Item&lt;br /&gt;
| Ctrl-N&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
IDE&lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp;quot;Qualification…&amp;amp;quot; Dialog&lt;br /&gt;
| Ctrl-Shift-S&lt;br /&gt;
|-&lt;br /&gt;
| Close all Editors&lt;br /&gt;
| Ctrl+Q&lt;br /&gt;
|-&lt;br /&gt;
| Close all Inactive Editors&lt;br /&gt;
| Ctrl+Shift+Q&lt;br /&gt;
|-&lt;br /&gt;
| Close the active window&lt;br /&gt;
| Ctrl-F4&lt;br /&gt;
|-&lt;br /&gt;
| Project window&lt;br /&gt;
| Ctrl-Alt-P&lt;br /&gt;
|-&lt;br /&gt;
| Project Settings&lt;br /&gt;
| Alt-F7&lt;br /&gt;
|-&lt;br /&gt;
| Save File&lt;br /&gt;
| F2&lt;br /&gt;
|-&lt;br /&gt;
| Save Project&lt;br /&gt;
| Ctrl-S&lt;br /&gt;
|-&lt;br /&gt;
| Source Browser&lt;br /&gt;
| Ctrl-B&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Other&lt;br /&gt;
|-&lt;br /&gt;
| Help&lt;br /&gt;
| F1&lt;br /&gt;
|-&lt;br /&gt;
| Output&lt;br /&gt;
| Ctrl-Alt-O&lt;br /&gt;
|-&lt;br /&gt;
| Print&lt;br /&gt;
| Ctrl-P&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ru:IDE:Горячие Клавиши]]&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Predicates&amp;diff=3582</id>
		<title>Language Reference/Built-in entities/Predicates</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Predicates&amp;diff=3582"/>
		<updated>2013-04-29T07:31:22Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: add link to Language_Reference/Terms#List_Comprehension&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;__NOTOC__&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
|[[#assert|assert/1]]&lt;br /&gt;
|Insert the specified fact at the end of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#asserta|asserta/1]]&lt;br /&gt;
|Insert a fact at the beginning of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#assertz|assertz/1]]&lt;br /&gt;
|Insert a fact at the end of the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#bound|bound/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Test whether the specified variable is bound to a value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#class_name|class_name/0-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;ClassName&amp;#039;&amp;#039; that represents the name of the current interface or class.&lt;br /&gt;
|-&lt;br /&gt;
|[[#compare|compare/2-&amp;gt;]]&lt;br /&gt;
|Returns the result of the variables&amp;#039; comparison.&lt;br /&gt;
|-&lt;br /&gt;
|[[#convert|convert/2-&amp;gt;]]&lt;br /&gt;
|Checked term conversion.&lt;br /&gt;
|-&lt;br /&gt;
|[[#digitsOf|digitsOf/1-&amp;gt;]]&lt;br /&gt;
|Returns precision of the specified floating-point domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#errorExit|errorExit/1]] &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Performs a run-time error with the specified return code &amp;#039;&amp;#039;ErrorNumber&amp;#039;&amp;#039; and sets the internal error information.&lt;br /&gt;
|-&lt;br /&gt;
|[[#fail|fail/0]] &amp;lt;vp&amp;gt;failure&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Invoke backtracking.&lt;br /&gt;
|-&lt;br /&gt;
|[[#free|free/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Check whether a variable is free.&lt;br /&gt;
|-&lt;br /&gt;
|[[#fromEllipsis|fromEllipsis/1-&amp;gt;]]&lt;br /&gt;
|Creates the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; from the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#hasDomain|hasDomain/2]]&lt;br /&gt;
|Checks whether the variable &amp;#039;&amp;#039;VariableName&amp;#039;&amp;#039; has the domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#isErroneous|isErroneous/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Returns the lower bound value of the specified numeric domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#lowerBound|lowerBound/1-&amp;gt;]]&lt;br /&gt;
|Returns the lower bound value of the specified numeric domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#maxDigits|maxDigits/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the value of digits (precision) of the basic domain corresponding to the specified floating-point domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#not|not/1]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Negate the result (success/fail) of subgoal.&lt;br /&gt;
|-&lt;br /&gt;
|[[#predicate_fullname|predicate_fullname/1-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;PredicateFullName&amp;#039;&amp;#039; that represent the name of the predicate in which clause body &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; is called. The returned predicate name is qualified with a scope name.&lt;br /&gt;
|-&lt;br /&gt;
|[[#predicate_name|predicate_name/1-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the string &amp;#039;&amp;#039;PredicateName&amp;#039;&amp;#039; that represent the name of the predicate in which clause body &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; is called. The returned predicate name is not qualified with a scope name.&lt;br /&gt;
|-&lt;br /&gt;
|[[#programPoint|programPoint/0-&amp;gt;]]&lt;br /&gt;
|This compile time predicate returns the &amp;lt;vp&amp;gt;programPoint&amp;lt;/vp&amp;gt; corresponding to the place where it is called.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retract|retract/1]] &amp;lt;vp&amp;gt;nondeterm&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Remove a matched fact from the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retractall|retractall/1]]&lt;br /&gt;
|Remove all matching facts from the matched internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#retractFactDb|retractFactDb/1]]&lt;br /&gt;
|Remove all facts from the specified named internal facts database.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeBitsOf|sizeBitsOf/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bits occupied in memory by an entity of the specified domain &amp;#039;&amp;#039;DomainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeOf|sizeOf/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bytes occupied in memory by the specified term.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sizeOfDomain|sizeOfDomain/1-&amp;gt;]]&lt;br /&gt;
|Retrieves the number of bytes occupied in memory by the entity of the specified domain &amp;#039;&amp;#039;DomainName&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_lineno|sourcefile_lineno/0-&amp;gt;]]&lt;br /&gt;
|Returns the current line number in the source file processed by the compiler .&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_name|sourcefile_name/0-&amp;gt;]]&lt;br /&gt;
|Returns the name of the source file processed by the compiler.&lt;br /&gt;
|-&lt;br /&gt;
|[[#sourcefile_timestamp|sourcefile_timestamp/0-&amp;gt;]]&lt;br /&gt;
|Returns the string representing the date and time of the source file processed by the compiler.&lt;br /&gt;
|-&lt;br /&gt;
|[[#succeed|succeed/0]]&lt;br /&gt;
|The predicate &amp;lt;vp&amp;gt;succeed/0&amp;lt;/vp&amp;gt; will always succeed.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toAny|toAny/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; to the value of the universal term type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toBinary|toBinary/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified Term to the binary representation.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toBoolean|toBoolean/1-&amp;gt;]]&lt;br /&gt;
|The purpose of this meta-predicate is to convert the deterministic call (to a predicate or fact) to the procedure that returns the value of &amp;lt;vp&amp;gt;boolean&amp;lt;/vp&amp;gt; domain.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toEllipsis|toEllipsis/1-&amp;gt;]]&lt;br /&gt;
|Creates the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; from the list of &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; type values.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toString|toString/1-&amp;gt;]]&lt;br /&gt;
|Converts the specified &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; to the string representation.&lt;br /&gt;
|-&lt;br /&gt;
|[[#toTerm|toTerm/1-&amp;gt;]] &amp;lt;br&amp;gt; [[#toTerm|toTerm/2-&amp;gt;]]&lt;br /&gt;
|Converts the string/binary representation of the specified term &amp;#039;&amp;#039;SrcTerm&amp;#039;&amp;#039; into representation corresponding to the domain of &amp;#039;&amp;#039;PrologTerm&amp;#039;&amp;#039; variable of the return value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#tryToTerm|tryToTerm/1-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt; &amp;lt;br&amp;gt; [[#tryToTerm|tryToTerm/2-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Converts the string/binary representation of the specified term &amp;#039;&amp;#039;SrcTerm&amp;#039;&amp;#039; into representation corresponding to the domain of &amp;#039;&amp;#039;PrologTerm&amp;#039;&amp;#039; variable of the return value.&lt;br /&gt;
|-&lt;br /&gt;
|[[#tryConvert|tryConvert/2-&amp;gt;]] &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
|Checks whether the input term &amp;#039;&amp;#039;InputTerm&amp;#039;&amp;#039; can be strictly converted into the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; and returns the converted term &amp;#039;&amp;#039;ReturnTerm&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
|[[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]]&lt;br /&gt;
|Unchecked conversion of domains.&lt;br /&gt;
|-&lt;br /&gt;
|[[#upperBound|upperBound/1-&amp;gt;]]&lt;br /&gt;
|Returns the upper bound value of the specified numeric domain.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following predicates are deprecated:&lt;br /&gt;
{|{{prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
| finally/2&lt;br /&gt;
| Use &amp;lt;vp&amp;gt;try ... finally ... end try&amp;lt;/vp&amp;gt; instead.&lt;br /&gt;
|-&lt;br /&gt;
| findall/3&lt;br /&gt;
| Use list comprehension [[Language_Reference/Terms#List_Comprehension| &amp;lt;vp&amp;gt;[ ... || ...  ]&amp;lt;/vp&amp;gt;]] instead&lt;br /&gt;
|-&lt;br /&gt;
| trap/3 &amp;lt;vp&amp;gt;determ&amp;lt;/vp&amp;gt;&lt;br /&gt;
| Use &amp;lt;vp&amp;gt;try ... catch V do ... end try&amp;lt;/vp&amp;gt; instead&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== assert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;assert : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert the specified fact at the end of the matched internal facts database&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;assert(Fact)&amp;lt;/vp&amp;gt; inserts &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; in the matched internal facts database after any other stored facts for the corresponding database predicate. &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; must be a term belonging to the domain of an internal facts database. &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; applied to a single fact changes the existing instance of a fact to the specified one. &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; has the same effect as [[#assertz|assertz/1]]. See also [[#asserta|asserta/1]]&lt;br /&gt;
&lt;br /&gt;
Notice that the combination of [[#retract|retract/1]] and &amp;lt;vp&amp;gt;assert/1&amp;lt;/vp&amp;gt; like the following can lead to endless loop:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;loop() :-&lt;br /&gt;
  retract(fct(X)),&lt;br /&gt;
     ...           % creating Y from X&lt;br /&gt;
     assert(fct(Y)),&lt;br /&gt;
  fail.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem is that the retract in first line will eventually retract the fact asserted in the last line, because that fact is inserted &amp;#039;&amp;#039;last&amp;#039;&amp;#039; in the fact chain.&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Attempt to a fact declared as determ, but the fact instance already exists.&lt;br /&gt;
&lt;br /&gt;
==== asserta ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;asserta : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert a fact at the beginning of the matched internal facts database.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;asserta(Fact)&amp;lt;/vp&amp;gt; predicate inserts a &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; in the matched internal facts database before any other stored facts for the corresponding predicate. The &amp;lt;vp&amp;gt;Fact&amp;lt;/vp&amp;gt; must be a term belonging to the domain of an internal facts database. The &amp;lt;vp&amp;gt;asserta/1&amp;lt;/vp&amp;gt; applied to a single fact changes the existing instance of a fact to the specified one. See also [[#assert|assert/1]] and [[#assertz|assertz/1]].&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Attempt to a fact declared as determ, but the fact instance already exists.&lt;br /&gt;
&lt;br /&gt;
==== assertz ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;assertz : (&amp;lt;fact-term&amp;gt; FactTerm).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;assertz&amp;lt;/vp&amp;gt; does exactly the same as the [[#assert|assert/1]] predicate.&lt;br /&gt;
&lt;br /&gt;
==== bound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;bound : (&amp;lt;variable&amp;gt; Variable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test whether the specified variable is bound to a value.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;bound(Variable)&amp;lt;/vp&amp;gt; succeeds if &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is bound and fails if it is free. The &amp;lt;vp&amp;gt;bound&amp;lt;/vp&amp;gt; predicate is used to control flow patterns and to check the binding of reference variables. The &amp;lt;vp&amp;gt;bound&amp;lt;/vp&amp;gt; predicate treats the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; as bound if any of it&amp;#039;s part is instantiated.&lt;br /&gt;
&lt;br /&gt;
See also [[#free|free/1]].&lt;br /&gt;
&lt;br /&gt;
==== class_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;class_Name : () -&amp;gt; string ClassName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compile time predicate returns the string &amp;lt;vp&amp;gt;ClassName&amp;lt;/vp&amp;gt; that represents the name of the current interface or class.&lt;br /&gt;
&lt;br /&gt;
==== compare ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;compare : (A Left, A Right) -&amp;gt; compareResult CompareResult.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comparison of two terms of the same domain, resturns the value of [[#compareResult|compareResult]] domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;CompareResult&amp;lt;/vp&amp;gt; = compare(&amp;quot;&amp;lt;vp&amp;gt;bar&amp;lt;/vp&amp;gt;&amp;quot;, &amp;quot;&amp;lt;vp&amp;gt;foo&amp;lt;/vp&amp;gt;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== convert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;convert : (&amp;lt;type&amp;gt; Type, Term) -&amp;gt; &amp;lt;type&amp;gt; Converted.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checked term conversion.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; = convert(returnDomain, &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;returnDomain&amp;lt;/vpbnf&amp;gt;: Specifies a domain to which function &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; converts &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be a name of built-in Visual Prolog domain, an interface domain, a name of such user defined domain that is synonym to one of built-in Visual Prolog domains, a numeric domain, binary and pointer domains. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the value that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; is an expression, then it will be evaluated before the conversion.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned parameter &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; type.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;convert&amp;lt;/vp&amp;gt; predicate performs a clean and genuine conversion of the given &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;, returning a new term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; of the specified new domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;. If &amp;lt;vp&amp;gt;convert&amp;lt;/vp&amp;gt; cannot perform the required conversion, it rises errors. The similar functionality is provided by the [[#tryConvert|tryConvert/2-&amp;gt;]] predicate, but &amp;lt;vp&amp;gt;tryConvert-&amp;gt;&amp;lt;/vp&amp;gt; fails and does not produce any runtime errors if it cannot perform the conversion.&lt;br /&gt;
&lt;br /&gt;
===== Allowed conversions =====&lt;br /&gt;
&lt;br /&gt;
* Between numerical domains.&lt;br /&gt;
* Between interface types.&lt;br /&gt;
* Between [[#string|string]] and [[#symbol|symbol]] domains.&lt;br /&gt;
* From [[#binary|binary]] to [[#pointer|pointer]].&lt;br /&gt;
* For synonyms of mentioned domains.&lt;br /&gt;
* Between [http://wiki.visual-prolog.com/index.php?title=How_To_Remove_Reference_Domains_from_a_Project reference] domains and corresponding non-reference domains.&lt;br /&gt;
&lt;br /&gt;
The contrast to these is [[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]] predicate, which performs an unchecked conversion between terms from any domains, which have the same bit-size.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; (or [[#tryConvert|tryConvert/2-&amp;gt;]]) predicate accomplishes a checked explicit conversion, when the source and target domains are statically known during the compilation. The result of an explicit conversion can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ok&amp;#039;&amp;#039;&amp;#039; the successful conversion to the target domain;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;run-time-check&amp;#039;&amp;#039;&amp;#039; the conversion to the target domain with generation of run-time checking for compatibility;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;error&amp;#039;&amp;#039;&amp;#039; the conversion is impossible, error output.&lt;br /&gt;
&lt;br /&gt;
===== Rules of Checked Explicit Conversions =====&lt;br /&gt;
&lt;br /&gt;
* Synonyms of domains are converted using the same rules that are applied to the domains themselves.&lt;br /&gt;
* Numerical domains can be converted to the numerical domains only.&lt;br /&gt;
* Integral constants are the representatives of the anonymous integral domain: &amp;lt;vp&amp;gt;[const .. const]&amp;lt;/vp&amp;gt;.&lt;br /&gt;
* Real constants are the representatives of the anonymous real domain: &amp;lt;vp&amp;gt;digits&amp;lt;/vp&amp;gt; &amp;lt;vp&amp;gt;dig [const .. const]&amp;lt;/vp&amp;gt;, where &amp;lt;vp&amp;gt;dig&amp;lt;/vp&amp;gt; is the number of the digits in mantissa without insignificant zeroes.&lt;br /&gt;
* A value of the symbol domain can be converted to the string domain and vice versa.&lt;br /&gt;
* A value of binary domain can be converted to the pointer domain.&lt;br /&gt;
* The domains that are implicitly introduced for interfaces can be converted only to the interface domains according to the rules specified below.&lt;br /&gt;
* All other domains cannot be converted.&lt;br /&gt;
&lt;br /&gt;
===== Conversions of Numerical Domains =====&lt;br /&gt;
&lt;br /&gt;
* The range is considered first during such conversion. If the ranges of source and target do not intersect, then an error is produced. If the ranges of source and target only partially intersect, then run-time checking is generated. Also, if one of domains is real and another is an integral one, then the integer range is converted to the real range before the comparison.&lt;br /&gt;
* When input term in real and output is integer, then &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; and [[#tryConvert|tryConvert/2-&amp;gt;]] predicates truncate the input value to the nearest integer value, which is nearer to zero.&lt;br /&gt;
&lt;br /&gt;
===== Conversions of Interface Types =====&lt;br /&gt;
&lt;br /&gt;
Predicate &amp;lt;vp&amp;gt;convert/2-&amp;gt;&amp;lt;/vp&amp;gt; allow to convert any object to any interface type. The actual correctness of such conversion is checked at runtime. When object is created, its type is internally stored, therefore when the object is passed as argument it still remember about its original type. This original type is used for checking allowed conversions. The example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface x&lt;br /&gt;
      supports a, b&lt;br /&gt;
end interface x&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If object is created by class, which implements &amp;lt;vp&amp;gt;x&amp;lt;/vp&amp;gt; interface, and then object is passed as parameter of type &amp;lt;vp&amp;gt;a&amp;lt;/vp&amp;gt; to some predicate, then it is allowed to convert the object to &amp;lt;vp&amp;gt;b&amp;lt;/vp&amp;gt; type.&lt;br /&gt;
&lt;br /&gt;
Exceptions:&lt;br /&gt;
&lt;br /&gt;
* Check range error.&lt;br /&gt;
* Unsupported interface type.&lt;br /&gt;
&lt;br /&gt;
==== digitsOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;digitsOf : (&amp;lt;real-domain&amp;gt; Domain) -&amp;gt; unsigned.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns precision of the specified floating-point domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Precision = digitsof(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input parameter &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; of this compiling-time predicate is a floating-point domain, it should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable). The predicate returns the number &amp;lt;vpbnf&amp;gt;&amp;lt;Precision&amp;gt;&amp;lt;/vpbnf&amp;gt; that was determined by the &amp;lt;vp&amp;gt;digits&amp;lt;/vp&amp;gt; attribute in the domain declaration.&lt;br /&gt;
&lt;br /&gt;
The compiler guarantees that values of the domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; will have at least &amp;lt;vpbnf&amp;gt;&amp;lt;Precision&amp;gt;&amp;lt;/vpbnf&amp;gt; number of significant decimal digits.&lt;br /&gt;
&lt;br /&gt;
==== errorExit ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;errorExit : (unsigned ErrorNumber) erroneous.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs a run-time error with the specified return code &amp;lt;vp&amp;gt;ErrorNumber&amp;lt;/vp&amp;gt;, which can be used in the [[#try-catch-finally|try-catch-finally]].&lt;br /&gt;
&lt;br /&gt;
==== fail ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;fail : () failure.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; predicate forces failure and, hence, always causes backtracking. A clause that fails (with &amp;lt;vp&amp;gt;fail&amp;lt;/vp&amp;gt; or for some other reason) cannot bind output arguments.&lt;br /&gt;
&lt;br /&gt;
==== free ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;free : (&amp;lt;variableName&amp;gt; Variable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check whether a variable is free.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;free(Variable)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;free&amp;lt;/vp&amp;gt; predicate succeeds if the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is free and fails if &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; is bound. The &amp;lt;vp&amp;gt;free&amp;lt;/vp&amp;gt; predicate treats the specified &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; as bound if any of it&amp;#039;s part are instantiated.&lt;br /&gt;
&lt;br /&gt;
See also [[#bound|bound/1]].&lt;br /&gt;
&lt;br /&gt;
==== fromEllipsis ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;fromEllipsis : (...) -&amp;gt; any* AnyTermList.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate creates the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt; from the &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039; (i.e. from the special varying parameters block).&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;AnyTermList = fromEllipsis(EllipsisBlock )&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#toEllipsis|toEllipsis/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== hasDomain ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;hasDomain : (&amp;lt;type&amp;gt; Type, &amp;lt;variable&amp;gt; Variable) procedure.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;hasDomain&amp;lt;/vp&amp;gt; is not really a predicate, but more a declaration: It states that the variable &amp;lt;vp&amp;gt;Variable&amp;lt;/vp&amp;gt; must have the type &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The variable can be free, bound or of some mixed flow. The binding of the variable is not changes in any way.&lt;br /&gt;
&lt;br /&gt;
==== lowerBound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;lowerBound : (&amp;lt;numeric-domain&amp;gt; NumericDomain) -&amp;gt; &amp;lt;numeric-domain&amp;gt; LowerBound.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the lower bound of the specified &amp;lt;vp&amp;gt;NumericDomain&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;LowerBoundValue = lowerBound(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;lowerBound&amp;lt;/vp&amp;gt; is a compiling-time predicate. The &amp;lt;vp&amp;gt;lowerBound&amp;lt;/vp&amp;gt; returns the lower bound value &amp;lt;vp&amp;gt;LowerBoundValue&amp;lt;/vp&amp;gt; of the specified numeric domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The return value &amp;lt;vp&amp;gt;LowerBoundValue&amp;lt;/vp&amp;gt; belongs to the same domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter should be the name of any numerical domain; this domain name should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable). See also [[#upperBound|upperBound/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
It will give a compile time error if the specified domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; is not numeric domain.&lt;br /&gt;
&lt;br /&gt;
==== isErroneous ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;isErroneous : (&amp;lt;fact-variable&amp;gt; FactVariable) determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate succeeds if the specified fact variable is &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;isErroneous(factVariableName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate succeeds if the specified fact variable &amp;lt;vp&amp;gt;factVariableName&amp;lt;/vp&amp;gt; has the &amp;lt;vp&amp;gt;erroneous&amp;lt;/vp&amp;gt; value, otherwise it fails.&lt;br /&gt;
&lt;br /&gt;
==== maxDigits ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;maxDigits : (&amp;lt;real-domain&amp;gt; RealDomain) -&amp;gt; unsigned MaxDigits&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the value of digits (precision) of the basic domain corresponding to the specified floating-point domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;MaxDigitsNumber = maxdigits(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The return maximal number of digits &amp;lt;vp&amp;gt;MaxDigitsNumber&amp;lt;/vp&amp;gt; for the &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter, which should be the name of a &amp;lt;vp&amp;gt;real&amp;lt;/vp&amp;gt; domain.&lt;br /&gt;
&lt;br /&gt;
==== not ====&lt;br /&gt;
&lt;br /&gt;
See [[Language_Reference/Terms#Not|term not]]&lt;br /&gt;
&lt;br /&gt;
==== predicate_fullname ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicate_fullname : () -&amp;gt; string PredicateFullName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;PredicateFullName&amp;lt;/vp&amp;gt; of the predicate in which it is invoked. The returned predicate name is qualified with a scope name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;predicate_fullname&amp;lt;/vp&amp;gt; can only be used inside a clause. Use of &amp;lt;vp&amp;gt;predicate_fullname&amp;lt;/vp&amp;gt; in other places causes a compile time error. See also [[#predicate_name|predicate_name]].&lt;br /&gt;
&lt;br /&gt;
==== predicate_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicate_name : () -&amp;gt; string PredicateName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;PredicateName&amp;lt;/vp&amp;gt; of the predicate in which it is invoked.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; can only be used inside a clause. Use of &amp;lt;vp&amp;gt;predicate_name&amp;lt;/vp&amp;gt; in other places causes a compile time error. See also [[#predicate_fullname|predicate_fullname]]&lt;br /&gt;
&lt;br /&gt;
==== programPoint ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;programPoint : () -&amp;gt; core::programPoint ProgramPoint.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate returns the name &amp;lt;vp&amp;gt;programPoint&amp;lt;/vp&amp;gt; corresponding to the place where it is invoked.&lt;br /&gt;
&lt;br /&gt;
==== retract ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract : (&amp;lt;fact-term&amp;gt; FactTerm) nondeterm anyflow.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Successively removes the first matching fact from the facts database.  Fails when no more facts match.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract(FactTemplate)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; should be a fact term. The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate deletes the first fact that matches the &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; in the appropriated facts database. During backtracking, the rest of the matching facts will be deleted.&lt;br /&gt;
&lt;br /&gt;
Notice that &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can have any level of instantiation. The &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; is matched with the facts in the facts database, which means that any free variables will be bound in the call to &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can contain any anonymous variables. That is, variables with names consisting from the single underscore &amp;lt;vp&amp;gt;_&amp;lt;/vp&amp;gt; or a variable with a name starting with an underscore &amp;lt;vp&amp;gt;_AnyValue&amp;lt;/vp&amp;gt; if the variable occurs only once in the clause. For example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retract(person(&amp;quot;Hans&amp;quot;, _Age)),&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will retract the first matched person fact that has &amp;quot;&amp;lt;vp&amp;gt;Hans&amp;lt;/vp&amp;gt;&amp;quot; as the first argument and anything as the second argument.&lt;br /&gt;
&lt;br /&gt;
When retracting a fact, which is declared to be determ, the call to &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; will be deterministic.&lt;br /&gt;
&lt;br /&gt;
See also [[#retractall|retractall/1]] and [[#retractFactDb|retractFactDb]].&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate cannot be applied to single facts or fact variables.&lt;br /&gt;
&lt;br /&gt;
Be careful calling &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; with free &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; variable if any single fact is declared in the project current scope. If you retract a single fact, then the run-time error is generated. The &amp;lt;vp&amp;gt;retract/1&amp;lt;/vp&amp;gt; predicate fails when there are no more matches.&lt;br /&gt;
&lt;br /&gt;
==== retractall ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractall : (&amp;lt;fact-term&amp;gt; FactTerm) .&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove all matching facts from the facts database.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractall(FactTemplate)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; should be a fact term.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt; retracts all facts which match the given &amp;#039;&amp;#039;FactTemplate&amp;#039;&amp;#039;. It always succeeds, even if no facts were retracted.&lt;br /&gt;
&lt;br /&gt;
Attempting to retract a &amp;lt;vp&amp;gt;single&amp;lt;/vp&amp;gt; fact will cause a compile time error.&lt;br /&gt;
&lt;br /&gt;
It is not possible to obtain any output values from &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt;. For this reason, the variables in the call must be bound or be a single underscores (anonymous). Notice that  &amp;lt;vp&amp;gt;FactTemplate&amp;lt;/vp&amp;gt; can have any level of instantiation, but free variables must be single underscores (&amp;quot;unconditionally anonymous&amp;quot;). In difference to [[#retract|retract/1]] &amp;quot;conditionally&amp;quot; anonymous variables with names starting from the underscore (like &amp;lt;vp&amp;gt;_AnyValue&amp;lt;/vp&amp;gt;) cannot be used in &amp;lt;vp&amp;gt;retractall/1&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
See also [[#retract|retract/1]] and [[#retractFactDb|retractFactDb/1]].&lt;br /&gt;
&lt;br /&gt;
==== retractFactDb ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractFactDb : (factDB FactDB).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove all facts from the named internal facts database &amp;lt;vp&amp;gt;FactDB&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;retractFactDb(FactDB)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;retractFactDb/1&amp;lt;/vp&amp;gt; removes all facts from the named facts database &amp;lt;vp&amp;gt;FactDB&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Notice, it is impossible to retract &amp;lt;vp&amp;gt;single&amp;lt;/vp&amp;gt; facts and fact variables, so the predicate leaves such ones as they are.&lt;br /&gt;
&lt;br /&gt;
See also [[#retractall|retractall/1]] and [[#retract|retract/1]].&lt;br /&gt;
&lt;br /&gt;
==== retractAll/2 ====&lt;br /&gt;
&lt;br /&gt;
Obsolete predicate! Use [[#retractFactDb|retractFactDb/1]] instead.&lt;br /&gt;
&lt;br /&gt;
==== sizeBitsOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeBitsOf : (&amp;lt;domain&amp;gt; DomainName) -&amp;gt; unsigned BitSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bits occupied in memory by an entity of the specified domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;BitSize = sizeBitsOf(DomainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compiling-time predicate receives the domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt; as input parameter and return the size of memory that is occupied by the entity of the given domain. The result is measured in bits. For the integer domains &amp;lt;vp&amp;gt;sizeBitsOf/1-&amp;gt;&amp;lt;/vp&amp;gt; predicate returns the value that was defined for the size-field in a domain&amp;#039;s declaration.&lt;br /&gt;
&lt;br /&gt;
The following is always true for the integral domains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOfDomain(domain)*8 - 7 &amp;lt;= sizeBitsOf(domain) &amp;lt;= sizeOfDomain(domain)*8&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#sizeOfDomain|sizeOfDomain]]/1-&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== sizeOf ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOf : (&amp;lt;term&amp;gt; Term) -&amp;gt; integer ByteSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bytes occupied in memory by the specified term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ByteSize = sizeOf(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;sizeOf/1-&amp;gt;&amp;lt;/vp&amp;gt; function receives a term as input parameter and returns value &amp;lt;vp&amp;gt;ByteSize&amp;lt;/vp&amp;gt; that specifies the number of bytes occupied in memory by this term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== sizeOfDomain ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sizeOfDomain : (&amp;lt;domain&amp;gt; Domain) -&amp;gt; integer ByteSize.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retrieves the number of bytes occupied in memory by the entity of the specified domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ByteSize = sizeOfDomain(DomainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compiling-time predicate receives the domain &amp;lt;vp&amp;gt;DomainName&amp;lt;/vp&amp;gt; as input parameter and return the size of memory that is occupied by the entity of the given domain. The result is measured in bytes. The returned value &amp;lt;vp&amp;gt;ByteSize&amp;lt;/vp&amp;gt; belongs to the integer domain. Compare with [[#sizeBitsOf|sizeBitsOf/1-&amp;gt;]], which returns size of a domain measured in bits.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_lineno ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_lineno : () -&amp;gt; unsigned LineNumber.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current line number in the source file processed by the compiler.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_name : () -&amp;gt; string FileName.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the name of the source file processed by the compiler.&lt;br /&gt;
&lt;br /&gt;
==== sourcefile_timestamp ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;sourcefile_timestamp : () -&amp;gt; string TimeStamp..&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a string that represents the date and time of the currently compiled source file in format &amp;lt;vp&amp;gt;YYYY-MM-DD&amp;lt;/vp&amp;gt; &amp;lt;vp&amp;gt;HH:MM:SS&amp;lt;/vp&amp;gt;. Where:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vp&amp;gt;YYYY&amp;lt;/vp&amp;gt; - Year.&lt;br /&gt;
* &amp;lt;vp&amp;gt;MM&amp;lt;/vp&amp;gt; - Month.&lt;br /&gt;
* &amp;lt;vp&amp;gt;DD&amp;lt;/vp&amp;gt; - Day.&lt;br /&gt;
* &amp;lt;vp&amp;gt;HH&amp;lt;/vp&amp;gt; - Hour.&lt;br /&gt;
* &amp;lt;vp&amp;gt;MM&amp;lt;/vp&amp;gt; - Minute.&lt;br /&gt;
* &amp;lt;vp&amp;gt;SS&amp;lt;/vp&amp;gt; - Second.&lt;br /&gt;
&lt;br /&gt;
==== succeed ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;succeed : ().&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The predicate &amp;lt;vp&amp;gt;succeed/0&amp;lt;/vp&amp;gt; will always succeed.&lt;br /&gt;
&lt;br /&gt;
==== toAny ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toAny : (Term) -&amp;gt; any UniversalTypeValue.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to the value of universal term type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;UniversalTypeValue = toAny(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== toBinary ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toBinary : (Term) -&amp;gt; binary Serialized.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to [[#binary|binary]] representation.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Serialized = toBinary(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a binary, it can safely be stored in a file or sent over a network to another program. Later the obtained binary value &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; can be converted back to a Visual Prolog term, using [[#toTerm|toTerm/1-&amp;gt;]] function (the domain for the reversed term should be adequate to &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) for the reverse conversion.&lt;br /&gt;
&lt;br /&gt;
==== toBoolean ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toBoolean : (&amp;lt;term&amp;gt; SubGoal) -&amp;gt; boolean Succeed.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of this meta-predicate is to convert the deterministic call (to a predicate or fact) to the procedure that returns the value of [[#boolean|boolean]] domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this meta-predicate is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;True_or_False = toBoolean(deterministic_call)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;toBoolean/1-&amp;gt;&amp;lt;/vp&amp;gt; meta-predicate returns [[#boolean|boolean]] value. The result is &amp;lt;vp&amp;gt;true&amp;lt;/vp&amp;gt; if &amp;#039;&amp;#039;deterministic_call&amp;#039;&amp;#039; succeeds. The result is &amp;lt;vp&amp;gt;false&amp;lt;/vp&amp;gt; if &amp;#039;&amp;#039;deterministic_call&amp;#039;&amp;#039; fails.&lt;br /&gt;
&lt;br /&gt;
==== toEllipsis ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toEllipsis : (any* AnyTermList) -&amp;gt; ....&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predicate creates &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039; (i.e. the special varying parameters block) from the list of terms of the universal type &amp;lt;vp&amp;gt;any&amp;lt;/vp&amp;gt;. Such &amp;#039;&amp;#039;EllipsisBlock&amp;#039;&amp;#039; can be later passed to a predicate which expects the varying number of arguments (i.e. is declared with the ellipsis (&amp;#039;&amp;#039;...&amp;#039;&amp;#039;)), like &amp;lt;vp&amp;gt;write/...&amp;lt;/vp&amp;gt;, at the position of the ellipsis (&amp;#039;&amp;#039;...&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;EllipsisBlock = toEllipsis(&amp;lt;any_term_list&amp;gt;), write(EllipsisBlock )&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[#fromEllipsis|fromEllipsis/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== toString ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toString : (Term) -&amp;gt; string Serialized.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the specified &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; to string representation.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Serialized = toString(Term)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a string, it can safely be stored in a file or sent over a network to another program. Later the obtained string value can be converted back to a Visual Prolog term, using [[#toTerm|toTerm/1-&amp;gt;]] function (the domain of the return value should be adequate to &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) for the reverse conversion.&lt;br /&gt;
&lt;br /&gt;
==== toTerm ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;toTerm : (string Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (binary Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (any Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, string Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, binary Serialized) -&amp;gt; Term.&lt;br /&gt;
toTerm : (&amp;lt;domain&amp;gt; Type, any Serialized) -&amp;gt; Term.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the string/binary/any representation of the specified term &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; into representation corresponding to the domain of &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; variable of the return value. The domain can be stated explicitly or it can be left to the compiler to determine a suitable domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;Term = toTerm(Serialized) % with implicit domain&lt;br /&gt;
Term = toTerm(domainName, Serialized) % with explicit domain, domainName&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the domain is not specified the compiler must be able to determine the domain for the returned value &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; at compile-time. Notice that binary version of &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicate performs almost byte to byte conversion and only checking general compatibility of &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; data with the domain required to the return value &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;. The programmer is wholly responsible for providing binary data of &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; that can be correctly converted to the term of the desired domain. The &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicates are counterparts to predicates [[#toBinary|toBinary/1-&amp;gt;]] and [[#toString|toString/1-&amp;gt;]]. When a &amp;#039;&amp;#039;Term&amp;#039;&amp;#039; (of some domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;) is converted into a binary or string representation &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; (by [[#toBinary|toBinary/1-&amp;gt;]] or [[#toString|toString/1-&amp;gt;]] or [[#toAny|toAny/1-&amp;gt;]] correspondingly), it can safely be stored in a file or sent over a network to another program. Later the corresponding &amp;lt;vp&amp;gt;toTerm/1&amp;lt;/vp&amp;gt;-&amp;gt; function can convert the obtained string/binary value &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; back to a Visual Prolog term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;. For correctness of the reverse conversion the domain of the clause variable &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt; should be adequate to the initial domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
See also [[#tryToTerm|tryToTerm]].&lt;br /&gt;
&lt;br /&gt;
It gives a compile time error if the compiler cannot determine the return domain.&lt;br /&gt;
&lt;br /&gt;
Exceptions&lt;br /&gt;
&lt;br /&gt;
* Run time errors are generated when the &amp;lt;vp&amp;gt;toTerm&amp;lt;/vp&amp;gt; predicate cannot convert the string or binary into a term of the specified domain.&lt;br /&gt;
&lt;br /&gt;
==== tryToTerm ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;tryToTerm : (string Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (binary Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (any Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, string Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, binary Serialized) -&amp;gt; Term.&lt;br /&gt;
tryToTerm : (&amp;lt;domain&amp;gt; Type, any Serialized) -&amp;gt; Term.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Converts the string/binary/any representation &amp;lt;vp&amp;gt;Serialized&amp;lt;/vp&amp;gt; into a term &amp;lt;vp&amp;gt;Term&amp;lt;/vp&amp;gt;  like [[#toTerm|toTerm]]. The only difference between the predicates is that &amp;lt;vp&amp;gt;tryToTerm&amp;lt;/vp&amp;gt; fails if it cannot convert the string or binary or any into a term of the specified domain whereas toTerm raises an exception.&lt;br /&gt;
&lt;br /&gt;
See also [[#toTerm|toTerm]].&lt;br /&gt;
&lt;br /&gt;
==== tryConvert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;tryConvert : (&amp;lt;type&amp;gt; Type, Value) -&amp;gt; &amp;lt;type&amp;gt; Converted determ.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the input term &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; can be strictly converted into the specified domain &amp;lt;vp&amp;gt;Type&amp;lt;/vp&amp;gt; and returns the converted term &amp;lt;vp&amp;gt;Converted&amp;lt;/vp&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ReturnTerm = tryConvert(returnDomain, InputTerm)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vp&amp;gt;returnDomain&amp;lt;/vp&amp;gt;: Specifies a domain to which &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate tries to convert the specified &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; can be any domain accessible in the current scope. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the term that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; is an expression, then it will be evaluated before conversion.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; domain.&lt;br /&gt;
&lt;br /&gt;
The conversion rules are the same as of the embedded predicate [[#convert|convert/2-&amp;gt;]], but &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; fails when [[#convert|convert/2-&amp;gt;]] generates conversion errors.&lt;br /&gt;
&lt;br /&gt;
This predicate succeeds if the corresponding conversion succeeds. Otherwise it fails. The &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate tries to perform a clean and genuine conversion of the given &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; into a value of the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;. The &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate will fail if the required conversion cannot be performed. When &amp;lt;vp&amp;gt;tryConvert/2-&amp;gt;&amp;lt;/vp&amp;gt; predicate succeeds, it returns the term &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; converted to the specified domain &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
For allowed conversions and rules of checked explicit conversions see [[#convert|convert/2-&amp;gt;]] predicate.&lt;br /&gt;
&lt;br /&gt;
See also [[#uncheckedConvert|uncheckedConvert/2-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
==== uncheckedConvert ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;uncheckedConvert : (&amp;lt;type&amp;gt; Type, Value) -&amp;gt; &amp;lt;type&amp;gt; Converted.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unchecked conversion of a value to another type.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;ReturnTerm = uncheckedConvert(returnDomain, InputTerm)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;vp&amp;gt;returnDomain&amp;lt;/vp&amp;gt;: Specifies a domain to which &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; predicate unsafely converts the specified &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. Here &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; can be any domain accessible in the current scope, the &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; should has the same bit-size as the &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;. The domain name &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; must be specified at compile-time, i.e. it cannot come from a variable.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;InputTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Specifies the value that must be converted. &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt; may be any Prolog term or an expression. If &amp;#039;&amp;#039;InputTerm&amp;#039;&amp;#039; is an expression, then it will be evaluated before conversion.&lt;br /&gt;
* &amp;lt;vpbnf&amp;gt;&amp;lt;ReturnTerm&amp;gt;&amp;lt;/vpbnf&amp;gt;: Returned parameter &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt; will be of &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; type.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; evaluates &amp;lt;vp&amp;gt;InputTerm&amp;lt;/vp&amp;gt;, change the type to &amp;#039;&amp;#039;returnDomain&amp;#039;&amp;#039; without any modification of the memory pattern and unifies with &amp;lt;vp&amp;gt;ReturnTerm&amp;lt;/vp&amp;gt;. The &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt; predicate performs no runtime checks. It makes only compile time checking of bit-size equality of the converted domains. So almost any term may be quite recklessly converted to any other term. So quite disastrous results may occur if you try to use variables incorrectly converted by &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;. Be extremely careful implementing &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;; we strongly recommend you always, when it is possible, using of [[#convert|convert/2-&amp;gt;]] and [[#tryConvert|tryConvert/2-&amp;gt;]]. But notice that, when an object is returned by COM system it is necessary to convert it by &amp;lt;vp&amp;gt;uncheckedConvert&amp;lt;/vp&amp;gt;, as Prolog program does not have information about its actual type.&lt;br /&gt;
&lt;br /&gt;
==== upperBound ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;upperBound : (&amp;lt;numeric-domain&amp;gt; NumericDomain) -&amp;gt; &amp;lt;number-domain&amp;gt; UpperBound.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the upper bound value of the specified numeric domain.&lt;br /&gt;
&lt;br /&gt;
Call-template for this function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;UpperBound = upperBound(domainName)&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;vp&amp;gt;upperBound&amp;lt;/vp&amp;gt; is a compiling-time predicate. The &amp;lt;vp&amp;gt;upperBound&amp;lt;/vp&amp;gt; returns the upper bound value of the specified numeric domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The return value &amp;lt;vp&amp;gt;UpperBound&amp;lt;/vp&amp;gt; belongs to the same domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039;. The &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; parameter should be the name of any numerical domain; this domain name should be explicitly specified at compile-time (that is, &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; cannot come from a variable).&lt;br /&gt;
&lt;br /&gt;
See also [[#lowerBound|lowerBound/1-&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
Will cause a compile time error if the specified domain &amp;#039;&amp;#039;domainName&amp;#039;&amp;#039; is not numeric domain.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{LanguageReferenceSubarticle|Built-in entities/Predicates}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Ide/IDE_Dialogs&amp;diff=3570</id>
		<title>Ide/IDE Dialogs</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Ide/IDE_Dialogs&amp;diff=3570"/>
		<updated>2013-04-26T08:26:27Z</updated>

		<summary type="html">&lt;p&gt;SergeMukhin: /* Window Navigation Dialog */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{ideNavbar|IDE Dialogs}}&lt;br /&gt;
&lt;br /&gt;
=== Warning: These files will be overwritten ===&lt;br /&gt;
&lt;br /&gt;
When you create a new project with the IDE {{ide|Project Settings#General Tab|Project Settings}} facility, you can specify the &amp;#039;&amp;#039;&amp;#039;Subdirectory&amp;#039;&amp;#039;&amp;#039; in which the project will be placed (notice that usually this name is generated automatically from the specified project name). Notice that each project contains several standard files (always automatically generated by the IDE) with standard names. Therefore, if the specified subdirectory name coincides with one in which a previously created project already exists, then these 2 projects should have several standard files with the same names. Because the old versions of these files can be incompatible with the new project, the {{ide|Project Settings#General Tab|Project Settings}} generates the warning dialog with the title:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;These files will be overwritten:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In the central pane of this dialog you see a list of files which should be overwritten.&lt;br /&gt;
&lt;br /&gt;
You can select the following actions:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Continue&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you select this button, then the old versions of files specified in the list will be overwritten with the new versions.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Cancel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you select this button, then no files will be overwritten, the IDE returns into the {{ide|Project Settings#General Tab|Project Settings}} dialog where you can the specify other name in the &amp;#039;&amp;#039;&amp;#039;Subdirectory&amp;#039;&amp;#039;&amp;#039; control.&lt;br /&gt;
&lt;br /&gt;
=== Resolve Ambiguity ===&lt;br /&gt;
&lt;br /&gt;
This dialog appears when you execute the:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Go to Declaration&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;Ctrl+Shift+D&amp;#039;&amp;#039;&amp;#039;),&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Go to Definition&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;Ctrl+Shift+C&amp;#039;&amp;#039;&amp;#039;), or&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Show Visual Prolog Help&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;F1&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
commands and the cursor points onto a &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;quot;, which has several versions of the &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;quot; references in the generated {{ide|Code Experts#Source Browser|browse information}} and cannot resolve this ambiguity using all additional information about the &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;quot;, which The IDE can gather in the edited file.&lt;br /&gt;
&lt;br /&gt;
Correspondently it have titles:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Resolve Ambiguity of &amp;quot;&amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;quot; Declaration&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Resolve Ambiguity of &amp;quot;&amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;quot; Definition&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Choose &amp;quot;&amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;quot; to Show Help Topic&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These dialogs display lists of references to the &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;quot; with additional information (gathered in the generated by the compiler {{ide|Code Experts#Source Browser|browse information}}, which helps you to resolve ambiguity of the &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Names are prefixed with the same {{ide|Project Tree#Icons Used in the Project Window|icons}}, which are used in the Project window.&lt;br /&gt;
&lt;br /&gt;
To continue an initiated command execution you need to select (click) one of displayed lines containing unique references to the &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Send Bug Report to Support ===&lt;br /&gt;
&lt;br /&gt;
Normally you should use &amp;#039;&amp;#039;&amp;#039;Help | Send Bug Report...&amp;#039;&amp;#039;&amp;#039; IDE command to send a bug report or feedback. You can also send a mail directly to the &amp;#039;&amp;#039;&amp;#039;Visual Prolog Support Service&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;About Visual Prolog Support Service&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Visual Prolog Support&amp;#039;&amp;#039;&amp;#039; is responsible for answering questions only about bugs and problems with using of Visual Prolog language, the IDE, and other tools and packages supplied in &amp;#039;&amp;#039;&amp;#039;Commercial&amp;#039;&amp;#039;&amp;#039; editions of Visual Prolog.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Guidelines for preparing Bug Reports to Visual Prolog Support&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;1. Please check the following information sources before submitting your E-mail:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* [http://www.visual-prolog.com/vip6/support/faq.htm Frequently Asked Questions]&lt;br /&gt;
* [http://kb.visual-prolog.com Visual Prolog Knowledge Base]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;2. Please do not ask Visual Prolog Support about general problems like: &amp;quot;Visual Prolog and Fuzzy Logic?&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
For things please use [http://discuss.visual-prolog.com/ Visual Prolog Discussion Forum], where you are free to discuss any question deals with Visual Prolog. Anybody can read the debate, but you need to register if you want to make postings.&lt;br /&gt;
&lt;br /&gt;
Prolog Development Center will follow and participate as much as possible in the debates. But we cannot make any &amp;quot;answer guarantee&amp;quot;; this is mainly your forum.&lt;br /&gt;
&lt;br /&gt;
This forum will receive all major announcements from Prolog Development Center.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;3. Your message MUST contain information generated by &amp;quot;Help | Send Bug Report | Show Details&amp;quot; IDE command.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This information contains some parameters about your computer and your project that are useful for correct understanding of the problem. It should be copied to the mail.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;4. How to write a message:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;To:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:The address of Visual Prolog International Support Group is: &amp;#039;&amp;#039;&amp;#039;support@visual-prolog.com&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Subject:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:Use a short, precise, and relevant Subject (title line). Please, do not use subjects like: &amp;#039;&amp;#039;&amp;#039;My 1st problem with Prolog&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Message Text:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*:One problem per message, please.&lt;br /&gt;
*:Here you should describe your problem as detailed and precise, as it is possible.&lt;br /&gt;
*:Please supply examples of code illustrating your problem.&lt;br /&gt;
*:The information supplied in your message should be sufficient to reproduce your problem on our computers.&lt;br /&gt;
&lt;br /&gt;
Please follow the above guidelines when you E-mail Bug Reports to Visual Prolog Support.&lt;br /&gt;
&lt;br /&gt;
Regards&lt;br /&gt;
&lt;br /&gt;
The Visual Prolog International Support Group&lt;br /&gt;
&lt;br /&gt;
support@visual-prolog.com&lt;br /&gt;
&lt;br /&gt;
=== Replace Text ===&lt;br /&gt;
&lt;br /&gt;
Using this dialog you can find and replace each or every occurrence of a text pattern (a string or a regular expression) in the edited file.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Text to Find&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:In the &amp;#039;&amp;#039;&amp;#039;Text to Find&amp;#039;&amp;#039;&amp;#039; box, type in the search string, or &amp;#039;&amp;#039;regular expression&amp;#039;&amp;#039;, or choose a previous string from the drop-down list.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;New Text&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Type the replacement string, or &amp;#039;&amp;#039;regular replacement expression&amp;#039;&amp;#039; in the &amp;#039;&amp;#039;&amp;#039;New Text&amp;#039;&amp;#039;&amp;#039; box, or choose a previous string from the drop-down list. Notice that &amp;#039;&amp;#039;regular replacement expressions&amp;#039;&amp;#039; have limited syntax regarding to &amp;#039;&amp;#039;regular expressions&amp;#039;&amp;#039; used in the  &amp;#039;&amp;#039;&amp;#039;Text to Find&amp;#039;&amp;#039;&amp;#039;  patterns.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Origin&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Options in the &amp;#039;&amp;#039;&amp;#039;Origin&amp;#039;&amp;#039;&amp;#039; group box defines the file scope in which the string should be searched.&lt;br /&gt;
:*&amp;#039;&amp;#039;&amp;#039;Entire Scope&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:*:Defines that the string should be searched in all file.&lt;br /&gt;
:*&amp;#039;&amp;#039;&amp;#039;From Cursor&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:*:Defines that the string should be searched beginning from the current cursor position.&lt;br /&gt;
:*&amp;#039;&amp;#039;&amp;#039;Selected Text&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:*:Defines that the string should be searched only in the selected piece of the edited text.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Direction&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Options in the &amp;#039;&amp;#039;&amp;#039;Direction&amp;#039;&amp;#039;&amp;#039; group box defines the direction in which the string should be searched.&lt;br /&gt;
:*&amp;#039;&amp;#039;&amp;#039;Forward&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:*:Search the document below the insertion point.&lt;br /&gt;
:*&amp;#039;&amp;#039;&amp;#039;Backward&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:*:Search the document above the insertion point.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Options&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:In this group box you defines the search options.&lt;br /&gt;
:*&amp;#039;&amp;#039;&amp;#039;Case Sensitive&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:*:Find strings having the given pattern of uppercase and lowercase letters.&lt;br /&gt;
:*&amp;#039;&amp;#039;&amp;#039;Whole Words Only&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:*:Find occurrences of the string as whole words. It only displays instances of the Find what string that are matched in complete words. For example, a search for &amp;quot;my::List&amp;quot; will return &amp;quot;my::List&amp;quot; but not &amp;quot;cmy::List&amp;quot; or &amp;quot;my::Listtt&amp;quot;.&lt;br /&gt;
:*&amp;#039;&amp;#039;&amp;#039;Use Regular Expressions&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:*:See [Find_Text_in_Files.htm #Regular_Expressions2 Regular Expressions] for details.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Replace&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Press the &amp;#039;&amp;#039;&amp;#039;Replace&amp;#039;&amp;#039;&amp;#039; button to replace the current selection or to invoke searching of the specified string (regular expression) with the specified options if there are no selection.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Find Next&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Press the &amp;#039;&amp;#039;&amp;#039;Find&amp;#039;&amp;#039;&amp;#039; button to invoke searching of the next occurrence of the specified string (regular expression) with the specified options.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Change All&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Press the &amp;#039;&amp;#039;&amp;#039;Change All&amp;#039;&amp;#039;&amp;#039; button to replace all occurrences of the search text, in the specified scope.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Close&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Close this dialog.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Help&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Displays this help topic.&lt;br /&gt;
&lt;br /&gt;
=== Find Text in Files ===&lt;br /&gt;
&lt;br /&gt;
Using this dialog you can find each occurrence of a combination of any characters, including uppercase and lowercase characters, whole words, or parts of words, or regular expressions in the specified group of files.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_FindInFiles.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Text to Find&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:In the &amp;#039;&amp;#039;&amp;#039;Text to Find&amp;#039;&amp;#039;&amp;#039; box, type in the search string, or &amp;#039;&amp;#039;regular expression&amp;#039;&amp;#039;, or choose a previous string from the drop-down list.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Find in All Opened Editors&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Check this option if you wish that the IDE search the specified string only in that text files, which are currently opened in the IDE text editors.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Find in Project Files Only&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Check this option if you wish that the IDE search the specified string only in text files, which are parts of the project currently loaded into the IDE.&lt;br /&gt;
:This button is disabled when the project is not loaded.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Show Search Results in New Window&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:If this option is checked ON, then the IDE will open new &amp;#039;&amp;#039;&amp;#039;Search results&amp;#039;&amp;#039;&amp;#039; window each time the search is completed, otherwise it will display search results in the same window.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;In Files:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:In this list editor you can specify (or select from the list of previously used) the file mask which will be used to restrict files in which the IDE will search for the string. For example, you can use &amp;lt;vp&amp;gt;*&amp;lt;/vp&amp;gt; operator to specify that any sub-string can be used instead of this operator.&lt;br /&gt;
:This option is disabled when the &amp;#039;&amp;#039;&amp;#039;Find in All Opened Editors&amp;#039;&amp;#039;&amp;#039; option is checked ON.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;In Folder:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:In this list editor you can specify (or select from the list of previously used) the folder, which will be used to restrict files in which the IDE will search for the string.&lt;br /&gt;
:This option is disabled when the &amp;#039;&amp;#039;&amp;#039;Find in All Opened Editors&amp;#039;&amp;#039;&amp;#039; option is checked ON.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Browse&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Press this button to open the &amp;#039;&amp;#039;&amp;#039;Set New Directory&amp;#039;&amp;#039;&amp;#039; dialog in which you can select the folder, which name will be inserted into the &amp;#039;&amp;#039;&amp;#039;In Folder&amp;#039;&amp;#039;&amp;#039; field.&lt;br /&gt;
:&amp;lt;br/&amp;gt;Notice that when &amp;#039;&amp;#039;&amp;#039;Find in Project Files Only&amp;#039;&amp;#039;&amp;#039; is checked ON, then this dialog will gives you access only to the folders known to the project.&lt;br /&gt;
:This button is disabled when the &amp;#039;&amp;#039;&amp;#039;Find in All Opened Editors&amp;#039;&amp;#039;&amp;#039; option is checked ON.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Search Subfolders&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:When this option is checked ON (the default), then the IDE will search in all subfolders of the folder specified in the &amp;#039;&amp;#039;&amp;#039;In Folder&amp;#039;&amp;#039;&amp;#039; field.&lt;br /&gt;
:Otherwise, search will be only in the files directly in the folder specified in the &amp;#039;&amp;#039;&amp;#039;In Folder&amp;#039;&amp;#039;&amp;#039; field.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Whole Words Only&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Find occurrences of the string as whole words. It only displays instances of the Find what string that are matched in complete words. For example, a search for &amp;quot;my::List&amp;quot; will return &amp;quot;my::List&amp;quot; but not &amp;quot;cmy::List&amp;quot; or &amp;quot;my::Listtt&amp;quot;.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Case Sensitive&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:The selected item specifies whether the search should match case of the whole search string (&amp;#039;&amp;#039;&amp;#039;Case Sensitive&amp;#039;&amp;#039;&amp;#039;), ignore the case (&amp;#039;&amp;#039;&amp;#039;Case Insensitive&amp;#039;&amp;#039;&amp;#039;) or match the case of the first character of the search string (&amp;#039;&amp;#039;&amp;#039;Prolog Sensitive&amp;#039;&amp;#039;&amp;#039;). The last option is unavailable, when &amp;#039;&amp;#039;&amp;#039;Regular Expressions&amp;#039;&amp;#039;&amp;#039; option is checked ON.&lt;br /&gt;
&lt;br /&gt;
==== Regular Expressions ====&lt;br /&gt;
&lt;br /&gt;
Provides possibility to perform advanced string searching operations (searching, matching and replacing) using regular expressions.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Regular Expressions &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:A &amp;#039;&amp;#039;regular expression&amp;#039;&amp;#039; (or pattern) is a text string that describes some (mathematical) group of strings. A string &amp;lt;vp&amp;gt;S&amp;lt;/vp&amp;gt; &amp;quot;matches&amp;quot; a regular expression &amp;lt;vp&amp;gt;R&amp;lt;/vp&amp;gt; if &amp;lt;vp&amp;gt;S&amp;lt;/vp&amp;gt; belongs to the set of strings described by &amp;lt;vp&amp;gt;R&amp;lt;/vp&amp;gt;. Using regular expression, you can:&lt;br /&gt;
:* check whether the specified string matches the specified pattern;&lt;br /&gt;
:* search within a string for a substring matching the specified pattern;&lt;br /&gt;
:* perform replacing within matched substrings.&lt;br /&gt;
:Some regular expressions can match only one substring. That is, a set of strings such regular expression describes has only one member. For example, the regular expression &amp;#039;&amp;#039;&amp;#039;foo&amp;#039;&amp;#039;&amp;#039; matches only the substring &amp;#039;&amp;#039;&amp;#039;foo&amp;#039;&amp;#039;&amp;#039; and no others. Other regular expressions can match more than one substring. That is, a set of strings such regular expression describes has more than one member. For example, the regular expression &amp;lt;vp&amp;gt;f*&amp;lt;/vp&amp;gt; matches the set of strings made up of any number (including zero) of &amp;#039;&amp;#039;&amp;#039;f&amp;#039;&amp;#039;&amp;#039; characters. Some characters in regular expressions match themselves (such as &amp;#039;&amp;#039;&amp;#039;f&amp;#039;&amp;#039;&amp;#039;) and some do not match to any concrete character (such as &amp;lt;vp&amp;gt;*&amp;lt;/vp&amp;gt;). Characters that do not match themselves are used to specify patterns, which describe sets of different strings.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Regular Expression Syntax&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
See the [pfc\regEx\packRegEx.htm regEx] package for more details of regular expression syntax.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Find&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Press the &amp;#039;&amp;#039;&amp;#039;Find&amp;#039;&amp;#039;&amp;#039; button to invoke searching of the specified string (regular expression) with the specified options.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Stop&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Press the &amp;#039;&amp;#039;&amp;#039;Stop&amp;#039;&amp;#039;&amp;#039; button to stop searching.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Help&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Displays this help topic.&lt;br /&gt;
&lt;br /&gt;
==== Search results ====&lt;br /&gt;
&lt;br /&gt;
[[Image:Ide_FindInFilesResults.png]]&lt;br /&gt;
&lt;br /&gt;
This window displays the table which contains the names of files in which the specified string is found, the line number and the position, where the specified text is located and the content of the whole line.&lt;br /&gt;
&lt;br /&gt;
If you double-click any filename, then this file will be opened in the text editor.&lt;br /&gt;
&lt;br /&gt;
=== Find Text ===&lt;br /&gt;
&lt;br /&gt;
Using this dialog you can find each occurrence of a combination of any characters, including uppercase and lowercase characters, whole words, or parts of words, or regular expressions.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Text to Find&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:In the &amp;#039;&amp;#039;&amp;#039;Text to Find&amp;#039;&amp;#039;&amp;#039; box, type in the search string, or regular expression, or choose a previous string from the drop-down list.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Origin&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Options in the &amp;#039;&amp;#039;&amp;#039;Origin&amp;#039;&amp;#039;&amp;#039; group box defines the file scope in which the string should be searched.&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;Entire Scope&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
::Defines that the string should be searched in all file.&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;From Cursor&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
::Defines that the string should be searched beginning from the current cursor position.&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;Selected Text&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
::Defines that the string should be searched only in the selected piece of the edited text.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Direction&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Options in the &amp;#039;&amp;#039;&amp;#039;Direction&amp;#039;&amp;#039;&amp;#039; group box defines the direction in which the string should be searched.&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;Forward&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
::Search the document below the insertion point.&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;Backward&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
::Search the document above the insertion point.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Options&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:In this group box you defines the search options.&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;Case Sensitive&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
::Find strings having the given pattern of uppercase and lowercase letters.&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;Whole Words Only&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
::Find occurrences of the string as whole words.&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;Use Regular Expressions&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
::See [Find_Text_in_Files.htm #Regular_Expressions2 Regular Expressions] for details.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Find&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Press the &amp;#039;&amp;#039;&amp;#039;Find&amp;#039;&amp;#039;&amp;#039; button to invoke searching of the specified string (regular expression) with the specified options.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Close&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Close this dialog.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Help&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Displays this help topic.&lt;br /&gt;
&lt;br /&gt;
=== Window Navigation Dialog ===&lt;br /&gt;
&lt;br /&gt;
The order, in which &amp;#039;&amp;#039;&amp;#039;Ctrl-TAB&amp;#039;&amp;#039;&amp;#039; shifts between IDE windows, has been changed to visit most-recently-visited windows first.&lt;br /&gt;
&lt;br /&gt;
Furthermore, &amp;#039;&amp;#039;&amp;#039;Ctrl-TAB&amp;#039;&amp;#039;&amp;#039; also brings up a navigation dialog listing all the open windows. The dialog stays up as long as Ctrl-key is pressed. In this dialog you can see the windows in the order they will be shifted to, but you can also choose a window directly using the mouse or the arrow keys. If you press letters the list will be filtered to windows starting with the letters you have pressed.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ctrl-F1&amp;#039;&amp;#039;&amp;#039; Help,&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ctrl-Del&amp;#039;&amp;#039;&amp;#039; will close the selected window,&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ctrl-BackSpace&amp;#039;&amp;#039;&amp;#039; removes the last letter,&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ctrl-Alt&amp;#039;&amp;#039;&amp;#039; switches on/off showing only read-write files.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ctrl-*&amp;#039;&amp;#039;&amp;#039; switches on/off alternate filter by letter.&lt;/div&gt;</summary>
		<author><name>SergeMukhin</name></author>
	</entry>
</feed>