A question of syntax
We could try to identify the difference within the realm of syntax: Are there any formal means to differentiate validly? Questions carry a question mark, answers do not, one could say. However, spoken language does not carry punctuation signs, although a spoken question usually has a different speech melody than its answer. But, there could be even simple, unstructured signs, which have the character of questions or answers. So, we can say that ‘usually’ questions seem to have a certain form. But, things become complicate, if we take into account rhetoric questions, which convey more of a proposition than they are questioning it or ironic remarks, which put into question exactly the proposition they make. E.g. it is well known that with the symbols of first order logic on the one hand we can formulate propositions and on the other hands, these expressions can be used to formulate queries. Using a functional notation, we can say that Query_for_name(0815) = “Johannes Reich” could be interpreted ‘from left to right ’as the result of a query function, looking up the name for the ID 0815, or interpreted from ‘right to left’ as the definition of the query function for the specific value pair (0815, “Johannes Reich”). In other words, a data base insert is in some sense nothing else than a change of the query function.
A semantic answer
The picture becomes clearer, if I state the initial sentence a bit differently: >> The meaning of “Your name is Mark” could be either a statement, proposing or a question questioning the proposition, that ‘Your name is Mark’.<< This suggests, that the difference between a question and an answer is not a syntactical one, but depends on interpretation and therefore can only be found in the realm of semantics. This makes it understandable, why grammatical means can support autonomous and creative interpreters like us making this distinction, but cannot guarantee it. To describe the semantics of some expressions, we have at least two different approaches. We can describe the semantics of an expression of one language with expressions of another language. This is termed “denotational” approach and is the usual way meaning of formal notations of mathematics is declared. However, it presupposes a sufficiently clear understanding of the ‘other’ or ‘meta’ language. We would have to explain the difference between question and answer by referring to questions and answers in the ‘meta’ language – not especially illuminative for our purposes. The other approach for the definition of the semantic of an expression is to define how its interpretation affects state changes. This is termed “operational” approach and is the way the meaning of formal imperative programming languages is defined. It requires an interpreter, which is capable of reading the expression and change its state accordingly. I would like to ponder about the difference between questions and answers in the latter semantic frame of operational semantics. In the following I represent information processing as transitions of an extended I/O-automaton. In contrast to ordinary I/O automata, ‘extended’ means, that the characters of the I/O-alphabets as well as the state may show an inner structure. In other words, the I/O characters represent types of strings with a grammar and the state also may have a complex structure. Because of the further structure of state and I/O-alphabets, the transitions can be further qualified by conditional expressions, referring to this inner structure (a similar way to describe this system would be persistent Turing machines or interactive transition systems). Within this frame I show, that important aspects of the character of received or sent information, which are relevant to our distinction, depend on the structure of the complete transition relation in the sense of automata theory and cannot be exclusively attributed to the transitions themselves.
The simplest case of what is usually understood as a question/answer interaction is illustrated in Fig. 1. A system is in some state p, receives an information ‘a’, invariably sends back some information ‘c’, and does not change its state. A typical case would be a query to a database. Fig. 1: State diagram, where a state p remains invariant during a transition while receiving a (possibly structured) character a and sending a character ‘c’. However, what happens, if the receiver does change its state? E.g. the receiver of our information might just remember what we have asked, to use this information later on, e.g. for specific advertising. Or we make a data base update? Or, as is shown in Fig. 2, we make a database insert, which also changes the behavioral state of the database? Here, it seems that we have to decide, which effect we want to accentuate by naming it: Either the fact that we get an answer to our question in the sense of Fig. 1 or the fact that we gave a command to change the state. Fig. 2: State diagram, where state p changes to q, while receiving a (possibly structured) character ‘a’ and sending character ‘b’. What happens, if we combine the states and transitions of Fig.1 and 2, as shown in Fig. 3, intentionally keeping the description symbols constant? The semantics of this diagram is, that the input information ‘a’ does not suffice to determine, which transition will be taken. Both transitions are possible – a typical case for business protocols. Fig. 3: combines states and transitions of Fig. 1 and 2. Two alternative transitions can be initiated by an incoming character ‘a’. One leads to a new state q, the other one leaves the state invariant. Can we still say that the transition p->p has question/answer character? I would say yes. The semantics of the transition has not changed. However, we cannot say anymore that the character ‘a’ is a question in the same sense as we did before. We can say so only with respect of the p->p transition, of which we do not know whether it is chosen, if we sent the ‘a’ character. Even with nondeterministic interaction, we have a simple case, which one might spontaneously qualify as question and answer. It is illustrated in Fig. 4. Starting from state p, a character ‘a’ is received, with a state changing transition and while spontaneously transiting back, a character ‘b’ is sent back. Fig. 4: Two state transitions, where with one, a character ‘a’ is received and with the other one, a character ‘b’ is spontaneously sent. But, just looking at Fig. 4, we do not know, whether state p is occupied in the beginning. It could well be, that state q is occupied first. As a result, the system would be in the opposite role and ‘b’ would become its question and ‘a’ would be the other’s answer. Also, the state diagram could be run though multiple cycles, as it is the case in two player games like tic tac toe or chess where players move in turn. Additionally, the whole picture changes again, if other transitions referring to the same characters come into play.
Assuming extended I/O-automata as a model for systems, described from an interaction point of view, the classification of input and output as question or answer may depend on the complete transition relation of these automata and not just on a single transition. As a consequence, it seems that the semantics of messages cannot be defined without referring to all accepting transitions of such a system.