

3valued logic for xps4xps 



In the real life the replies of an expert person to a question can not only be a definite "yes" or "no", but even "maybe yes" or "probably no". It might also happen that some information is not available or uncertain or unknown, as well the expert person might say "in lack of … I cannot decide" or "I am not sure" or even "I do not know". These replies can be used as input information when formulating another question to an expert person. Obviously, a "maybe yes" is not identical with "yes". One of the most critical points of an expert system is the type of the output it can provide and the type of the input it can receive. For operating the inference engine properly, one has to extend the generally used (two valued) Boolean logic to multiplevalued logic. The idea is not strange at all: see fuzzy logic and its applications. Obviously, it would be useless to extend the "yes/no world" with all the mentioned reply types; rather, introducing a third state ("unknown/not set/do not know") would suffice. Even this idea is not new. Also note that even the ANSI standard for SQL databasehandling language (ANSI SQL 89) applies a triplevalued logic. Introducing this extension enables the expert system to simulate an expert person who is able to deal with incomplete/not fully reliable input data and is able to give a reply other than a definite "yes" or "no". The new logic can be constructed as an extension to the Boolean logic: operators (defined by their "truth table", see the tables below) can be defined and implemented. As shown in tables with red background, the twovalued Boolean logic is included as a subset of the newly introduced threevalued logic: this subset of the truth tables is exactly equivalent with the truth tables for the 2valued logic. The "promotion" operation (mixing 3valued and 2valued logical variables) is also possible: operations between 2valued and 3valued Boolean values can be interpreted; their result is as shown in the tables.
