Once you have encoded rules and described relevant facts in a test, you will want to ask a question. That is what the question block is for.

A question looks like this:

Question Block

The question block must be provided with one or more statements that are your query. Like most places in Blawx, if statements are stacked in a question block, they are treated as though the word "and" appears between them. So all statements must be true at the same time for the reasoner to find an answer to the question.

There are two kinds of questions... yes/no questions, and search questions.

Yes/No Questions

A question that does not include variables is a “yes/no” question. An example is “Is Socrates Mortal?”

is socrates mortal

This question will be answered by the Blawx reasoner with either an Answer with an explanation, and no bindings, or as the answer "no models".

In the context of a yes/no question, the response "no models" means "no". There can be only one answer, and the existence of an answer (with any number of explanations) means "yes".

Search Questions

A question that includes named variables is a “search” question. Blawx attempts to find any objects or values with which it can replace all the variables used in the question so that the statements in the question will be true. If it can’t find any, it will respond “no models”. If it can find any values that fit, it will provide each combination as an answer, tell you what the bindings were in that answer, and provide all the explanations for each answer.

So the question “is Socrates Mortal” above, which is a “yes or no” question, can be changed into a search by replacing “Socrates” with a variable.

who is mortal

Multiple Questions in One Test

If you create a test with more than one question block, only one question will be used, and it can be difficult to predict which. It is best practice to have only one active question block in your tests.