Concept

P′′

P′′ (P double prime) is a primitive computer programming language created by Corrado Böhm in 1964 to describe a family of Turing machines. (hereinafter written P′′) is formally defined as a set of words on the four-instruction alphabet , as follows: and are words in P′′. If and are words in P′′, then is a word in P′′. If is a word in P′′, then is a word in P′′. Only words derivable from the previous three rules are words in P′′. is the tape-alphabet of a Turing machine with left-infinite tape, being the blank symbol, equivalent to . All instructions in P′′ are permutations of the set of all possible tape configurations; that is, all possible configurations of both the contents of the tape and the position of the tape-head. is a predicate saying that the current symbol is not . It is not an instruction and is not used in programs, but is instead used to help define the language. means move the tape-head rightward one cell (if possible). means replace the current symbol with , and then move the tape-head leftward one cell. means the function composition . In other words, the instruction is performed before . means iterate in a while loop, with the condition . P′′ was the first "GOTO-less" imperative structured programming language to be proven Turing-complete The Brainfuck language (apart from its I/O commands) is a minor informal variation of P′′. Böhm gives explicit P′′ programs for each of a set of basic functions sufficient to compute any computable function, using only , and the four words where with denoting the th iterate of , and . These are the equivalents of the six respective Brainfuck commands , , , , , . Note that since , incrementing the current symbol times will wrap around so that the result is to "decrement" the symbol in the current cell by one (). Böhm gives the following program to compute the predecessor (x-1) of an integer x > 0: which translates directly to the equivalent Brainfuck program:

[>]

À propos de ce résultat
Cette page est générée automatiquement et peut contenir des informations qui ne sont pas correctes, complètes, à jour ou pertinentes par rapport à votre recherche. Il en va de même pour toutes les autres pages de ce site. Veillez à vérifier les informations auprès des sources officielles de l'EPFL.

Graph Chatbot

Chattez avec Graph Search

Posez n’importe quelle question sur les cours, conférences, exercices, recherches, actualités, etc. de l’EPFL ou essayez les exemples de questions ci-dessous.

AVERTISSEMENT : Le chatbot Graph n'est pas programmé pour fournir des réponses explicites ou catégoriques à vos questions. Il transforme plutôt vos questions en demandes API qui sont distribuées aux différents services informatiques officiellement administrés par l'EPFL. Son but est uniquement de collecter et de recommander des références pertinentes à des contenus que vous pouvez explorer pour vous aider à répondre à vos questions.