Limited Reasoner Demo: Textual User Interface

Quick start: have a look at the "Problem Description", hit the "Click me!" button, and check the output under "Reasoning Results".

For further demos and details on the reasoner, click here.

Problem Description

Load an example:
If you like, you can edit the text. For help on the syntax, see below.

Reasoning Results

Click the button above to let the reasoner do its work. It should report the results of the queries below. Note that the reasoner brings the query formulas into a normal form (similar to negation normal form), so the printed formulas below may differ syntactically from your queries.

Click here to display/hide debug output.

The Problem Description Language

A problem description consists of four parts:

  1. declarations of sorts, variables, standard names, and functions;
  2. optional abbreviations for formulas;
  3. the knowledge definition;
  4. queries.

The syntax of these segments is as follows, where this font is a word of the the problem description language, and this font represents a meta-variable.

All sorts, variables, names, and function symbols must be declared before they are used. Declarations are of the following form:

where sort, x, n, f are identifiers and arity is a natural number ≥ 0. An identifier is a sequence of lower- and upper-case letters, digits, underscore and dash symbols, with the first symbol being a letter or underscore. No two sorts can have the same identifier. No two variables, names, or functions can have the same identifier.

The following constructs are well-formed formulas:

A literal is of the following form:

where ti is a term. A term is either the identifier of a previously declared variable x, a previously declared standard name n, or a compound term f(t'1, ..., t'k) where a previously declared function symbol f of arity k is applied to other terms t'i. When f is a constant symbol (that is, has arity 0), the brackets may be omitted. Variables in the KB are implicitly universally quantified.

A split-level is a natural number ≥ 0 that indicates how much reasoning effort the reasoner can spend on proving the formula in the modality. The modal operator Know is the usual knowledge modality, Cons means a formula is considered possible (that is, its negation is not known), and Bel is conditional belief. All three operators are sound but incomplete with respect to the unlimited logic of only-knowing/believing. The split-level can have two different meanings. The one within Know and the first parameter of Bel specify how many terms may be split. A split means to select a term f(n1,...,nl) and consider all possible denotations of that term; that is, the reasoner tests all (relevant) assignments for these terms. The split-level in Cons and the second parameter of Bel, on the other hand, specify how many terms can be freely assigned a value, which means to select a (possibly non-ground) term f(t1,...,tl) and fix its denotation.

Within the scope of the Guarantee modality the reasoner is allowed to assume the knowledge base is consistent, which may improve performance because it limits the splitting search space.

Operator precedence is as follows: equivalence < implication < disjunction < conjunction < negation, quantifiers, modalities < brackets. Note the maximal precedence of quantifiers and modalities. Use brackets to expand the scope of a quantifier or a modal operator. For example, to say that formula1 || formula2 is known, write Know<split-level> (formula1 || formula2). The formula Know<split-level> formula1 || formula2 by contrast says that either formula1 is known or formula2 is true.

Any formula abbreviation formula-id must be defined before use:

where formula-id is the identifier by which the formula can later be referred. formula-id can be re-assigned new values.

The knowledge base consists of a sequence of statements of the following form:

where one of the following syntactic conditions must be satisfied:

  1. formula contains no modal operators and its normal form (≈ prenex-NNF) is a clause without existentially quantified variables;
  2. formula is of the form Know<split-level> formula' where formula' satisfies to condition 1 (the split-level is ignored);
  3. formula is of the form Bel<split-level1,split-level2> formula1 ==> formula2 where !formula1 || formula2 satisfies to condition 1 (the split-levels affect how faithful the induced system of spheres is to the unlimited logic).

Free variables in formula in KB definitions are implicitly universally quantified. The formal definition of the normal form is tedious, but the idea is this: push negations inwards but not into clauses, and pull quantifiers out of clauses. The rationale is to create new clauses (while avoiding the exponential blowup of a full CNF). Additionally, terms are flattened so that no two function symbols occur in a any literal. For instance, a disjunction KB: literal1 || ... || literalk meets this requirement trivially. Implications are also allowed, provided that the negation of the antecedent as well as the consequent meet above form, as does KB: Ex x (literal1 && literal2) -> (literal3 || literal4).

Queries are of the form:

where formula is subjective, which means functions must not occur outside of modal operators (but variables, names, quantifiers, etc. may). The Assert and Refute versions differ from the Query version in that they yield a error when the query does not come out true or false, respectively; this is useful for automated testing.

Procedure calls are of the form Call: proc(arg1,...,argk). In particular, they include:

Furthermore simple control structures are allowed: if-then-else, while-loops, and for-loops. See the Battleship and Sudoku code for examples.

C-style single line comments are supported as well: // rest of line is comment.