Введение
Контрольные потоковые графы с 3 типами структур управления могут вычислить любую вычислимую функцию. Теорема о структурированном программировании, также известная как теорема Бёма — Якопини, является результатом теории языков программирования. Она утверждает, что класс графов потока управления (исторически называемых блок-схемами в этом контексте) может вычислить любую вычислимую функцию, если он комбинирует подпрограммы только тремя конкретными способами (структурами управления). Это:
The structured program theorem, also called the Böhm–Jacopini theorem, is a result in programming language theory. It states that a class of control flow graphs (historically called flowcharts in this context) can compute any computable function if it combines subprograms in only three specific ways (control structures). These are
Executing one subprogram, and then another subprogram (sequence)
Executing one of two subprograms according to the value of a boolean expression (selection)
Repeatedly executing a subprogram as long as a boolean expression is true (iteration)
The structured chart subject to these constraints, particularly the loop constraint implying a single exit (as described later in this article), may however use additional variables in the form of bits (stored in an extra integer variable in the original proof) in order to keep track of information that the original program represents by the program location. The construction was based on Böhm's programming language P′′. The theorem forms the basis of structured programming, a programming paradigm which eschews goto commands and exclusively uses subroutines, sequences, selection and iteration.
* Выполнение одной подпрограммы, а затем другой (последовательность).
* Выполнение одной из двух подпрограмм в зависимости от значения булева выражения (выбор).
* Повторное выполнение подпрограммы, пока булево выражение истинно (итерация).
The structured program theorem, also called the Böhm–Jacopini theorem, is a result in programming language theory. It states that a class of control flow graphs (historically called flowcharts in this context) can compute any computable function if it combines subprograms in only three specific ways (control structures). These are
Executing one subprogram, and then another subprogram (sequence)
Executing one of two subprograms according to the value of a boolean expression (selection)
Repeatedly executing a subprogram as long as a boolean expression is true (iteration)
The structured chart subject to these constraints, particularly the loop constraint implying a single exit (as described later in this article), may however use additional variables in the form of bits (stored in an extra integer variable in the original proof) in order to keep track of information that the original program represents by the program location. The construction was based on Böhm's programming language P′′. The theorem forms the basis of structured programming, a programming paradigm which eschews goto commands and exclusively uses subroutines, sequences, selection and iteration.
Структурированная схема, подчиняющаяся этим ограничениям, особенно ограничение на цикл, подразумевающее единственный выход (как описано далее в этой статье), может, однако, использовать дополнительные переменные в виде битов (хранящиеся в дополнительной целочисленной переменной в оригинальном доказательстве) для отслеживания информации, которую исходная программа представляет положением программы. Конструкция была основана на языке программирования P′′ Бёма. Теорема является основой структурированного программирования — парадигмы программирования, которая избегает команд `goto` и исключительно использует подпрограммы, последовательности, выбор и итерацию.
The structured program theorem, also called the Böhm–Jacopini theorem, is a result in programming language theory. It states that a class of control flow graphs (historically called flowcharts in this context) can compute any computable function if it combines subprograms in only three specific ways (control structures). These are
Executing one subprogram, and then another subprogram (sequence)
Executing one of two subprograms according to the value of a boolean expression (selection)
Repeatedly executing a subprogram as long as a boolean expression is true (iteration)
The structured chart subject to these constraints, particularly the loop constraint implying a single exit (as described later in this article), may however use additional variables in the form of bits (stored in an extra integer variable in the original proof) in order to keep track of information that the original program represents by the program location. The construction was based on Böhm's programming language P′′. The theorem forms the basis of structured programming, a programming paradigm which eschews goto commands and exclusively uses subroutines, sequences, selection and iteration.
Происхождение и варианты
Теорема обычно приписывается Дэвиду Харелу, который в 1980 году написал, что статья Бёма — Жакопини пользовалась «всеобщей популярностью», и Клини.
Доказательство Бёма и Якопини
Доказательство в статье Бёма и Якопини проводится индукцией по структуре блок-схемы. Это важная концепция в области обратимых вычислений. Она утверждает, что любое вычисление, достижимое обратимой программой, также может быть выполнено обратимой программой, использующей лишь структурированную комбинацию конструкций управления потоком, таких как последовательности, ветвления и повторения. Любое вычисление, достижимое традиционной необратимой программой, также может быть выполнено обратимой программой, но с дополнительным условием, что каждый шаг должен быть обратимым и требовать дополнительный выход. Более того, любое обратимое неструктурированное вычисление также может быть выполнено структурированной обратимой программой с единственной итерацией без какого-либо дополнительного вывода. Эта теорема закладывает основополагающие принципы построения обратимых алгоритмов в рамках структурированного программирования. Для теоремы о структурированных программах известны оба локальных метода доказательства. Однако для её обратимой версии, хотя глобальный метод доказательства известен, локальный подход, аналогичный подходу Бёма и Якопини, пока не разработан. Это различие является примером, подчеркивающим сложности и нюансы в построении основ обратимых вычислений по сравнению с традиционными вычислительными парадигмами.