Episode 3 Constant games Games as models of interactive computational tasks The two players Moves, positions and runs Constant games defined Prefixation Traditional computational problems as games Departing from functionality Departing from the input-output scheme Departing from the depth-2 restriction Classical propositions as games
COMPUTATION INPUT (Question) OUTPUT (Answer) Computing agent (Machine) Does the Church-Turing thesis in its traditional form really provide an ultimate answer to what computability means? 3.1 Yes and no. “Yes”, because all effective functions can indeed be computed by Turing machines. “No”, because apparently not all computational problems are functions. Functions are only special cases of computational problems, assuming a very simple interface between a computing agent and its environment, consisting in receiving an input (question) and generating an output (answer): COMPUTATION (the outside world is fully shut out during this process) INPUT (Question) (Environment’s action) OUTPUT (Answer) (Agent’s action) Computing agent (Machine) O u t s i d e w o r l d (E n v i r o n m e n t)
... Interaction Outside world Computing agent The reality 3.2 Most tasks that real computers or humans perform, however, are interactive, with multiple and/or continuous “inputs” and “outputs” interleaved in some complex fashion. Interaction Outside world Computing agent ... Imagine a robot taxi driver. Its brain is a computer, so, whatever task it performs is a computational task (problem). But is that task a function? What is input and what is output here? Rather, input comes to the robot (through its perceptrons) continuously and is interleaved with the computation process and “output” (robot’s actions) steps. The environment remains active during computation, that is. Part of computation involves watching environment’s actions, making decisions regarding whether to react or wait for more input, etc. The environment, in turn, does not wait till the robot reacts before providing more input. Trouble. The traditional understanding of computational problems as functions appears to be too narrow. Instead, we suggest to understand computational problems as games. This is where computability logic starts.
Computational problems --- games between two players 3.3 MACHINE (⊤, Green, Computer, Robot, Agent) ENVIRONMENT (⊥, Red, User, Nature, Devil) Players: good guy bad guy algorithmic arbitrary Behavior: (strategy)
Why should our sympathies be with ⊤ (machine)? 3.4 “The reason why I should be a fan [迷] of the machine even --- in fact especially --- when it is playing against me is that the machine is a tool, and what makes it valuable as such is exactly its winning the game, i.e. its not being malfunctional [故障的] (it is precisely losing by a machine the game that it was supposed to win what in everyday language is called malfunctioning). Let me imagine myself using a computer for computing the “28% of x” function in the process of preparing my federal tax return. This is a game where the first move is mine, consisting in inputting a number m and meaning asking ⊤ the question “what is 28% of m?”. The machine wins iff it answers by the move/output n such that n=0.28m. Of course, I do not want the machine to tell me that 27,000 is 28% of 100,000. In other words, I do not want to win against the machine. For then I could lose the more important game against Uncle Sam [山姆大叔].” From “In the beginning was game semantics”.
Moves, labeled moves, runs, positions 3.5 The machine and the environment interact with each other through observable actions. We will be using the term “move” instead of “observable action”. Going back to the ordinary TM model, it is about games where only two moves are made: the first (“input”) move, always made by the environment at the very beginning of the play, and the second (“output”) move, made by the machine if and when halts. We agree on the following: A move is any finite string over the keyboard alphabet. We will be using , , as metavariables for moves. A labeled move is a move prefixed with the label ⊤ or ⊥, indicating who has made the move. We will be using as a metavariable for labeled moves. In this PowerPoint presentation, usually green will be written instead of ⊤, and red instead of ⊥. A run is any sequence of labeled moves. We will be using , , as metavariables for runs. A position is any finite run. We will be using , , as metavariables for positions. We will be writing runs and positions as ⊥, ⊥, ⊤, , , , ⊥, , etc. thus stands for the empty position.
Gamestructures 3.6 Definition 3.6 A gamestructure, or simply structure, is a nonempty set Lr of runs satisfying the condition that a run is in Lr iff all of its finite initial segments are in Lr. Intuitively, Lr is the set of legal runs. The runs that are not in Lr are illegal. Notice that the empty run is always legal. A (labeled) illegal move is one adding which to a given position makes it illegal. Some intuitions associated with illegal moves: (1) Moves that can or should never be made; (2) Moves that cause the system crash (e.g., requesting to divide a number by 0). The player who has made the first illegal move in a given run is called the offender.
Visualizing gamestructures 3.7 s stand for legal positions. Edges stand for labeled moves, with their color indicating who moves. Lr= { Who is the offender in , , , , (= ⊥, ⊤, ⊥, ⊤, ⊤ )? , , , , ,, ,, ,, ,, ,, ,, ,,, ,,, ,,, ,,, ,,, ,, } Environment offending move (first illegal move)
Definition 3.8.a Let Lr be a gamestructure. A content on Lr is a Constant games 3.8 Definition 3.8.a Let Lr be a gamestructure. A content on Lr is a function Wn: Lr {⊤,⊥}. When Wn =⊤, we say that is won by ⊤ (and lost by ⊥); and when Wn =⊥, we say that is won by ⊥ (and lost by ⊤). We extend the domain of Wn to all runs by stipulating that an illegal run is always lost by the offender. Definition 3.8.b A constant game A is a pair (LrA,WnA), where LrA is a gamestructure, and WnA is a content on LrA. The color of a node/position indicates who wins if the game ends there.
Example of a winning strategy 3.9 Notice that strategies cannot be defined as functions from positions to moves, because, in some positions (such as the root position in this example) both players have legal moves, and which of them acts faster may determine what the next move will be. The exact meaning of “strategy” will be defined a few lectures later, but whatever it means, we can see that the machine has a winning strategy in this game: “Regardless of what the adversary is doing or has done, go ahead and make move ; make as your second move if and when you see that the adversary has made move , no matter whether this happened before or after your first move”. Does this strategy guarantee that the machine will not offend? What legal runs are consistent (could be generated) with this strategy? Sure. There are 5 such runs: ; ,; ,; ,,; ,,. All won by the machine.
A Definition 3.10 Let A be a constant game, and be a legal position Prefixation 3.10 Definition 3.10 Let A be a constant game, and be a legal position of A (i.e., LrA). The game A, called the -prefixation of A, is defined by: LrA = { | , LrA} WnA =WnA , ,A ,,A A
Traditional computational problems as games 3.11 As noted in Episode 2, computational problems in the traditional sense are nothing but functions (to be computed). Such problems can be seen as the following types of depth-2 games: Input 1 2 ... Output ... ... ... 1 2 3 1 2 3 1 2 3 It corresponds to the situation where there was no input. The machine has nothing to answer for, so it wins. Why is the root green? Why are the 2nd-level nodes red? Why does each group of 3rd-level nodes have exactly one green node? What particular function is this game about? They correspond to situations where there was an input but no output was generated by the machine. So the machine loses. Because a function has exactly one (“correct”) value for each argument. The successor function: f(n)=n+1.
Departing from functionality 3.12 Once we agree that computational problems are nothing but games, the difference in the degrees of generality and flexibility between the traditional approach to computational problems and our approach becomes apparent and appreciable. What we see below is indeed a very special sort of games, and there is no good call for confining ourselves to its limits. In fact, staying within those limits would seriously retard any more or less advanced and systematic study of computability. 1 2 ... ... ... ... 1 2 3 1 2 3 1 2 3 First of all, one would want to get rid of the “one green node per sibling group” restriction for the third-level nodes. Many natural problems, such as the problem of finding a prime integer between n and 2n, or finding a root of x2-2n=0, may have more than one as well as less than one solution. That is, there can be more than one as well as less than one “right” output on a given input n.
Departing from the input-output scheme 3.13 And why not further get rid of any remaining restrictions on the colors of whatever-level nodes and whatever-level arcs. One can easily think of natural situations where, say, some inputs do not obligate the machine to generate an output and thus the corresponding second-level nodes should be green. An example would be the case where the machine is computing a partially-defined function f and receives an input on which f is undefined. 1 3 1 2 ... ... ... ... 1 2 3 1 2 3 1 2 3
Departing from the depth-2 restriction 3.14 So far we have been talking about generalizations within the depth-2 restriction, corresponding to viewing computational problems as very short dialogues between the machine and its environment. Permitting longer-than-2 or even infinitely long branches would allow us to capture problems with arbitrarily high degrees of interactivity. The task performed by network server is an example of an infinite dialogue between the server and its environment --- the collection of clients, or let us just say the rest of the network. 1 3 1 2 ... ... ... ... 1 2 3 1 2 3 1 2 3 5 1 2 8 3 ...
Elementary games; propositions as games 3.15 It also makes sense to consider “dialogues” of lengths less than 2. Games of depth 0 are said to be elementary. There are exactly two elementary constant games. We identify them with the propositions ⊥ and ⊤ of classical logic. Games ⊥ and ⊤: Snow is black 2+2=5 Snow is white 2+2=4 1 1 2 ... Remember: Elementary games are games without any moves, automatically won or lost by the machine. Proposition ⊤ is the elementary game won by the machine, and ⊥ is the elementary game lost by the machine. Constant games are generalized propositions. ... ... ... 1 2 3 1 2 3 3 1 2 3 5 1 2 8 3 ...