text
stringlengths 105
4.17k
| source
stringclasses 883
values |
---|---|
The symmetry operation is an action, such as a rotation around an axis or a reflection through a mirror plane. In other words, it is an operation that moves the molecule such that it is indistinguishable from the original configuration. In group theory, the rotation axes and mirror planes are called "symmetry elements". These elements can be a point, line or plane with respect to which the symmetry operation is carried out. The symmetry operations of a molecule determine the specific point group for this molecule.
In chemistry, there are five important symmetry operations. They are identity operation (E), rotation operation or proper rotation (Cn), reflection operation (σ), inversion (i) and rotation reflection operation or improper rotation (Sn). The identity operation (E) consists of leaving the molecule as it is. This is equivalent to any number of full rotations around any axis. This is a symmetry of all molecules, whereas the symmetry group of a chiral molecule consists of only the identity operation. An identity operation is a characteristic of every molecule even if it has no symmetry. Rotation around an axis (Cn) consists of rotating the molecule around a specific axis by a specific angle. It is rotation through the angle 360°/n, where n is an integer, about a rotation axis.
|
https://en.wikipedia.org/wiki/Group_theory
|
Rotation around an axis (Cn) consists of rotating the molecule around a specific axis by a specific angle. It is rotation through the angle 360°/n, where n is an integer, about a rotation axis. For example, if a water molecule rotates 180° around the axis that passes through the oxygen atom and between the hydrogen atoms, it is in the same configuration as it started. In this case, , since applying it twice produces the identity operation. In molecules with more than one rotation axis, the Cn axis having the largest value of n is the highest order rotation axis or principal axis. For example in boron trifluoride (BF3), the highest order of rotation axis is C3, so the principal axis of rotation is C3.
In the reflection operation (σ) many molecules have mirror planes, although they may not be obvious. The reflection operation exchanges left and right, as if each point had moved perpendicularly through the plane to a position exactly as far from the plane as when it started. When the plane is perpendicular to the principal axis of rotation, it is called σh (horizontal). Other planes, which contain the principal axis of rotation, are labeled vertical (σv) or dihedral (σd).
Inversion (i ) is a more complex operation.
|
https://en.wikipedia.org/wiki/Group_theory
|
Other planes, which contain the principal axis of rotation, are labeled vertical (σv) or dihedral (σd).
Inversion (i ) is a more complex operation. Each point moves through the center of the molecule to a position opposite the original position and as far from the central point as where it started. Many molecules that seem at first glance to have an inversion center do not; for example, methane and other tetrahedral molecules lack inversion symmetry. To see this, hold a methane model with two hydrogen atoms in the vertical plane on the right and two hydrogen atoms in the horizontal plane on the left. Inversion results in two hydrogen atoms in the horizontal plane on the right and two hydrogen atoms in the vertical plane on the left. Inversion is therefore not a symmetry operation of methane, because the orientation of the molecule following the inversion operation differs from the original orientation. And the last operation is improper rotation or rotation reflection operation (Sn) requires rotation of 360°/n, followed by reflection through a plane perpendicular to the axis of rotation.
### Cryptography
Very large groups of prime order constructed in elliptic curve cryptography serve for public-key cryptography.
|
https://en.wikipedia.org/wiki/Group_theory
|
And the last operation is improper rotation or rotation reflection operation (Sn) requires rotation of 360°/n, followed by reflection through a plane perpendicular to the axis of rotation.
### Cryptography
Very large groups of prime order constructed in elliptic curve cryptography serve for public-key cryptography. Cryptographical methods of this kind benefit from the flexibility of the geometric objects, hence their group structures, together with the complicated structure of these groups, which make the discrete logarithm very hard to calculate. One of the earliest encryption protocols, Caesar's cipher, may also be interpreted as a (very easy) group operation. Most cryptographic schemes use groups in some way. In particular Diffie–Hellman key exchange uses finite cyclic groups. So the term group-based cryptography refers mostly to cryptographic protocols that use infinite non-abelian groups such as a braid group.
|
https://en.wikipedia.org/wiki/Group_theory
|
In computer science, symbolic execution (also symbolic evaluation or symbex) is a means of analyzing a program to determine what inputs cause each part of a program to execute. An interpreter follows the program, assuming symbolic values for inputs rather than obtaining actual inputs as normal execution of the program would. It thus arrives at expressions in terms of those symbols for expressions and variables in the program, and constraints in terms of those symbols for the possible outcomes of each conditional branch. Finally, the possible inputs that trigger a branch can be determined by solving the constraints.
The field of symbolic simulation applies the same concept to hardware. Symbolic computation applies the concept to the analysis of mathematical expressions.
## Example
Consider the program below, which reads in a value and fails if the input is 6.
```c
int f() {
...
y = read();
z = y * 2;
if (z == 12) {
fail();
} else {
printf("OK");
}
}
```
During a normal execution ("concrete" execution), the program would read a concrete input value (e.g., 5) and assign it to `y`. Execution would then proceed with the multiplication and the conditional branch, which would evaluate to false and print `OK`.
|
https://en.wikipedia.org/wiki/Symbolic_execution
|
## Example
Consider the program below, which reads in a value and fails if the input is 6.
```c
int f() {
...
y = read();
z = y * 2;
if (z == 12) {
fail();
} else {
printf("OK");
}
}
```
During a normal execution ("concrete" execution), the program would read a concrete input value (e.g., 5) and assign it to `y`. Execution would then proceed with the multiplication and the conditional branch, which would evaluate to false and print `OK`.
During symbolic execution, the program reads a symbolic value (e.g., `λ`) and assigns it to `y`. The program would then proceed with the multiplication and assign `λ * 2` to `z`. When reaching the `if` statement, it would evaluate `λ * 2 == 12`. At this point of the program, `λ` could take any value, and symbolic execution can therefore proceed along both branches, by "forking" two paths. Each path gets assigned a copy of the program state at the branch instruction as well as a path constraint. In this example, the path constraint is `λ * 2 == 12` for the `if` branch and `λ * 2 != 12` for the `else` branch. Both paths can be symbolically executed independently.
|
https://en.wikipedia.org/wiki/Symbolic_execution
|
In this example, the path constraint is `λ * 2 == 12` for the `if` branch and `λ * 2 != 12` for the `else` branch. Both paths can be symbolically executed independently. When paths terminate (e.g., as a result of executing `fail()` or simply exiting), symbolic execution computes a concrete value for `λ` by solving the accumulated path constraints on each path. These concrete values can be thought of as concrete test cases that can, e.g., help developers reproduce bugs. In this example, the constraint solver would determine that in order to reach the `fail()` statement, `λ` would need to equal 6.
## Limitations
### Path explosion
Symbolically executing all feasible program paths does not scale to large programs. The number of feasible paths in a program grows exponentially with an increase in program size and can even be infinite in the case of programs with unbounded loop iterations. Solutions to the path explosion problem generally use either heuristics for path-finding to increase code coverage, reduce execution time by parallelizing independent paths, or by merging similar paths. One example of merging is veritesting, which "employs static symbolic execution to amplify the effect of dynamic symbolic execution".
|
https://en.wikipedia.org/wiki/Symbolic_execution
|
Solutions to the path explosion problem generally use either heuristics for path-finding to increase code coverage, reduce execution time by parallelizing independent paths, or by merging similar paths. One example of merging is veritesting, which "employs static symbolic execution to amplify the effect of dynamic symbolic execution".
### Program-dependent efficiency
Symbolic execution is used to reason about a program path-by-path which is an advantage over reasoning about a program input-by-input as other testing paradigms use (e.g. dynamic program analysis). However, if few inputs take the same path through the program, there is little savings over testing each of the inputs separately.
### Memory aliasing
Symbolic execution is harder when the same memory location can be accessed through different names (aliasing). Aliasing cannot always be recognized statically, so the symbolic execution engine can't recognize that a change to the value of one variable also changes the other.
### Arrays
Since an array is a collection of many distinct values, symbolic executors must either treat the entire array as one value or treat each array element as a separate location. The problem with treating each array element separately is that a reference such as "A[i]" can only be specified dynamically, when the value for i has a concrete value.
### Environment interactions
Programs interact with their environment by performing system calls, receiving signals, etc.
|
https://en.wikipedia.org/wiki/Symbolic_execution
|
The problem with treating each array element separately is that a reference such as "A[i]" can only be specified dynamically, when the value for i has a concrete value.
### Environment interactions
Programs interact with their environment by performing system calls, receiving signals, etc. Consistency problems may arise when execution reaches components that are not under control of the symbolic execution tool (e.g., kernel or libraries). Consider the following example:
```c
int main()
{
FILE *fp = fopen("doc.txt");
...
if (condition) {
fputs("some data", fp);
} else {
fputs("some other data", fp);
}
...
data = fgets(..., fp);
}
```
This program opens a file and, based on some condition, writes different kind of data to the file. It then later reads back the written data. In theory, symbolic execution would fork two paths at line 5 and each path from there on would have its own copy of the file. The statement at line 11 would therefore return data that is consistent with the value of "condition" at line 5. In practice, file operations are implemented as system calls in the kernel, and are outside the control of the symbolic execution tool. The main approaches to address this challenge are:
Executing calls to the environment directly.
|
https://en.wikipedia.org/wiki/Symbolic_execution
|
The main approaches to address this challenge are:
Executing calls to the environment directly. The advantage of this approach is that it is simple to implement. The disadvantage is that the side effects of such calls will clobber all states managed by the symbolic execution engine. In the example above, the instruction at line 11 would return "some datasome other data" or "some other datasome data" depending on the sequential ordering of the states.
Modeling the environment. In this case, the engine instruments the system calls with a model that simulates their effects and that keeps all the side effects in per-state storage. The advantage is that one would get correct results when symbolically executing programs that interact with the environment. The disadvantage is that one needs to implement and maintain many potentially complex models of system calls.
## Tools
such as KLEE, Cloud9, and Otter take this approach by implementing models for file system operations, sockets, IPC, etc.
Forking the entire system state. Symbolic execution tools based on virtual machines solve the environment problem by forking the entire VM state. For example, in S2E each state is an independent VM snapshot that can be executed separately. This approach alleviates the need for writing and maintaining complex models and allows virtually any program binary to be executed symbolically. However, it has higher memory usage overheads (VM snapshots may be large).
|
https://en.wikipedia.org/wiki/Symbolic_execution
|
Tools
Tool Target URL Can anybody use it/ Open source/ Downloadable angr libVEX based (supporting x86, x86-64, ARM, AARCH64, MIPS, MIPS64, PPC, PPC64, and Java) http://angr.io/ BE-PUM x86 https://github.com/NMHai/BE-PUM BINSECx86, ARM, RISC-V (32 bits)http://binsec.github.io crucibleLLVM, JVM, etchttps://github.com/GaloisInc/crucible ExpoSE JavaScript https://github.com/ExpoSEJS/ExpoSE FuzzBALL VineIL / Native http://bitblaze.cs.berkeley.edu/fuzzball.html GenSym LLVM https://github.com/Generative-Program-Analysis/GenSym Jalangi2 JavaScript https://github.com/Samsung/jalangi2 janala2Java https://github.com/ksen007/janala2 JaVerT JavaScript https://www.doc.ic.ac.uk/~pg/publications/FragosoSantos2019JaVerT.pdf JBSEJava https://github.com/pietrobraione/jbse jCUTEJava https://github.com/osl/jcute KeYJava http://www.key-project.org/ Kite LLVM http://www.cs.ubc.ca/labs/isd/Projects/Kite/ KLEE LLVM https://klee.github.io/ Kudzu JavaScript
|
https://en.wikipedia.org/wiki/Symbolic_execution
|
http://webblaze.cs.berkeley.edu/2010/kudzu/kudzu.pdf MProEthereum Virtual Machine (EVM) / Nativehttps://sites.google.com/view/smartcontract-analysis/home Maat Ghidra P-code / SLEIGH https://maat.re/ Manticore x86-64, ARMv7, Ethereum Virtual Machine (EVM) / Native https://github.com/trailofbits/manticore/ Mayhem Binary http://forallsecure.com Mythril Ethereum Virtual Machine (EVM) / Native https://github.com/ConsenSys/mythril Otter C https://bitbucket.org/khooyp/otter/overview Owi C, C++, Rust, WebAssembly, Zig https://github.com/ocamlpro/owi Oyente-NG Ethereum Virtual Machine (EVM) /
|
https://en.wikipedia.org/wiki/Symbolic_execution
|
Mythril Ethereum Virtual Machine (EVM) / Native https://github.com/ConsenSys/mythril Otter C https://bitbucket.org/khooyp/otter/overview Owi C, C++, Rust, WebAssembly, Zig https://github.com/ocamlpro/owi Oyente-NG Ethereum Virtual Machine (EVM) / Native http://www.comp.ita.br/labsca/waiaf/papers/RafaelShigemura_paper_16.pdf Pathgrind Native 32-bit Valgrind-based https://github.com/codelion/pathgrind Pex .NET Framework http://research.microsoft.com/en-us/projects/pex/ pysymemu x86-64 / Native https://github.com/feliam/pysymemu/ Rosette Dialect of Racket https://emina.github.io/rosette/ Rubyx Ruby http://www.cs.umd.edu/~avik/papers/ssarorwa.pdf S2E x86, x86-64, ARM / User and kernel-mode binaries http://s2e.systems/ Symbolic PathFinder (SPF)
|
https://en.wikipedia.org/wiki/Symbolic_execution
|
Native https://github.com/ConsenSys/mythril Otter C https://bitbucket.org/khooyp/otter/overview Owi C, C++, Rust, WebAssembly, Zig https://github.com/ocamlpro/owi Oyente-NG Ethereum Virtual Machine (EVM) / Native http://www.comp.ita.br/labsca/waiaf/papers/RafaelShigemura_paper_16.pdf Pathgrind Native 32-bit Valgrind-based https://github.com/codelion/pathgrind Pex .NET Framework http://research.microsoft.com/en-us/projects/pex/ pysymemu x86-64 / Native https://github.com/feliam/pysymemu/ Rosette Dialect of Racket https://emina.github.io/rosette/ Rubyx Ruby http://www.cs.umd.edu/~avik/papers/ssarorwa.pdf S2E x86, x86-64, ARM / User and kernel-mode binaries http://s2e.systems/ Symbolic PathFinder (SPF) Java Bytecode https://github.com/SymbolicPathFinder SymDroid Dalvik bytecode http://www.cs.umd.edu/~jfoster/papers/symdroid.pdf SymJS JavaScript https://core.ac.uk/download/pdf/24067593.pdf SymCC LLVM https://www.s3.eurecom.fr/tools/symbolic_execution/symcc.html
|
https://en.wikipedia.org/wiki/Symbolic_execution
|
Native http://www.comp.ita.br/labsca/waiaf/papers/RafaelShigemura_paper_16.pdf Pathgrind Native 32-bit Valgrind-based https://github.com/codelion/pathgrind Pex .NET Framework http://research.microsoft.com/en-us/projects/pex/ pysymemu x86-64 / Native https://github.com/feliam/pysymemu/ Rosette Dialect of Racket https://emina.github.io/rosette/ Rubyx Ruby http://www.cs.umd.edu/~avik/papers/ssarorwa.pdf S2E x86, x86-64, ARM / User and kernel-mode binaries http://s2e.systems/ Symbolic PathFinder (SPF) Java Bytecode https://github.com/SymbolicPathFinder SymDroid Dalvik bytecode http://www.cs.umd.edu/~jfoster/papers/symdroid.pdf SymJS JavaScript https://core.ac.uk/download/pdf/24067593.pdf SymCC LLVM https://www.s3.eurecom.fr/tools/symbolic_execution/symcc.html Triton x86, x86-64, ARM and AArch64 https://triton.quarkslab.com Verifast C, Java https://people.cs.kuleuven.be/~bart.jacobs/verifast
|
https://en.wikipedia.org/wiki/Symbolic_execution
|
Java Bytecode https://github.com/SymbolicPathFinder SymDroid Dalvik bytecode http://www.cs.umd.edu/~jfoster/papers/symdroid.pdf SymJS JavaScript https://core.ac.uk/download/pdf/24067593.pdf SymCC LLVM https://www.s3.eurecom.fr/tools/symbolic_execution/symcc.html Triton x86, x86-64, ARM and AArch64 https://triton.quarkslab.com Verifast C, Java https://people.cs.kuleuven.be/~bart.jacobs/verifast
## Earlier versions of the tools
1. EXE is an earlier version of KLEE. The EXE paper can be found here.
## History
The concept of symbolic execution was introduced academically in the 1970s with descriptions of: the Select system,
the EFFIGY system,
the DISSECT system,
and Clarke's system.
|
https://en.wikipedia.org/wiki/Symbolic_execution
|
In computing, SQL injection is a code injection technique used to attack data-driven applications, in which malicious SQL statements are inserted into an entry field for execution (e.g. to dump the database contents to the attacker). SQL injection must exploit a security vulnerability in an application's software, for example, when user input is either incorrectly filtered for string literal escape characters embedded in SQL statements or user input is not strongly typed and unexpectedly executed. SQL injection is mostly known as an attack vector for websites but can be used to attack any type of SQL database.
SQL injection attacks allow attackers to spoof identity, tamper with existing data, cause repudiation issues such as voiding transactions or changing balances, allow the complete disclosure of all data on the system, destroy the data or make it otherwise unavailable, and become administrators of the database server. Document-oriented NoSQL databases can also be affected by this security vulnerability.
SQL injection remains a widely recognized security risk due to its potential to compromise sensitive data. The Open Web Application Security Project (OWASP) describes it as a vulnerability that occurs when applications construct database queries using unvalidated user input. Exploiting this flaw, attackers can execute unintended database commands, potentially accessing, modifying, or deleting data.
|
https://en.wikipedia.org/wiki/SQL_injection
|
The Open Web Application Security Project (OWASP) describes it as a vulnerability that occurs when applications construct database queries using unvalidated user input. Exploiting this flaw, attackers can execute unintended database commands, potentially accessing, modifying, or deleting data. OWASP outlines several mitigation strategies, including prepared statements, stored procedures, and input validation, to prevent user input from being misinterpreted as executable SQL code.
## History
Discussions of SQL injection began in the late 1990s, including in a 1998 article in Phrack Magazine. SQL injection was ranked among the top 10 web application vulnerabilities of 2007 and 2010 by the Open Web Application Security Project (OWASP). In 2013, SQL injection was listed as the most critical web application vulnerability in the OWASP Top 10.
In 2017, the OWASP Top 10 Application Security Risks grouped SQL injection under the broader category of "Injection," ranking it as the third most critical security threat. This category included various types of injection attacks, such as SQL, NoSQL, OS command, and LDAP injection. These vulnerabilities arise when an application processes untrusted data as part of a command or query, potentially allowing attackers to execute unintended actions or gain unauthorized access to data.
|
https://en.wikipedia.org/wiki/SQL_injection
|
This category included various types of injection attacks, such as SQL, NoSQL, OS command, and LDAP injection. These vulnerabilities arise when an application processes untrusted data as part of a command or query, potentially allowing attackers to execute unintended actions or gain unauthorized access to data.
By 2021, injection remained a widespread issue, detected in 94% of analyzed applications, with reported incidence rates reaching up to 19%. That year’s OWASP Top 10 further expanded the definition of injection vulnerabilities to include attacks targeting Object Relational Mapping (ORM) systems, Expression Language (EL), and Object Graph Navigation Library (OGNL). To address these risks, OWASP recommends strategies such as using secure APIs, parameterized queries, input validation, and escaping special characters to prevent malicious data from being executed as part of a query.
## Root cause
SQL Injection is a common security vulnerability that arises from letting attacker supplied data become SQL code. This happens when programmers assemble SQL queries either by string interpolation or by concatenating SQL commands with user supplied data. Therefore, injection relies on the fact that SQL statements consist of both data used by the SQL statement and commands that control how the SQL statement is executed.
|
https://en.wikipedia.org/wiki/SQL_injection
|
This happens when programmers assemble SQL queries either by string interpolation or by concatenating SQL commands with user supplied data. Therefore, injection relies on the fact that SQL statements consist of both data used by the SQL statement and commands that control how the SQL statement is executed. For example, in the SQL statement
```sql
select * from person where name = 'susan' and age = 2
```
the string '
```sql
susan
```
' is data and the fragment
```sql
and age = 2
```
is an example of a command (the value
```sql
2
```
is also data in this example).
SQL injection occurs when specially crafted user input is processed by the receiving program in a way that allows the input to exit a data context and enter a command context. This allows the attacker to alter the structure of the SQL statement which is executed.
As a simple example, imagine that the data '
```sql
susan
```
' in the above statement was provided by user input. The user entered the string '
```sql
susan
```
' (without the apostrophes) in a web form text entry field, and the program used string concatenation statements to form the above SQL statement from the three fragments
```sql
select * from person where name='
```
, the user input of '
```sql
susan
```
', and
```sql
' and age = 2
```
.
|
https://en.wikipedia.org/wiki/SQL_injection
|
As a simple example, imagine that the data '
```sql
susan
```
' in the above statement was provided by user input. The user entered the string '
```sql
susan
```
' (without the apostrophes) in a web form text entry field, and the program used string concatenation statements to form the above SQL statement from the three fragments
```sql
select * from person where name='
```
, the user input of '
```sql
susan
```
', and
```sql
' and age = 2
```
.
Now imagine that instead of entering '
```sql
susan
```
' the attacker entered
```sql
' or 1=1; --
```
.
The program will use the same string concatenation approach with the 3 fragments of
```sql
select * from person where name='
```
, the user input of
```sql
' or 1=1; --
```
, and
```sql
' and age = 2
```
and construct the statement
```sql
select * from person where name= or 1=1; --' and age = 2
```
. Many databases will ignore the text after the '--' string as this denotes a comment. The structure of the SQL command is now
```sql
select * from person where name= or 1=1;
```
and this will select all person rows rather than just those named 'susan' whose age is 2.
|
https://en.wikipedia.org/wiki/SQL_injection
|
Many databases will ignore the text after the '--' string as this denotes a comment. The structure of the SQL command is now
```sql
select * from person where name= or 1=1;
```
and this will select all person rows rather than just those named 'susan' whose age is 2. The attacker has managed to craft a data string which exits the data context and entered a command context.
## Ways to exploit
Although the root cause of all SQL injections is the same, there are different techniques to exploit it. Some of them are discussed below:
### Getting direct output or action
Imagine a program creates a SQL statement using the following string assignment command :_ BLOCK0_This SQL code is designed to pull up the records of the specified username from its table of users. However, if the "userName" variable is crafted in a specific way by a malicious user, the SQL statement may do more than the code author intended. For example, setting the "userName" variable as:
```
' OR '1'='1
```
or using comments to even block the rest of the query (there are three types of SQL comments).
|
https://en.wikipedia.org/wiki/SQL_injection
|
However, if the "userName" variable is crafted in a specific way by a malicious user, the SQL statement may do more than the code author intended. For example, setting the "userName" variable as:
```
' OR '1'='1
```
or using comments to even block the rest of the query (there are three types of SQL comments). All three lines have a space at the end:
```
' OR '1'='1' --
' OR '1'='1' {
' OR '1'='1' /*
```
renders one of the following SQL statements by the parent language:
```sql
SELECT * FROM users WHERE name = OR '1'='1';
```
```sql
SELECT * FROM users WHERE name = OR '1'='1' -- ';
```
If this code were to be used in authentication procedure then this example could be used to force the selection of every data field (*) from all users rather than from one specific user name as the coder intended, because the evaluation of '1'='1' is always true.
|
https://en.wikipedia.org/wiki/SQL_injection
|
For example, setting the "userName" variable as:
```
' OR '1'='1
```
or using comments to even block the rest of the query (there are three types of SQL comments). All three lines have a space at the end:
```
' OR '1'='1' --
' OR '1'='1' {
' OR '1'='1' /*
```
renders one of the following SQL statements by the parent language:
```sql
SELECT * FROM users WHERE name = OR '1'='1';
```
```sql
SELECT * FROM users WHERE name = OR '1'='1' -- ';
```
If this code were to be used in authentication procedure then this example could be used to force the selection of every data field (*) from all users rather than from one specific user name as the coder intended, because the evaluation of '1'='1' is always true.
The following value of "userName" in the statement below would cause the deletion of the "users" table as well as the selection of all data from the "userinfo" table (in essence revealing the information of every user), using an API that allows multiple statements:
```sql
a';
```
```sql
DROP TABLE users; SELECT * FROM userinfo WHERE 't' = 't
```
This input renders the final SQL statement as follows and specified:
```sql
SELECT * FROM users WHERE name = 'a';DROP TABLE users; SELECT * FROM userinfo WHERE 't' = 't';
```
While most SQL server implementations allow multiple statements to be executed with one call in this way, some SQL APIs such as PHP's `mysql_query()` function do not allow this for security reasons.
|
https://en.wikipedia.org/wiki/SQL_injection
|
All three lines have a space at the end:
```
' OR '1'='1' --
' OR '1'='1' {
' OR '1'='1' /*
```
renders one of the following SQL statements by the parent language:
```sql
SELECT * FROM users WHERE name = OR '1'='1';
```
```sql
SELECT * FROM users WHERE name = OR '1'='1' -- ';
```
If this code were to be used in authentication procedure then this example could be used to force the selection of every data field (*) from all users rather than from one specific user name as the coder intended, because the evaluation of '1'='1' is always true.
The following value of "userName" in the statement below would cause the deletion of the "users" table as well as the selection of all data from the "userinfo" table (in essence revealing the information of every user), using an API that allows multiple statements:
```sql
a';
```
```sql
DROP TABLE users; SELECT * FROM userinfo WHERE 't' = 't
```
This input renders the final SQL statement as follows and specified:
```sql
SELECT * FROM users WHERE name = 'a';DROP TABLE users; SELECT * FROM userinfo WHERE 't' = 't';
```
While most SQL server implementations allow multiple statements to be executed with one call in this way, some SQL APIs such as PHP's `mysql_query()` function do not allow this for security reasons. This prevents attackers from injecting entirely separate queries, but doesn't stop them from modifying queries.
|
https://en.wikipedia.org/wiki/SQL_injection
|
The following value of "userName" in the statement below would cause the deletion of the "users" table as well as the selection of all data from the "userinfo" table (in essence revealing the information of every user), using an API that allows multiple statements:
```sql
a';
```
```sql
DROP TABLE users; SELECT * FROM userinfo WHERE 't' = 't
```
This input renders the final SQL statement as follows and specified:
```sql
SELECT * FROM users WHERE name = 'a';DROP TABLE users; SELECT * FROM userinfo WHERE 't' = 't';
```
While most SQL server implementations allow multiple statements to be executed with one call in this way, some SQL APIs such as PHP's `mysql_query()` function do not allow this for security reasons. This prevents attackers from injecting entirely separate queries, but doesn't stop them from modifying queries.
### Blind SQL injection
Blind SQL injection is used when a web application is vulnerable to a SQL injection, but the results of the injection are not visible to the attacker. The page with the vulnerability may not be one that displays data but will display differently depending on the results of a logical statement injected into the legitimate SQL statement called for that page.
|
https://en.wikipedia.org/wiki/SQL_injection
|
### Blind SQL injection
Blind SQL injection is used when a web application is vulnerable to a SQL injection, but the results of the injection are not visible to the attacker. The page with the vulnerability may not be one that displays data but will display differently depending on the results of a logical statement injected into the legitimate SQL statement called for that page.
This type of attack has traditionally been considered time-intensive because a new statement needed to be crafted for each bit recovered, and depending on its structure, the attack may consist of many unsuccessful requests. Recent advancements have allowed each request to recover multiple bits, with no unsuccessful requests, allowing for more consistent and efficient extraction. There are several tools that can automate these attacks once the location of the vulnerability and the target information has been established.
#### Conditional responses
One type of blind SQL injection forces the database to evaluate a logical statement on an ordinary application screen. As an example, a book review website uses a query string to determine which book review to display. So the URL `https://books.example.com/review?id=5` would cause the server to run the query
```sql
SELECT * FROM bookreviews WHERE ID = '5';
```
from which it would populate the review page with data from the review with ID 5, stored in the table bookreviews.
|
https://en.wikipedia.org/wiki/SQL_injection
|
As an example, a book review website uses a query string to determine which book review to display. So the URL `https://books.example.com/review?id=5` would cause the server to run the query
```sql
SELECT * FROM bookreviews WHERE ID = '5';
```
from which it would populate the review page with data from the review with ID 5, stored in the table bookreviews. The query happens completely on the server; the user does not know the names of the database, table, or fields, nor does the user know the query string. The user only sees that the above URL returns a book review. A hacker can load the URLs ````sql
https://books.example.com/review?id=5' OR '1'='1
```` and ````sql
https://books.example.com/review?id=5' AND '1'='2
````, which may result in queries
```sql
SELECT * FROM bookreviews WHERE ID = '5' OR '1'='1';
SELECT * FROM bookreviews WHERE ID = '5' AND '1'='2';
```
respectively.
|
https://en.wikipedia.org/wiki/SQL_injection
|
The user only sees that the above URL returns a book review. A hacker can load the URLs ````sql
https://books.example.com/review?id=5' OR '1'='1
```` and ````sql
https://books.example.com/review?id=5' AND '1'='2
````, which may result in queries
```sql
SELECT * FROM bookreviews WHERE ID = '5' OR '1'='1';
SELECT * FROM bookreviews WHERE ID = '5' AND '1'='2';
```
respectively. If the original review loads with the "1=1" URL and a blank or error page is returned from the "1=2" URL, and the returned page has not been created to alert the user the input is invalid, or in other words, has been caught by an input test script, the site is likely vulnerable to an SQL injection attack as the query will likely have passed through successfully in both cases. The hacker may proceed with this query string designed to reveal the version number of MySQL running on the server: ````mysql
https://books.example.com/review?id=5 AND substring(@@version, 1, INSTR(@@version, '.') - 1)=4
````, which would show the book review on a server running MySQL 4 and a blank or error page otherwise.
|
https://en.wikipedia.org/wiki/SQL_injection
|
If the original review loads with the "1=1" URL and a blank or error page is returned from the "1=2" URL, and the returned page has not been created to alert the user the input is invalid, or in other words, has been caught by an input test script, the site is likely vulnerable to an SQL injection attack as the query will likely have passed through successfully in both cases. The hacker may proceed with this query string designed to reveal the version number of MySQL running on the server: ````mysql
https://books.example.com/review?id=5 AND substring(@@version, 1, INSTR(@@version, '.') - 1)=4
````, which would show the book review on a server running MySQL 4 and a blank or error page otherwise. The hacker can continue to use code within query strings to achieve their goal directly, or to glean more information from the server in hopes of discovering another avenue of attack.
### Second-order SQL injection
Second-order SQL injection occurs when an application only guards its SQL against immediate user input, but has a less strict policy when dealing with data already stored in the system. Therefore, although such application would manage to safely process the user input and store it without issue, it would store the malicious SQL statement as well. Then, when another part of that application would use that data in a query that isn't protected from SQL injection, this malicious statement might get executed. This attack requires more knowledge of how submitted values are later used.
|
https://en.wikipedia.org/wiki/SQL_injection
|
Then, when another part of that application would use that data in a query that isn't protected from SQL injection, this malicious statement might get executed. This attack requires more knowledge of how submitted values are later used. Automated web application security scanners would not easily detect this type of SQL injection and may need to be manually instructed where to check for evidence that it is being attempted.
In order to protect from this kind of attack, all SQL processing must be uniformly secure, despite the data source.
## SQL injection mitigation
SQL injection is a well-known attack that can be mitigated with established security measures. However, a 2015 cyberattack on British telecommunications company TalkTalk exploited an SQL injection vulnerability, compromising the personal data of approximately 400,000 customers. The BBC reported that security experts expressed surprise that a major company remained vulnerable to such an exploit.
A variety of defensive measures exist to mitigate SQL injection risks by preventing attackers from injecting malicious SQL code into database queries.
### Core mitigation
strategies, as outlined by OWASP, include parameterized queries, input validation, and least privilege access controls, which limit the ability of user input to alter SQL queries and execute unintended commands. In addition to preventive measures, detection techniques help identify potential SQL injection attempts.
|
https://en.wikipedia.org/wiki/SQL_injection
|
### Core mitigation
strategies, as outlined by OWASP, include parameterized queries, input validation, and least privilege access controls, which limit the ability of user input to alter SQL queries and execute unintended commands. In addition to preventive measures, detection techniques help identify potential SQL injection attempts. Methods such as pattern matching, software testing, and grammar analysis examine query structures and user inputs to detect irregularities that may indicate an injection attempt.
Core mitigation
#### Parameterized statements
Most development platforms support parameterized statements, also known as placeholders or bind variables, to securely handle user input instead of embedding it in SQL queries. These placeholders store only values of a defined type, preventing input from altering the query structure. As a result, SQL injection attempts are processed as unexpected input rather than executable code. With parametrized queries, SQL code remains separate from user input, and each parameter is passed as a distinct value, preventing it from being interpreted as part of the SQL statement.
#### Allow-list input validation
Allow-list input validation ensures that only explicitly defined inputs are accepted, reducing the risk of injection attacks. Unlike deny-lists, which attempt to block known malicious patterns but can be bypassed, allow-lists specify valid input and reject everything else.
|
https://en.wikipedia.org/wiki/SQL_injection
|
#### Allow-list input validation
Allow-list input validation ensures that only explicitly defined inputs are accepted, reducing the risk of injection attacks. Unlike deny-lists, which attempt to block known malicious patterns but can be bypassed, allow-lists specify valid input and reject everything else. This approach is particularly effective for structured data, such as dates and email addresses, where strict validation rules can be applied. While input validation alone does not prevent SQL injection and other attacks, it can act as an additional safeguard by identifying and filtering unauthorized input before it reaches an SQL query.
#### Least privilege
According to OWASP, the principle of least privilege helps mitigate SQL injection risks by ensuring database accounts have only the minimum permissions necessary. Read-only accounts should not have modification privileges, and application accounts should never have administrative access. Restricting database permissions is a key part of this approach, as limiting access to system tables and restricting user roles can reduce the risk of SQL injection attacks. Separating database users for different functions, such as authentication and data modification, further limits potential damage from SQL injection attacks.
Restricting database permissions on the web application's database login further reduces the impact of SQL injection vulnerabilities.
|
https://en.wikipedia.org/wiki/SQL_injection
|
Separating database users for different functions, such as authentication and data modification, further limits potential damage from SQL injection attacks.
Restricting database permissions on the web application's database login further reduces the impact of SQL injection vulnerabilities. Ensuring that accounts have only the necessary access, such as restricting SELECT permissions on critical system tables, can mitigate potential exploits.
On Microsoft SQL Server, limiting SELECT access to system tables can prevent SQL injection attacks that attempt to modify database schema or inject malicious scripts. For example, the following permissions restrict a database user from accessing system objects:
```tsql
deny select on sys.sysobjects to webdatabaselogon;
deny select on sys.objects to webdatabaselogon;
deny select on sys.tables to webdatabaselogon;
deny select on sys.views to webdatabaselogon;
deny select on sys.packages to webdatabaselogon;
```
### Supplementary mitigation
#### Object relational mappers
Object–relational mapping (ORM) frameworks provide an object-oriented interface for interacting with relational databases. While ORMs typically offer built-in protections against SQL injection, they can still be vulnerable if not properly implemented. Some ORM-generated queries may allow unsanitized input, leading to injection risks.
|
https://en.wikipedia.org/wiki/SQL_injection
|
While ORMs typically offer built-in protections against SQL injection, they can still be vulnerable if not properly implemented. Some ORM-generated queries may allow unsanitized input, leading to injection risks. Additionally, many ORMs allow developers to execute raw SQL queries, which if improperly handled can introduce SQL injection vulnerabilities.
### Deprecated/secondary approaches
#### String escaping
is generally discouraged as a primary defense against SQL injection. OWASP describes this approach as "frail compared to other defenses" and notes that it may not be effective in all situations. Instead, OWASP recommends using "parameterized queries, stored procedures, or some kind of Object Relational Mapper (ORM) that builds your queries for you" as more reliable methods for mitigating SQL injection risks.
String escaping
One of the traditional ways to prevent injections is to add every piece of data as a quoted string and escape all characters, that have special meaning in SQL strings, in that data. The manual for an SQL DBMS explains which characters have a special meaning, which allows creating a comprehensive blacklist of characters that need translation.
|
https://en.wikipedia.org/wiki/SQL_injection
|
String escaping
One of the traditional ways to prevent injections is to add every piece of data as a quoted string and escape all characters, that have special meaning in SQL strings, in that data. The manual for an SQL DBMS explains which characters have a special meaning, which allows creating a comprehensive blacklist of characters that need translation. For instance, every occurrence of a single quote (`'`) in a string parameter must be prepended with a backslash (`\`) so that the database understands the single quote is part of a given string, rather than its terminator.
|
https://en.wikipedia.org/wiki/SQL_injection
|
The manual for an SQL DBMS explains which characters have a special meaning, which allows creating a comprehensive blacklist of characters that need translation. For instance, every occurrence of a single quote (`'`) in a string parameter must be prepended with a backslash (`\`) so that the database understands the single quote is part of a given string, rather than its terminator. PHP's MySQLi module provides the `mysqli_real_escape_string()` function to escape strings according to MySQL semantics; in the following example the username is a string parameter, and therefore it can be protected by means of string escaping:
```php
$mysqli = new mysqli('hostname', 'db_username', 'db_password', 'db_name');
$query = sprintf("SELECT * FROM `Users` WHERE UserName='%s'",
$mysqli->real_escape_string($username),
$mysqli->query($query);
```
Besides, not every piece of data can be added to SQL as a string literal (MySQL's LIMIT clause arguments or table/column names for example) and in this case escaping string-related special characters will do no good whatsoever, leaving resulting SQL open to injections.
|
https://en.wikipedia.org/wiki/SQL_injection
|
For instance, every occurrence of a single quote (`'`) in a string parameter must be prepended with a backslash (`\`) so that the database understands the single quote is part of a given string, rather than its terminator. PHP's MySQLi module provides the `mysqli_real_escape_string()` function to escape strings according to MySQL semantics; in the following example the username is a string parameter, and therefore it can be protected by means of string escaping:
```php
$mysqli = new mysqli('hostname', 'db_username', 'db_password', 'db_name');
$query = sprintf("SELECT * FROM `Users` WHERE UserName='%s'",
$mysqli->real_escape_string($username),
$mysqli->query($query);
```
Besides, not every piece of data can be added to SQL as a string literal (MySQL's LIMIT clause arguments or table/column names for example) and in this case escaping string-related special characters will do no good whatsoever, leaving resulting SQL open to injections.
## Examples
- In February 2002, Jeremiah Jacks discovered that Guess.com was vulnerable to an SQL injection attack, permitting anyone able to construct a properly-crafted URL to pull down 200,000+ names, credit card numbers and expiration dates in the site's customer database.
- On November 1, 2005, a teenaged hacker used SQL injection to break into the site of a Taiwanese information security magazine from the Tech Target group and steal customers' information.
- On January 13, 2006, Russian computer criminals broke into a Rhode Island government website and allegedly stole credit card data from individuals who have done business online with state agencies.
-
|
https://en.wikipedia.org/wiki/SQL_injection
|
PHP's MySQLi module provides the `mysqli_real_escape_string()` function to escape strings according to MySQL semantics; in the following example the username is a string parameter, and therefore it can be protected by means of string escaping:
```php
$mysqli = new mysqli('hostname', 'db_username', 'db_password', 'db_name');
$query = sprintf("SELECT * FROM `Users` WHERE UserName='%s'",
$mysqli->real_escape_string($username),
$mysqli->query($query);
```
Besides, not every piece of data can be added to SQL as a string literal (MySQL's LIMIT clause arguments or table/column names for example) and in this case escaping string-related special characters will do no good whatsoever, leaving resulting SQL open to injections.
## Examples
- In February 2002, Jeremiah Jacks discovered that Guess.com was vulnerable to an SQL injection attack, permitting anyone able to construct a properly-crafted URL to pull down 200,000+ names, credit card numbers and expiration dates in the site's customer database.
- On November 1, 2005, a teenaged hacker used SQL injection to break into the site of a Taiwanese information security magazine from the Tech Target group and steal customers' information.
- On January 13, 2006, Russian computer criminals broke into a Rhode Island government website and allegedly stole credit card data from individuals who have done business online with state agencies.
- On September 19, 2007 and January 26, 2009 the Turkish hacker group "m0sted" used SQL injection to exploit Microsoft's SQL Server to hack web servers belonging to McAlester Army Ammunition Plant and the US Army Corps of Engineers respectively.
-
|
https://en.wikipedia.org/wiki/SQL_injection
|
## Examples
- In February 2002, Jeremiah Jacks discovered that Guess.com was vulnerable to an SQL injection attack, permitting anyone able to construct a properly-crafted URL to pull down 200,000+ names, credit card numbers and expiration dates in the site's customer database.
- On November 1, 2005, a teenaged hacker used SQL injection to break into the site of a Taiwanese information security magazine from the Tech Target group and steal customers' information.
- On January 13, 2006, Russian computer criminals broke into a Rhode Island government website and allegedly stole credit card data from individuals who have done business online with state agencies.
- On September 19, 2007 and January 26, 2009 the Turkish hacker group "m0sted" used SQL injection to exploit Microsoft's SQL Server to hack web servers belonging to McAlester Army Ammunition Plant and the US Army Corps of Engineers respectively.
- On April 13, 2008, the Sexual and Violent Offender Registry of Oklahoma shut down its website for "routine maintenance" after being informed that 10,597 Social Security numbers belonging to sex offenders had been downloaded via an SQL injection attack
- On August 17, 2009, the United States Department of Justice charged an American citizen, Albert Gonzalez, and two unnamed Russians with the theft of 130 million credit card numbers using an SQL injection attack. In reportedly "the biggest case of identity theft in American history", the man stole cards from a number of corporate victims after researching their payment processing systems.
|
https://en.wikipedia.org/wiki/SQL_injection
|
On April 13, 2008, the Sexual and Violent Offender Registry of Oklahoma shut down its website for "routine maintenance" after being informed that 10,597 Social Security numbers belonging to sex offenders had been downloaded via an SQL injection attack
- On August 17, 2009, the United States Department of Justice charged an American citizen, Albert Gonzalez, and two unnamed Russians with the theft of 130 million credit card numbers using an SQL injection attack. In reportedly "the biggest case of identity theft in American history", the man stole cards from a number of corporate victims after researching their payment processing systems. Among the companies hit were credit card processor Heartland Payment Systems, convenience store chain 7-Eleven, and supermarket chain Hannaford Brothers.
- In July 2010, a South American security researcher who goes by the handle "Ch Russo" obtained sensitive user information from popular BitTorrent site The Pirate Bay. He gained access to the site's administrative control panel and exploited an SQL injection vulnerability that enabled him to collect user account information, including IP addresses, MD5 password hashes and records of which torrents individual users have uploaded.
- From July 24 to 26, 2010, attackers from Japan and China used an SQL injection to gain access to customers' credit card data from Neo Beat, an Osaka-based company that runs a large online supermarket site. The attack also affected seven business partners including supermarket chains Izumiya Co, Maruetsu Inc, and Ryukyu Jusco Co.
|
https://en.wikipedia.org/wiki/SQL_injection
|
From July 24 to 26, 2010, attackers from Japan and China used an SQL injection to gain access to customers' credit card data from Neo Beat, an Osaka-based company that runs a large online supermarket site. The attack also affected seven business partners including supermarket chains Izumiya Co, Maruetsu Inc, and Ryukyu Jusco Co. The theft of data affected a reported 12,191 customers. As of August 14, 2010 it was reported that there have been more than 300 cases of credit card information being used by third parties to purchase goods and services in China.
- On September 19 during the 2010 Swedish general election a voter attempted a code injection by hand writing SQL commands as part of a write-in vote.
- On November 8, 2010 the British Royal Navy website was compromised by a Romanian hacker named TinKode using SQL injection.
- On April 11, 2011, Barracuda Networks was compromised using an SQL injection flaw. Email addresses and usernames of employees were among the information obtained.
- Over a period of 4 hours on April 27, 2011, an automated SQL injection attack occurred on Broadband Reports website that was able to extract 8% of the username/password pairs: 8,000 random accounts of the 9,000 active and 90,000 old or inactive accounts.
-
|
https://en.wikipedia.org/wiki/SQL_injection
|
Email addresses and usernames of employees were among the information obtained.
- Over a period of 4 hours on April 27, 2011, an automated SQL injection attack occurred on Broadband Reports website that was able to extract 8% of the username/password pairs: 8,000 random accounts of the 9,000 active and 90,000 old or inactive accounts.
- On June 1, 2011, "hacktivists" of the group LulzSec were accused of using SQL injection to steal coupons, download keys, and passwords that were stored in plaintext on Sony's website, accessing the personal information of a million users.
- In June 2011, PBS was hacked by LulzSec, most likely through use of SQL injection; the full process used by hackers to execute SQL injections was described in this Imperva blog.
- In July 2012 a hacker group was reported to have stolen 450,000 login credentials from Yahoo!. The logins were stored in plain text and were allegedly taken from a Yahoo subdomain, Yahoo! Voices. The group breached Yahoo's security by using a "union-based SQL injection technique".
- On October 1, 2012, a hacker group called "Team GhostShell" published the personal records of students, faculty, employees, and alumni from 53 universities, including Harvard, Princeton, Stanford, Cornell, Johns Hopkins, and the University of Zurich on pastebin.com.
|
https://en.wikipedia.org/wiki/SQL_injection
|
The group breached Yahoo's security by using a "union-based SQL injection technique".
- On October 1, 2012, a hacker group called "Team GhostShell" published the personal records of students, faculty, employees, and alumni from 53 universities, including Harvard, Princeton, Stanford, Cornell, Johns Hopkins, and the University of Zurich on pastebin.com. The hackers claimed that they were trying to "raise awareness towards the changes made in today's education", bemoaning changing education laws in Europe and increases in tuition in the United States.
- On November 4, 2013, hacktivist group "RaptorSwag" allegedly compromised 71 Chinese government databases using an SQL injection attack on the Chinese Chamber of International Commerce. The leaked data was posted publicly in cooperation with Anonymous.
- In August 2014, Milwaukee-based computer security company Hold Security disclosed that it uncovered a theft of confidential information from nearly 420,000 websites through SQL injections. The New York Times confirmed this finding by hiring a security expert to check the claim.
- In October 2015, an SQL injection attack was used to steal the personal details of 156,959 customers from British telecommunications company TalkTalk's servers, exploiting a vulnerability in a legacy web portal.
- In early 2021, 70 gigabytes of data was exfiltrated from the far-right website Gab through an SQL injection attack.
|
https://en.wikipedia.org/wiki/SQL_injection
|
In October 2015, an SQL injection attack was used to steal the personal details of 156,959 customers from British telecommunications company TalkTalk's servers, exploiting a vulnerability in a legacy web portal.
- In early 2021, 70 gigabytes of data was exfiltrated from the far-right website Gab through an SQL injection attack. The vulnerability was introduced into the Gab codebase by Fosco Marotto, Gab's CTO. A second attack against Gab was launched the next week using OAuth2 tokens stolen during the first attack.
- In May 2023, a widespread SQL injection attack targeted MOVEit, a widely used file-transfer service. The attacks, attributed to the Russian-speaking cybercrime group Clop, compromised multiple global organizations, including payroll provider Zellis, British Airways, the BBC, and UK retailer Boots. Attackers exploited a critical vulnerability, installing a custom webshell called "LemurLoot" to rapidly access and exfiltrate large volumes of data.
- In 2024, a pair of security researchers discovered an SQL injection vulnerability in the FlyCASS system, used by the Transportation Security Administration (TSA) to verify airline crew members. Exploiting this flaw provided unauthorized administrative access, potentially allowing the addition of false crew records. The TSA stated that its verification procedures did not solely depend on this database.
|
https://en.wikipedia.org/wiki/SQL_injection
|
Exploiting this flaw provided unauthorized administrative access, potentially allowing the addition of false crew records. The TSA stated that its verification procedures did not solely depend on this database.
## In popular culture
- A 2007 xkcd cartoon involved a character Robert'); DROP TABLE Students;-- named to carry out an SQL injection. As a result of this cartoon, SQL injection is sometimes informally referred to as "Bobby Tables".
- Unauthorized login to websites by means of SQL injection forms the basis of one of the subplots in J.K. Rowling's 2012 novel The Casual Vacancy.
- In 2014, an individual in Poland legally renamed his business to Dariusz Jakubowski x'; DROP TABLE users; SELECT '1 in an attempt to disrupt operation of spammers' harvesting bots.
- The 2015 game Hacknet has a hacking program called SQL_MemCorrupt. It is described as injecting a table entry that causes a corruption error in an SQL database, then queries said table, causing an SQL database crash and core dump.
|
https://en.wikipedia.org/wiki/SQL_injection
|
A Turing machine is a mathematical model of computation describing an abstract machine that manipulates symbols on a strip of tape according to a table of rules. Despite the model's simplicity, it is capable of implementing any computer algorithm.
The machine operates on an infinite memory tape divided into discrete cells, each of which can hold a single symbol drawn from a finite set of symbols called the alphabet of the machine. It has a "head" that, at any point in the machine's operation, is positioned over one of these cells, and a "state" selected from a finite set of states. At each step of its operation, the head reads the symbol in its cell. Then, based on the symbol and the machine's own present state, the machine writes a symbol into the same cell, and moves the head one step to the left or the right, or halts the computation. The choice of which replacement symbol to write, which direction to move the head, and whether to halt is based on a finite table that specifies what to do for each combination of the current state and the symbol that is read.
As with a real computer program, it is possible for a Turing machine to go into an infinite loop which will never halt.
The Turing machine was invented in 1936 by Alan Turing,The idea came to him in mid-1935 (perhaps, see more in the
|
https://en.wikipedia.org/wiki/Turing_machine
|
As with a real computer program, it is possible for a Turing machine to go into an infinite loop which will never halt.
The Turing machine was invented in 1936 by Alan Turing,The idea came to him in mid-1935 (perhaps, see more in the
## History
section) after a question posed by M. H. A. Newman in his lectures: "Was there a definite method, or as Newman put it, a "mechanical process" which could be applied to a mathematical statement, and which would come up with the answer as to whether it was provable" (Hodges 1983:93). Turing submitted his paper on 31 May 1936 to the London Mathematical Society for its Proceedings (cf. Hodges 1983:112), but it was published in early 1937 and offprints were available in February 1937 (cf. Hodges 1983:129). who called it an "a-machine" (automatic machine). It was Turing's doctoral advisor, Alonzo Church, who later coined the term "Turing machine" in a review. With this model, Turing was able to answer two questions in the negative:
- Does a machine exist that can determine whether any arbitrary machine on its tape is "circular" (e.g., freezes, or fails to continue its computational task)?
- Does a machine exist that can determine whether any arbitrary machine on its tape ever prints a given symbol?
|
https://en.wikipedia.org/wiki/Turing_machine
|
It was Turing's doctoral advisor, Alonzo Church, who later coined the term "Turing machine" in a review. With this model, Turing was able to answer two questions in the negative:
- Does a machine exist that can determine whether any arbitrary machine on its tape is "circular" (e.g., freezes, or fails to continue its computational task)?
- Does a machine exist that can determine whether any arbitrary machine on its tape ever prints a given symbol?
Thus by providing a mathematical description of a very simple device capable of arbitrary computations, he was able to prove properties of computation in general—and in particular, the uncomputability of the Entscheidungsproblem, or 'decision problem' (whether every mathematical statement is provable or disprovable).
Turing machines proved the existence of fundamental limitations on the power of mechanical computation.
While they can express arbitrary computations, their minimalist design makes them too slow for computation in practice: real-world computers are based on different designs that, unlike Turing machines, use random-access memory.
Turing completeness is the ability for a computational model or a system of instructions to simulate a Turing machine. A programming language that is Turing complete is theoretically capable of expressing all tasks accomplishable by computers; nearly all programming languages are Turing complete if the limitations of finite memory are ignored.
|
https://en.wikipedia.org/wiki/Turing_machine
|
Turing completeness is the ability for a computational model or a system of instructions to simulate a Turing machine. A programming language that is Turing complete is theoretically capable of expressing all tasks accomplishable by computers; nearly all programming languages are Turing complete if the limitations of finite memory are ignored.
## Overview
A Turing machine is an idealised model of a central processing unit (CPU) that controls all data manipulation done by a computer, with the canonical machine using sequential memory to store data. Typically, the sequential memory is represented as a tape of infinite length on which the machine can perform read and write operations.
In the context of formal language theory, a Turing machine (automaton) is capable of enumerating some arbitrary subset of valid strings of an alphabet. A set of strings which can be enumerated in this manner is called a recursively enumerable language. The Turing machine can equivalently be defined as a model that recognises valid input strings, rather than enumerating output strings.
Given a Turing machine M and an arbitrary string s, it is generally not possible to decide whether M will eventually produce s. This is due to the fact that the halting problem is unsolvable, which has major implications for the theoretical limits of computing.
|
https://en.wikipedia.org/wiki/Turing_machine
|
Given a Turing machine M and an arbitrary string s, it is generally not possible to decide whether M will eventually produce s. This is due to the fact that the halting problem is unsolvable, which has major implications for the theoretical limits of computing.
The Turing machine is capable of processing an unrestricted grammar, which further implies that it is capable of robustly evaluating first-order logic in an infinite number of ways. This is famously demonstrated through lambda calculus.
A Turing machine that is able to simulate any other Turing machine is called a universal Turing machine (UTM, or simply a universal machine). Another mathematical formalism, lambda calculus, with a similar "universal" nature was introduced by Alonzo Church. Church's work intertwined with Turing's to form the basis for the Church–Turing thesis. This thesis states that Turing machines, lambda calculus, and other similar formalisms of computation do indeed capture the informal notion of effective methods in logic and mathematics and thus provide a model through which one can reason about an algorithm or "mechanical procedure" in a mathematically precise way without being tied to any particular formalism. Studying the abstract properties of Turing machines has yielded many insights into computer science, computability theory, and complexity theory.
|
https://en.wikipedia.org/wiki/Turing_machine
|
This thesis states that Turing machines, lambda calculus, and other similar formalisms of computation do indeed capture the informal notion of effective methods in logic and mathematics and thus provide a model through which one can reason about an algorithm or "mechanical procedure" in a mathematically precise way without being tied to any particular formalism. Studying the abstract properties of Turing machines has yielded many insights into computer science, computability theory, and complexity theory.
### Physical description
In his 1948 essay, "Intelligent Machinery", Turing wrote that his machine consists of:
## Description
The Turing machine mathematically models a machine that mechanically operates on a tape. On this tape are symbols, which the machine can read and write, one at a time, using a tape head. Operation is fully determined by a finite set of elementary instructions such as "in state 42, if the symbol seen is 0, write a 1; if the symbol seen is 1, change into state 17; in state 17, if the symbol seen is 0, write a 1 and change to state 6;" etc. In the original article ("On Computable Numbers, with an Application to the Entscheidungsproblem", see also references below), Turing imagines not a mechanism, but a person whom he calls the "computer", who executes these deterministic mechanical rules slavishly (or as Turing puts it, "in a desultory manner").
|
https://en.wikipedia.org/wiki/Turing_machine
|
Operation is fully determined by a finite set of elementary instructions such as "in state 42, if the symbol seen is 0, write a 1; if the symbol seen is 1, change into state 17; in state 17, if the symbol seen is 0, write a 1 and change to state 6;" etc. In the original article ("On Computable Numbers, with an Application to the Entscheidungsproblem", see also references below), Turing imagines not a mechanism, but a person whom he calls the "computer", who executes these deterministic mechanical rules slavishly (or as Turing puts it, "in a desultory manner").
More explicitly, a Turing machine consists of:
- A tape divided into cells, one next to the other. Each cell contains a symbol from some finite alphabet. The alphabet contains a special blank symbol (here written as '0') and one or more other symbols. The tape is assumed to be arbitrarily extendable to the left and to the right, so that the Turing machine is always supplied with as much tape as it needs for its computation. Cells that have not been written before are assumed to be filled with the blank symbol. In some models the tape has a left end marked with a special symbol; the tape extends or is indefinitely extensible to the right.
- A head that can read and write symbols on the tape and move the tape left and right one (and only one) cell at a time.
|
https://en.wikipedia.org/wiki/Turing_machine
|
Cells that have not been written before are assumed to be filled with the blank symbol. In some models the tape has a left end marked with a special symbol; the tape extends or is indefinitely extensible to the right.
- A head that can read and write symbols on the tape and move the tape left and right one (and only one) cell at a time. In some models the head moves and the tape is stationary.
- A state register that stores the state of the Turing machine, one of finitely many. Among these is the special start state with which the state register is initialised. These states, writes Turing, replace the "state of mind" a person performing computations would ordinarily be in.
- A finite table of instructions that, given the state(qi) the machine is currently in and the symbol(aj) it is reading on the tape (the symbol currently under the head), tells the machine to do the following in sequence (for the 5-tuple models):
1. Either erase or write a symbol (replacing aj with aj1).
1. Move the head (which is described by dk and can have values: 'L' for one step left or 'R' for one step right or 'N' for staying in the same place).
1. Assume the same or a new state as prescribed (go to state qi1).
|
https://en.wikipedia.org/wiki/Turing_machine
|
1. Move the head (which is described by dk and can have values: 'L' for one step left or 'R' for one step right or 'N' for staying in the same place).
1. Assume the same or a new state as prescribed (go to state qi1).
In the 4-tuple models, erasing or writing a symbol (aj1) and moving the head left or right (dk) are specified as separate instructions. The table tells the machine to (ia) erase or write a symbol or (ib) move the head left or right, and then (ii) assume the same or a new state as prescribed, but not both actions (ia) and (ib) in the same instruction. In some models, if there is no entry in the table for the current combination of symbol and state, then the machine will halt; other models require all entries to be filled.
Every part of the machine (i.e. its state, symbol-collections, and used tape at any given time) and its actions (such as printing, erasing and tape motion) is finite, discrete and distinguishable; it is the unlimited amount of tape and runtime that gives it an unbounded amount of storage space.
|
https://en.wikipedia.org/wiki/Turing_machine
|
In some models, if there is no entry in the table for the current combination of symbol and state, then the machine will halt; other models require all entries to be filled.
Every part of the machine (i.e. its state, symbol-collections, and used tape at any given time) and its actions (such as printing, erasing and tape motion) is finite, discrete and distinguishable; it is the unlimited amount of tape and runtime that gives it an unbounded amount of storage space.
## Formal definition
Following , a (one-tape) Turing machine can be formally defined as a 7-tuple
$$
M = \langle Q, \Gamma, b, \Sigma, \delta, q_0, F \rangle
$$
where
-
$$
\Gamma
$$
is a finite, non-empty set of tape alphabet symbols;
-
$$
b \in \Gamma
$$
is the blank symbol (the only symbol allowed to occur on the tape infinitely often at any step during the computation);
-
$$
\Sigma\subseteq\Gamma\setminus\{b\}
$$
is the set of input symbols, that is, the set of symbols allowed to appear in the initial tape contents;
-
$$
Q
$$
is a finite, non-empty set of states;
-
$$
q_0 \in Q
$$
is the initial state;
-
$$
F \subseteq Q
$$
is the set of final states or accepting states.
|
https://en.wikipedia.org/wiki/Turing_machine
|
Every part of the machine (i.e. its state, symbol-collections, and used tape at any given time) and its actions (such as printing, erasing and tape motion) is finite, discrete and distinguishable; it is the unlimited amount of tape and runtime that gives it an unbounded amount of storage space.
## Formal definition
Following , a (one-tape) Turing machine can be formally defined as a 7-tuple
$$
M = \langle Q, \Gamma, b, \Sigma, \delta, q_0, F \rangle
$$
where
-
$$
\Gamma
$$
is a finite, non-empty set of tape alphabet symbols;
-
$$
b \in \Gamma
$$
is the blank symbol (the only symbol allowed to occur on the tape infinitely often at any step during the computation);
-
$$
\Sigma\subseteq\Gamma\setminus\{b\}
$$
is the set of input symbols, that is, the set of symbols allowed to appear in the initial tape contents;
-
$$
Q
$$
is a finite, non-empty set of states;
-
$$
q_0 \in Q
$$
is the initial state;
-
$$
F \subseteq Q
$$
is the set of final states or accepting states. The initial tape contents is said to be accepted by
$$
M
$$
if it eventually halts in a state from
$$
F
$$
.
-
$$
\delta: (Q \setminus F) \times \Gamma \rightharpoonup Q \times \Gamma \times \{L,R\}
$$
is a partial function called the transition function, where L is left shift, R is right shift.
|
https://en.wikipedia.org/wiki/Turing_machine
|
## Formal definition
Following , a (one-tape) Turing machine can be formally defined as a 7-tuple
$$
M = \langle Q, \Gamma, b, \Sigma, \delta, q_0, F \rangle
$$
where
-
$$
\Gamma
$$
is a finite, non-empty set of tape alphabet symbols;
-
$$
b \in \Gamma
$$
is the blank symbol (the only symbol allowed to occur on the tape infinitely often at any step during the computation);
-
$$
\Sigma\subseteq\Gamma\setminus\{b\}
$$
is the set of input symbols, that is, the set of symbols allowed to appear in the initial tape contents;
-
$$
Q
$$
is a finite, non-empty set of states;
-
$$
q_0 \in Q
$$
is the initial state;
-
$$
F \subseteq Q
$$
is the set of final states or accepting states. The initial tape contents is said to be accepted by
$$
M
$$
if it eventually halts in a state from
$$
F
$$
.
-
$$
\delta: (Q \setminus F) \times \Gamma \rightharpoonup Q \times \Gamma \times \{L,R\}
$$
is a partial function called the transition function, where L is left shift, R is right shift. If
$$
\delta
$$
is not defined on the current state and the current tape symbol, then the machine halts; intuitively, the transition function specifies the next state transited from the current state, which symbol to overwrite the current symbol pointed by the head, and the next head movement.
|
https://en.wikipedia.org/wiki/Turing_machine
|
The initial tape contents is said to be accepted by
$$
M
$$
if it eventually halts in a state from
$$
F
$$
.
-
$$
\delta: (Q \setminus F) \times \Gamma \rightharpoonup Q \times \Gamma \times \{L,R\}
$$
is a partial function called the transition function, where L is left shift, R is right shift. If
$$
\delta
$$
is not defined on the current state and the current tape symbol, then the machine halts; intuitively, the transition function specifies the next state transited from the current state, which symbol to overwrite the current symbol pointed by the head, and the next head movement.
A variant allows "no shift", say N, as a third element of the set of directions
$$
\{L,R\}
$$
.
|
https://en.wikipedia.org/wiki/Turing_machine
|
If
$$
\delta
$$
is not defined on the current state and the current tape symbol, then the machine halts; intuitively, the transition function specifies the next state transited from the current state, which symbol to overwrite the current symbol pointed by the head, and the next head movement.
A variant allows "no shift", say N, as a third element of the set of directions
$$
\{L,R\}
$$
.
The 7-tuple for the 3-state busy beaver looks like this (see more about this busy beaver at Turing machine examples):
-
$$
Q = \{ \mbox{A}, \mbox{B}, \mbox{C}, \mbox{HALT} \}
$$
(states);
-
$$
\Gamma = \{ 0, 1 \}
$$
(tape alphabet symbols);
-
$$
b = 0
$$
(blank symbol);
-
$$
\Sigma = \{ 1 \}
$$
(input symbols);
-
$$
q_0 = \mbox{A}
$$
(initial state);
-
$$
F = \{ \mbox{HALT} \}
$$
(final states);
-
$$
\delta =
$$
see state-table below (transition function).
Initially all tape cells are marked with
$$
0
$$
.
|
https://en.wikipedia.org/wiki/Turing_machine
|
The 7-tuple for the 3-state busy beaver looks like this (see more about this busy beaver at Turing machine examples):
-
$$
Q = \{ \mbox{A}, \mbox{B}, \mbox{C}, \mbox{HALT} \}
$$
(states);
-
$$
\Gamma = \{ 0, 1 \}
$$
(tape alphabet symbols);
-
$$
b = 0
$$
(blank symbol);
-
$$
\Sigma = \{ 1 \}
$$
(input symbols);
-
$$
q_0 = \mbox{A}
$$
(initial state);
-
$$
F = \{ \mbox{HALT} \}
$$
(final states);
-
$$
\delta =
$$
see state-table below (transition function).
Initially all tape cells are marked with
$$
0
$$
.
+ State table for 3-state, 2-symbol busy beaver Tape symbol Current state A Current state B Current state C Write symbol Move tape Next state Write symbol Move tape Next state Write symbol Move tape Next state 0 1 R B 1 L A 1 L B 1 1 L C 1 R B 1 R HALT
|
https://en.wikipedia.org/wiki/Turing_machine
|
A Current state B Current state C Write symbol Move tape Next state Write symbol Move tape Next state Write symbol Move tape Next state 0 1 R B 1 L A 1 L B 1 1 L C 1 R B 1 R HALT
## Additional details required to visualise or implement Turing machines
In the words of van Emde Boas (1990), p. 6: "The set-theoretical object [his formal seven-tuple description similar to the above] provides only partial information on how the machine will behave and what its computations will look like. "
For instance,
- There will need to be many decisions on what the symbols actually look like, and a failproof way of reading and writing symbols indefinitely.
- The shift left and shift right operations may shift the tape head across the tape, but when actually building a Turing machine it is more practical to make the tape slide back and forth under the head instead.
- The tape can be finite, and automatically extended with blanks as needed (which is closest to the mathematical definition), but it is more common to think of it as stretching infinitely at one or both ends and being pre-filled with blanks except on the explicitly given finite fragment the tape head is on (this is, of course, not implementable in practice).
|
https://en.wikipedia.org/wiki/Turing_machine
|
- The tape can be finite, and automatically extended with blanks as needed (which is closest to the mathematical definition), but it is more common to think of it as stretching infinitely at one or both ends and being pre-filled with blanks except on the explicitly given finite fragment the tape head is on (this is, of course, not implementable in practice). The tape cannot be fixed in length, since that would not correspond to the given definition and would seriously limit the range of computations the machine can perform to those of a linear bounded automaton if the tape was proportional to the input size, or finite-state machine if it was strictly fixed-length.
### Alternative definitions
Definitions in literature sometimes differ slightly, to make arguments or proofs easier or clearer, but this is always done in such a way that the resulting machine has the same computational power. For example, the set could be changed from
$$
\{L,R\}
$$
to
$$
\{L,R,N\}
$$
, where N ("None" or "No-operation") would allow the machine to stay on the same tape cell instead of moving left or right. This would not increase the machine's computational power.
|
https://en.wikipedia.org/wiki/Turing_machine
|
For example, the set could be changed from
$$
\{L,R\}
$$
to
$$
\{L,R,N\}
$$
, where N ("None" or "No-operation") would allow the machine to stay on the same tape cell instead of moving left or right. This would not increase the machine's computational power.
The most common convention represents each "Turing instruction" in a "Turing table" by one of nine 5-tuples, per the convention of Turing/Davis (Turing (1936) in The Undecidable, p. 126–127 and Davis (2000) p. 152):
(definition 1): (qi, Sj, Sk/E/N, L/R/N, qm)
( current state qi , symbol scanned Sj , print symbol Sk/erase E/none N , move_tape_one_square left L/right R/none N , new state qm )
Other authors (Minsky (1967) p. 119, Hopcroft and Ullman (1979) p. 158, Stone (1972)
|
https://en.wikipedia.org/wiki/Turing_machine
|
p. 119, Hopcroft and Ullman (1979) p. 158, Stone (1972) p. 9) adopt a different convention, with new state qm listed immediately after the scanned symbol Sj:
(definition 2): (qi, Sj, qm, Sk/E/N, L/R/N)
( current state qi , symbol scanned Sj , new state qm , print symbol Sk/erase E/none N , move_tape_one_square left L/right R/none N )
For the remainder of this article "definition 1" (the Turing/Davis convention) will be used.
+ Example: state table for the 3-state 2-symbol busy beaver reduced to 5-tuples Current state Scanned symbol Print symbol Move tape Final (i.e. next) state 5-tuples A 0 1 R B (A, 0, 1, R, B) A 1 1 L C (A, 1, 1, L, C) B 0 1 L A (B, 0, 1, L, A) B 1 1 R B (B, 1, 1, R, B) C 0 1 L B (C, 0, 1, L, B) C 1 1 N H (C, 1, 1, N, H)
In the following table, Turing's original model allowed only the first three lines that he called N1, N2, N3 (cf. Turing in The Undecidable, p. 126).
|
https://en.wikipedia.org/wiki/Turing_machine
|
In the following table, Turing's original model allowed only the first three lines that he called N1, N2, N3 (cf. Turing in The Undecidable, p. 126). He allowed for erasure of the "scanned square" by naming a 0th symbol S0 = "erase" or "blank", etc. However, he did not allow for non-printing, so every instruction-line includes "print symbol Sk" or "erase" (cf. footnote 12 in Post (1947), The Undecidable, p. 300). The abbreviations are Turing's (The Undecidable, p. 119). Subsequent to Turing's original paper in 1936–1937, machine-models have allowed all nine possible types of five-tuples:
Current m-configuration(Turing state) Tape symbol Print-operation Tape-motion Final m-configuration(Turing state) 5-tuple 5-tuple comments 4-tuple N1 qi Sj Print(Sk) Left L qm (qi, Sj, Sk, L, qm) "blank" = S0, 1=S1, etc. N2 qi Sj Print(Sk) Right R qm (qi, Sj, Sk, R, qm) "blank" = S0, 1=S1, etc. N3 qi Sj Print(Sk)
|
https://en.wikipedia.org/wiki/Turing_machine
|
Right R qm (qi, Sj, Sk, R, qm) "blank" = S0, 1=S1, etc. N3 qi Sj Print(Sk) qm (qi, Sj, Sk, N, qm) "blank" = S0, 1=S1, etc. (qi, Sj, Sk, qm) 4 qi Sj Left L qm (qi, Sj, N, L, qm) (qi, Sj, L, qm) 5 qi Sj Right R qm (qi, Sj, N, R, qm) (qi, Sj, R, qm) 6 qi Sj qm (qi, Sj, N, N, qm) Direct "jump" (qi, Sj, N, qm) 7 qi Sj Erase Left L qm (qi, Sj, E, L, qm) 8 qi Sj Erase Right R qm (qi, Sj, E, R, qm) 9 qi Sj Erase qm (qi, Sj, E, N, qm) (qi, Sj, E, qm)
Any Turing table (list of instructions) can be constructed from the above nine 5-tuples. For technical reasons, the three non-printing or "N" instructions (4, 5, 6) can usually be dispensed with. For examples see Turing machine examples.
|
https://en.wikipedia.org/wiki/Turing_machine
|
For technical reasons, the three non-printing or "N" instructions (4, 5, 6) can usually be dispensed with. For examples see Turing machine examples.
Less frequently the use of 4-tuples are encountered: these represent a further atomization of the Turing instructions (cf. Post (1947), Boolos & Jeffrey (1974, 1999), Davis-Sigal-Weyuker (1994)); also see more at Post–Turing machine.
### The "state"
The word "state" used in context of Turing machines can be a source of confusion, as it can mean two things. Most commentators after Turing have used "state" to mean the name/designator of the current instruction to be performed—i.e. the contents of the state register. But Turing (1936) made a strong distinction between a record of what he called the machine's "m-configuration", and the machine's (or person's) "state of progress" through the computation—the current state of the total system.
|
https://en.wikipedia.org/wiki/Turing_machine
|
Most commentators after Turing have used "state" to mean the name/designator of the current instruction to be performed—i.e. the contents of the state register. But Turing (1936) made a strong distinction between a record of what he called the machine's "m-configuration", and the machine's (or person's) "state of progress" through the computation—the current state of the total system. What Turing called "the state formula" includes both the current instruction and all the symbols on the tape:
Earlier in his paper Turing carried this even further: he gives an example where he placed a symbol of the current "m-configuration"—the instruction's label—beneath the scanned square, together with all the symbols on the tape (The Undecidable, p. 121); this he calls "the complete configuration" (The Undecidable, p. 118). To print the "complete configuration" on one line, he places the state-label/m-configuration to the left of the scanned symbol.
A variant of this is seen in Kleene (1952) where Kleene shows how to write the Gödel number of a machine's "situation": he places the "m-configuration" symbol q4 over the scanned square in roughly the center of the 6 non-blank squares on the tape (see the Turing-tape figure in this article) and puts it to the right of the scanned square.
|
https://en.wikipedia.org/wiki/Turing_machine
|
To print the "complete configuration" on one line, he places the state-label/m-configuration to the left of the scanned symbol.
A variant of this is seen in Kleene (1952) where Kleene shows how to write the Gödel number of a machine's "situation": he places the "m-configuration" symbol q4 over the scanned square in roughly the center of the 6 non-blank squares on the tape (see the Turing-tape figure in this article) and puts it to the right of the scanned square. But Kleene refers to "q4" itself as "the machine state" (Kleene, p. 374–375). Hopcroft and Ullman call this composite the "instantaneous description" and follow the Turing convention of putting the "current state" (instruction-label, m-configuration) to the left of the scanned symbol (p. 149), that is, the instantaneous description is the composite of non-blank symbols to the left, state of the machine, the current symbol scanned by the head, and the non-blank symbols to the right.
Example: total state of 3-state 2-symbol busy beaver after 3 "moves" (taken from example "run" in the figure below):
1A1
This means: after three moves the tape has ... 000110000 ...
|
https://en.wikipedia.org/wiki/Turing_machine
|
Hopcroft and Ullman call this composite the "instantaneous description" and follow the Turing convention of putting the "current state" (instruction-label, m-configuration) to the left of the scanned symbol (p. 149), that is, the instantaneous description is the composite of non-blank symbols to the left, state of the machine, the current symbol scanned by the head, and the non-blank symbols to the right.
Example: total state of 3-state 2-symbol busy beaver after 3 "moves" (taken from example "run" in the figure below):
1A1
This means: after three moves the tape has ... 000110000 ... on it, the head is scanning the right-most 1, and the state is A. Blanks (in this case represented by "0"s) can be part of the total state as shown here: B01; the tape has a single 1 on it, but the head is scanning the 0 ("blank") to its left and the state is B.
"State" in the context of Turing machines should be clarified as to which is being described: the current instruction, or the list of symbols on the tape together with the current instruction, or the list of symbols on the tape together with the current instruction placed to the left of the scanned symbol or to the right of the scanned symbol.
Turing's biographer Andrew Hodges (1983: 107) has noted and discussed this confusion.
|
https://en.wikipedia.org/wiki/Turing_machine
|
on it, the head is scanning the right-most 1, and the state is A. Blanks (in this case represented by "0"s) can be part of the total state as shown here: B01; the tape has a single 1 on it, but the head is scanning the 0 ("blank") to its left and the state is B.
"State" in the context of Turing machines should be clarified as to which is being described: the current instruction, or the list of symbols on the tape together with the current instruction, or the list of symbols on the tape together with the current instruction placed to the left of the scanned symbol or to the right of the scanned symbol.
Turing's biographer Andrew Hodges (1983: 107) has noted and discussed this confusion.
### "State" diagrams
+ The table for the 3-state busy beaver ("P" = print/write a "1") Tape symbol Current state A Current state B Current state C Write symbol Move tape Next state Write symbol Move tape Next state Write symbol Move tape Next state 0 P R B P L A P L B 1 P L C P R B P R HALT
To the right: the above table as expressed as a "state transition" diagram.
Usually large tables are better left as tables (Booth, p. 74). They are more readily simulated by computer in tabular form (Booth, p. 74).
|
https://en.wikipedia.org/wiki/Turing_machine
|
Usually large tables are better left as tables (Booth, p. 74). They are more readily simulated by computer in tabular form (Booth, p. 74). However, certain concepts—e.g. machines with "reset" states and machines with repeating patterns (cf. Hill and Peterson p. 244ff)—can be more readily seen when viewed as a drawing.
Whether a drawing represents an improvement on its table must be decided by the reader for the particular context.
The reader should again be cautioned that such diagrams represent a snapshot of their table frozen in time, not the course ("trajectory") of a computation through time and space. While every time the busy beaver machine "runs" it will always follow the same state-trajectory, this is not true for the "copy" machine that can be provided with variable input "parameters".
The diagram "progress of the computation" shows the three-state busy beaver's "state" (instruction) progress through its computation from start to finish. On the far right is the Turing "complete configuration" (Kleene "situation", Hopcroft–Ullman "instantaneous description") at each step. If the machine were to be stopped and cleared to blank both the "state register" and entire tape, these "configurations" could be used to rekindle a computation anywhere in its progress (cf. Turing (1936)
|
https://en.wikipedia.org/wiki/Turing_machine
|
If the machine were to be stopped and cleared to blank both the "state register" and entire tape, these "configurations" could be used to rekindle a computation anywhere in its progress (cf. Turing (1936) The Undecidable, pp. 139–140).
## Equivalent models
Many machines that might be thought to have more computational capability than a simple universal Turing machine can be shown to have no more power (Hopcroft and Ullman p. 159, cf. Minsky (1967)). They might compute faster, perhaps, or use less memory, or their instruction set might be smaller, but they cannot compute more powerfully (i.e. more mathematical functions). (The Church–Turing thesis hypothesises this to be true for any kind of machine: that anything that can be "computed" can be computed by some Turing machine.)
A Turing machine is equivalent to a single-stack pushdown automaton (PDA) that has been made more flexible and concise by relaxing the last-in-first-out (LIFO) requirement of its stack. In addition, a Turing machine is also equivalent to a two-stack PDA with standard LIFO semantics, by using one stack to model the tape left of the head and the other stack for the tape to the right.
|
https://en.wikipedia.org/wiki/Turing_machine
|
A Turing machine is equivalent to a single-stack pushdown automaton (PDA) that has been made more flexible and concise by relaxing the last-in-first-out (LIFO) requirement of its stack. In addition, a Turing machine is also equivalent to a two-stack PDA with standard LIFO semantics, by using one stack to model the tape left of the head and the other stack for the tape to the right.
At the other extreme, some very simple models turn out to be Turing-equivalent, i.e. to have the same computational power as the Turing machine model.
Common equivalent models are the multi-tape Turing machine, multi-track Turing machine, machines with input and output, and the non-deterministic Turing machine (NDTM) as opposed to the deterministic Turing machine (DTM) for which the action table has at most one entry for each combination of symbol and state.
Read-only, right-moving Turing machines are equivalent to DFAs (as well as NFAs by conversion using the NFA to DFA conversion algorithm).
For practical and didactic intentions, the equivalent register machine can be used as a usual assembly programming language.
A relevant question is whether or not the computation model represented by concrete programming languages is Turing equivalent. While the computation of a real computer is based on finite states and thus not capable to simulate a Turing machine, programming languages themselves do not necessarily have this limitation.
|
https://en.wikipedia.org/wiki/Turing_machine
|
A relevant question is whether or not the computation model represented by concrete programming languages is Turing equivalent. While the computation of a real computer is based on finite states and thus not capable to simulate a Turing machine, programming languages themselves do not necessarily have this limitation. Kirner et al., 2009 have shown that among the general-purpose programming languages some are Turing complete while others are not. For example, ANSI C is not Turing complete, as all instantiations of ANSI C (different instantiations are possible as the standard deliberately leaves certain behaviour undefined for legacy reasons) imply a finite-space memory. This is because the size of memory reference data types, called pointers, is accessible inside the language. However, other programming languages like Pascal do not have this feature, which allows them to be Turing complete in principle.
It is just Turing complete in principle, as memory allocation in a programming language is allowed to fail, which means the programming language can be Turing complete when ignoring failed memory allocations, but the compiled programs executable on a real computer cannot.
## Choice c-machines, oracle o-machines
Early in his paper (1936)
|
https://en.wikipedia.org/wiki/Turing_machine
|
It is just Turing complete in principle, as memory allocation in a programming language is allowed to fail, which means the programming language can be Turing complete when ignoring failed memory allocations, but the compiled programs executable on a real computer cannot.
## Choice c-machines, oracle o-machines
Early in his paper (1936) Turing makes a distinction between an "automatic machine"—its "motion ... completely determined by the configuration" and a "choice machine":
Turing (1936) does not elaborate further except in a footnote in which he describes how to use an a-machine to "find all the provable formulae of the [Hilbert] calculus" rather than use a choice machine. He "suppose[s] that the choices are always between two possibilities 0 and 1. Each proof will then be determined by a sequence of choices i1, i2, ..., in (i1 = 0 or 1, i2 = 0 or 1, ..., in = 0 or 1), and hence the number 2n + i12n-1 + i22n-2 + ... +in completely determines the proof. The automatic machine carries out successively proof 1, proof 2, proof 3, ..." (Footnote ‡, The Undecidable, p. 138)
|
https://en.wikipedia.org/wiki/Turing_machine
|
+in completely determines the proof. The automatic machine carries out successively proof 1, proof 2, proof 3, ..." (Footnote ‡, The Undecidable, p. 138)
This is indeed the technique by which a deterministic (i.e., a-) Turing machine can be used to mimic the action of a nondeterministic Turing machine; Turing solved the matter in a footnote and appears to dismiss it from further consideration.
An oracle machine or o-machine is a Turing a-machine that pauses its computation at state "o" while, to complete its calculation, it "awaits the decision" of "the oracle"—an entity unspecified by Turing "apart from saying that it cannot be a machine" (Turing (1939), The Undecidable, p. 166–168).
## Universal Turing machines
As Turing wrote in The Undecidable, p. 128 (italics added):
This finding is now taken for granted, but at the time (1936) it was considered astonishing. The model of computation that Turing called his "universal machine"—"U" for short—is considered by some (cf. Davis (2000)) to have been the fundamental theoretical breakthrough that led to the notion of the stored-program computer.
In terms of computational complexity, a multi-tape universal Turing machine need only be slower by logarithmic factor compared to the machines it simulates.
|
https://en.wikipedia.org/wiki/Turing_machine
|
Davis (2000)) to have been the fundamental theoretical breakthrough that led to the notion of the stored-program computer.
In terms of computational complexity, a multi-tape universal Turing machine need only be slower by logarithmic factor compared to the machines it simulates. This result was obtained in 1966 by F. C. Hennie and R. E. Stearns. (Arora and Barak, 2009, theorem 1.9)
## Comparison with real machines
Turing machines are more powerful than some other kinds of automata, such as finite-state machines and pushdown automata. According to the Church–Turing thesis, they are as powerful as real machines, and are able to execute any operation that a real program can. What is neglected in this statement is that, because a real machine can only have a finite number of configurations, it is nothing but a finite-state machine, whereas a Turing machine has an unlimited amount of storage space available for its computations.
There are a number of ways to explain why Turing machines are useful models of real computers:
- Anything a real computer can compute, a Turing machine can also compute. For example: "A Turing machine can simulate any type of subroutine found in programming languages, including recursive procedures and any of the known parameter-passing mechanisms" (Hopcroft and Ullman p. 157). A large enough FSA can also model any real computer, disregarding IO.
|
https://en.wikipedia.org/wiki/Turing_machine
|
For example: "A Turing machine can simulate any type of subroutine found in programming languages, including recursive procedures and any of the known parameter-passing mechanisms" (Hopcroft and Ullman p. 157). A large enough FSA can also model any real computer, disregarding IO. Thus, a statement about the limitations of Turing machines will also apply to real computers.
- The difference lies only with the ability of a Turing machine to manipulate an unbounded amount of data. However, given a finite amount of time, a Turing machine (like a real machine) can only manipulate a finite amount of data.
- Like a Turing machine, a real machine can have its storage space enlarged as needed, by acquiring more disks or other storage media.
- Descriptions of real machine programs using simpler abstract models are often much more complex than descriptions using Turing machines. For example, a Turing machine describing an algorithm may have a few hundred states, while the equivalent deterministic finite automaton (DFA) on a given real machine has quadrillions. This makes the DFA representation infeasible to analyze.
- Turing machines describe algorithms independent of how much memory they use. There is a limit to the memory possessed by any current machine, but this limit can rise arbitrarily in time.
|
https://en.wikipedia.org/wiki/Turing_machine
|
This makes the DFA representation infeasible to analyze.
- Turing machines describe algorithms independent of how much memory they use. There is a limit to the memory possessed by any current machine, but this limit can rise arbitrarily in time. Turing machines allow us to make statements about algorithms which will (theoretically) hold forever, regardless of advances in conventional computing machine architecture.
- Algorithms running on Turing-equivalent abstract machines can have arbitrary-precision data types available and never have to deal with unexpected conditions (including, but not limited to, running out of memory).
### Limitations
#### Computational complexity theory
A limitation of Turing machines is that they do not model the strengths of a particular arrangement well. For instance, modern stored-program computers are actually instances of a more specific form of abstract machine known as the random-access stored-program machine or RASP machine model. Like the universal Turing machine, the RASP stores its "program" in "memory" external to its finite-state machine's "instructions". Unlike the universal Turing machine, the RASP has an infinite number of distinguishable, numbered but unbounded "registers"—memory "cells" that can contain any integer (cf. Elgot and Robinson (1964), Hartmanis (1971), and in particular Cook-Rechow (1973); references at random-access machine).
|
https://en.wikipedia.org/wiki/Turing_machine
|
Unlike the universal Turing machine, the RASP has an infinite number of distinguishable, numbered but unbounded "registers"—memory "cells" that can contain any integer (cf. Elgot and Robinson (1964), Hartmanis (1971), and in particular Cook-Rechow (1973); references at random-access machine). The RASP's finite-state machine is equipped with the capability for indirect addressing (e.g., the contents of one register can be used as an address to specify another register); thus the RASP's "program" can address any register in the register-sequence. The upshot of this distinction is that there are computational optimizations that can be performed based on the memory indices, which are not possible in a general Turing machine; thus when Turing machines are used as the basis for bounding running times, a "false lower bound" can be proven on certain algorithms' running times (due to the false simplifying assumption of a Turing machine). An example of this is binary search, an algorithm that can be shown to perform more quickly when using the RASP model of computation rather than the Turing machine model.
#### Interaction
In the early days of computing, computer use was typically limited to batch processing, i.e., non-interactive tasks, each producing output data from given input data.
|
https://en.wikipedia.org/wiki/Turing_machine
|
An example of this is binary search, an algorithm that can be shown to perform more quickly when using the RASP model of computation rather than the Turing machine model.
#### Interaction
In the early days of computing, computer use was typically limited to batch processing, i.e., non-interactive tasks, each producing output data from given input data. Computability theory, which studies computability of functions from inputs to outputs, and for which Turing machines were invented, reflects this practice.
Since the 1970s, interactive use of computers became much more common. In principle, it is possible to model this by having an external agent read from the tape and write to it at the same time as a Turing machine, but this rarely matches how interaction actually happens; therefore, when describing interactivity, alternatives such as I/O automata are usually preferred.
## Comparison with the arithmetic model of computation
The arithmetic model of computation differs from the Turing model in two aspects:
- In the arithmetic model, every real number requires a single memory cell, whereas in the Turing model the storage size of a real number depends on the number of bits required to represent it.
-
|
https://en.wikipedia.org/wiki/Turing_machine
|
In principle, it is possible to model this by having an external agent read from the tape and write to it at the same time as a Turing machine, but this rarely matches how interaction actually happens; therefore, when describing interactivity, alternatives such as I/O automata are usually preferred.
## Comparison with the arithmetic model of computation
The arithmetic model of computation differs from the Turing model in two aspects:
- In the arithmetic model, every real number requires a single memory cell, whereas in the Turing model the storage size of a real number depends on the number of bits required to represent it.
- In the arithmetic model, every basic arithmetic operation on real numbers (addition, subtraction, multiplication and division) can be done in a single step, whereas in the Turing model the run-time of each arithmetic operation depends on the length of the operands.
Some algorithms run in polynomial time in one model but not in the other one. For example:
- The Euclidean algorithm runs in polynomial time in the Turing model, but not in the arithmetic model.
- The algorithm that reads n numbers and then computes
$$
2^{2^n}
$$
by repeated squaring runs in polynomial time in the Arithmetic model, but not in the Turing model.
|
https://en.wikipedia.org/wiki/Turing_machine
|
For example:
- The Euclidean algorithm runs in polynomial time in the Turing model, but not in the arithmetic model.
- The algorithm that reads n numbers and then computes
$$
2^{2^n}
$$
by repeated squaring runs in polynomial time in the Arithmetic model, but not in the Turing model. This is because the number of bits required to represent the outcome is exponential in the input size.
However, if an algorithm runs in polynomial time in the arithmetic model, and in addition, the binary length of all involved numbers is polynomial in the length of the input, then it is always polynomial-time in the Turing model. Such an algorithm is said to run in strongly polynomial time.
History
### Historical background: computational machinery
Robin Gandy (1919–1995)—a student of Alan Turing (1912–1954), and his lifelong friend—traces the lineage of the notion of "calculating machine" back to Charles Babbage (circa 1834) and actually proposes "Babbage's Thesis":
Gandy's analysis of Babbage's analytical engine describes the following five operations (cf. p. 52–53):
1. The arithmetic functions +, −, ×, where − indicates "proper" subtraction: if .
1. Any sequence of operations is an operation.
1.
|
https://en.wikipedia.org/wiki/Turing_machine
|
Any sequence of operations is an operation.
1. Iteration of an operation (repeating n times an operation P).
1. Conditional iteration (repeating n times an operation P conditional on the "success" of test T).
1. Conditional transfer (i.e., conditional "goto").
Gandy states that "the functions which can be calculated by (1), (2), and (4) are precisely those which are Turing computable." (p. 53). He cites other proposals for "universal calculating machines" including those of Percy Ludgate (1909), Leonardo Torres Quevedo (1914),Torres Quevedo. L. (1915). "Essais sur l'Automatique - Sa définition. Etendue théorique de ses applications", Revue Génerale des Sciences Pures et Appliquées, vol. 2, pp. 601–611. Maurice d'Ocagne (1922), Louis Couffignal (1933), Vannevar Bush (1936), Howard Aiken (1937). However:
### The Entscheidungsproblem (the "decision problem"): Hilbert's tenth question of 1900
With regard to Hilbert's problems posed by the famous mathematician David Hilbert in 1900, an aspect of problem #10 had been floating about for almost 30 years before it was framed precisely.
|
https://en.wikipedia.org/wiki/Turing_machine
|
### The Entscheidungsproblem (the "decision problem"): Hilbert's tenth question of 1900
With regard to Hilbert's problems posed by the famous mathematician David Hilbert in 1900, an aspect of problem #10 had been floating about for almost 30 years before it was framed precisely. Hilbert's original expression for No. 10 is as follows:
By 1922, this notion of "Entscheidungsproblem" had developed a bit, and H. Behmann stated that
By the 1928 international congress of mathematicians, Hilbert "made his questions quite precise. First, was mathematics complete ... Second, was mathematics consistent ... And thirdly, was mathematics decidable?" (Hodges p. 91, Hawking p. 1121). The first two questions were answered in 1930 by Kurt Gödel at the very same meeting where Hilbert delivered his retirement speech (much to the chagrin of Hilbert); the third—the Entscheidungsproblem—had to wait until the mid-1930s.
The problem was that an answer first required a precise definition of "definite general applicable prescription", which Princeton professor Alonzo Church would come to call "effective calculability", and in 1928 no such definition existed.
|
https://en.wikipedia.org/wiki/Turing_machine
|
The first two questions were answered in 1930 by Kurt Gödel at the very same meeting where Hilbert delivered his retirement speech (much to the chagrin of Hilbert); the third—the Entscheidungsproblem—had to wait until the mid-1930s.
The problem was that an answer first required a precise definition of "definite general applicable prescription", which Princeton professor Alonzo Church would come to call "effective calculability", and in 1928 no such definition existed. But over the next 6–7 years Emil Post developed his definition of a worker moving from room to room writing and erasing marks per a list of instructions (Post 1936), as did Church and his two students Stephen Kleene and J. B. Rosser by use of Church's lambda-calculus and Gödel's recursion theory (1934). Church's paper (published 15 April 1936) showed that the Entscheidungsproblem was indeed "undecidable" and beat Turing to the punch by almost a year (Turing's paper submitted 28 May 1936, published January 1937). In the meantime, Emil Post submitted a brief paper in the fall of 1936, so Turing at least had priority over Post. While Church refereed Turing's paper, Turing had time to study Church's paper and add an Appendix where he sketched a proof that Church's lambda-calculus and his machines would compute the same functions.
|
https://en.wikipedia.org/wiki/Turing_machine
|
In the meantime, Emil Post submitted a brief paper in the fall of 1936, so Turing at least had priority over Post. While Church refereed Turing's paper, Turing had time to study Church's paper and add an Appendix where he sketched a proof that Church's lambda-calculus and his machines would compute the same functions.
And Post had only proposed a definition of calculability and criticised Church's "definition", but had proved nothing.
### Alan Turing's a-machine
In the spring of 1935, Turing as a young Master's student at King's College, Cambridge, took on the challenge; he had been stimulated by the lectures of the logician M. H. A. Newman "and learned from them of Gödel's work and the Entscheidungsproblem ... Newman used the word 'mechanical' ... In his obituary of Turing 1955 Newman writes:
Gandy states that:
While Gandy believed that Newman's statement above is "misleading", this opinion is not shared by all. Turing had a lifelong interest in machines: "Alan had dreamt of inventing typewriters as a boy; [his mother] Mrs. Turing had a typewriter; and he could well have begun by asking himself what was meant by calling a typewriter 'mechanical'" (Hodges p. 96).
|
https://en.wikipedia.org/wiki/Turing_machine
|
In his obituary of Turing 1955 Newman writes:
Gandy states that:
While Gandy believed that Newman's statement above is "misleading", this opinion is not shared by all. Turing had a lifelong interest in machines: "Alan had dreamt of inventing typewriters as a boy; [his mother] Mrs. Turing had a typewriter; and he could well have begun by asking himself what was meant by calling a typewriter 'mechanical'" (Hodges p. 96). While at Princeton pursuing his PhD, Turing built a Boolean-logic multiplier (see below). His PhD thesis, titled "Systems of Logic Based on Ordinals", contains the following definition of "a computable function":
Alan Turing invented the "a-machine" (automatic machine) in 1936. Turing submitted his paper on 31 May 1936 to the London Mathematical Society for its Proceedings (cf. Hodges 1983:112), but it was published in early 1937 and offprints were available in February 1937 (cf. Hodges 1983:129) It was Turing's doctoral advisor, Alonzo Church, who later coined the term "Turing machine" in a review.
|
https://en.wikipedia.org/wiki/Turing_machine
|
Hodges 1983:129) It was Turing's doctoral advisor, Alonzo Church, who later coined the term "Turing machine" in a review. With this model, Turing was able to answer two questions in the negative:
- Does a machine exist that can determine whether any arbitrary machine on its tape is "circular" (e.g., freezes, or fails to continue its computational task)?
- Does a machine exist that can determine whether any arbitrary machine on its tape ever prints a given symbol?
Thus by providing a mathematical description of a very simple device capable of arbitrary computations, he was able to prove properties of computation in general—and in particular, the uncomputability of the Entscheidungsproblem ('decision problem').
When Turing returned to the UK he ultimately became jointly responsible for breaking the German secret codes created by encryption machines called "The Enigma"; he also became involved in the design of the ACE (Automatic Computing Engine), "[Turing's] ACE proposal was effectively self-contained, and its roots lay not in the EDVAC [the USA's initiative], but in his own universal machine" (Hodges p. 318). Arguments still continue concerning the origin and nature of what has been named by Kleene (1952) Turing's Thesis.
|
https://en.wikipedia.org/wiki/Turing_machine
|
Arguments still continue concerning the origin and nature of what has been named by Kleene (1952) Turing's Thesis. But what Turing did prove with his computational-machine model appears in his paper "On Computable Numbers, with an Application to the Entscheidungsproblem" (1937):
Turing's example (his second proof): If one is to ask for a general procedure to tell us: "Does this machine ever print 0", the question is "undecidable".
### 1937–1970: The "digital computer", the birth of "computer science"
In 1937, while at Princeton working on his PhD thesis, Turing built a digital (Boolean-logic) multiplier from scratch, making his own electromechanical relays (Hodges p. 138). "Alan's task was to embody the logical design of a Turing machine in a network of relay-operated switches ..." (Hodges p. 138). While Turing might have been just initially curious and experimenting, quite-earnest work in the same direction was going in Germany (Konrad Zuse (1938)), and in the United States (Howard Aiken) and George Stibitz (1937); the fruits of their labors were used by both the Axis and Allied militaries in World War II (cf. Hodges p. 298–299).
|
https://en.wikipedia.org/wiki/Turing_machine
|
While Turing might have been just initially curious and experimenting, quite-earnest work in the same direction was going in Germany (Konrad Zuse (1938)), and in the United States (Howard Aiken) and George Stibitz (1937); the fruits of their labors were used by both the Axis and Allied militaries in World War II (cf. Hodges p. 298–299). In the early to mid-1950s Hao Wang and Marvin Minsky reduced the Turing machine to a simpler form (a precursor to the Post–Turing machine of Martin Davis); simultaneously European researchers were reducing the new-fangled electronic computer to a computer-like theoretical object equivalent to what was now being called a "Turing machine". In the late 1950s and early 1960s, the coincidentally parallel developments of Melzak and Lambek (1961), Minsky (1961), and Shepherdson and Sturgis (1961) carried the European work further and reduced the Turing machine to a more friendly, computer-like abstract model called the counter machine; Elgot and Robinson (1964), Hartmanis (1971), Cook and Reckhow (1973) carried this work even further with the register machine and random-access machine models—but basically all are just multi-tape Turing machines with an arithmetic-like instruction set.
|
https://en.wikipedia.org/wiki/Turing_machine
|
In the early to mid-1950s Hao Wang and Marvin Minsky reduced the Turing machine to a simpler form (a precursor to the Post–Turing machine of Martin Davis); simultaneously European researchers were reducing the new-fangled electronic computer to a computer-like theoretical object equivalent to what was now being called a "Turing machine". In the late 1950s and early 1960s, the coincidentally parallel developments of Melzak and Lambek (1961), Minsky (1961), and Shepherdson and Sturgis (1961) carried the European work further and reduced the Turing machine to a more friendly, computer-like abstract model called the counter machine; Elgot and Robinson (1964), Hartmanis (1971), Cook and Reckhow (1973) carried this work even further with the register machine and random-access machine models—but basically all are just multi-tape Turing machines with an arithmetic-like instruction set.
### 1970–present: as a model of computation
Today, the counter, register and random-access machines and their sire the Turing machine continue to be the models of choice for theorists investigating questions in the theory of computation. In particular, computational complexity theory makes use of the Turing machine:
|
https://en.wikipedia.org/wiki/Turing_machine
|
Graphemics or graphematics is the linguistic study of writing systems and their basic components, i.e. graphemes.
At the beginning of the development of this area of linguistics, Ignace Gelb coined the term grammatology for this discipline; later some scholars suggested calling it graphology to match phonology, but that name is traditionally used for a pseudo-science. Others therefore suggested renaming the study of language-dependent pronunciation phonemics or phonematics instead, but this did not gain widespread acceptance either, so the terms graphemics and graphematics became more frequent.
Graphemics examines the specifics of written texts in a certain language and their correspondence to the spoken language. One major task is the descriptive analysis of implicit regularities in written words and texts (graphotactics) to formulate explicit rules (orthography) for the writing system that can be used in prescriptive education or in computer linguistics, e.g. for speech synthesis.
In analogy to phoneme and (allo)phone in phonology, the graphic units of language are graphemes, i.e. language-specific characters, and graphs, i.e. language-specific glyphs.
|
https://en.wikipedia.org/wiki/Graphemics
|
One major task is the descriptive analysis of implicit regularities in written words and texts (graphotactics) to formulate explicit rules (orthography) for the writing system that can be used in prescriptive education or in computer linguistics, e.g. for speech synthesis.
In analogy to phoneme and (allo)phone in phonology, the graphic units of language are graphemes, i.e. language-specific characters, and graphs, i.e. language-specific glyphs. Different schools of thought consider different entities to be graphemes; major points of divergence are the handling of punctuation, diacritic marks, digraphs or other multigraphs and non-alphabetic scripts.
Analogous to phonetics, the "etic" counterpart of graphemics is called graphetics and deals with the material side only (including paleography, typography and graphology).
## Grammatology
The term 'grammatology was first promoted in English by linguist Ignace Gelb in his 1952 book A Study of Writing. The equivalent word is recorded in German and French use long before then. Grammatology can examine the typology of scripts, the analysis of the structural properties of scripts, and the relationship between written and spoken language.
|
https://en.wikipedia.org/wiki/Graphemics
|
The equivalent word is recorded in German and French use long before then. Grammatology can examine the typology of scripts, the analysis of the structural properties of scripts, and the relationship between written and spoken language. In its broadest sense, some scholars also include the study of literacy in grammatology and, indeed, the impact of writing on philosophy, religion, science, administration and other aspects of the organization of society.
Historian Bruce Trigger associates grammatology with cultural evolution.
## Graphotactics
Graphotactics refers to rules which restrict the allowable sequences of letters in alphabetic languages. A common example is the partially correct "I before E except after C". However, there are exceptions, for example Edward Carney in his book, A Survey of English Spelling, refers to the "I before E except after C” rule instead as an example of a “phonotactic rule”.
Graphotactical rules are useful in error detection by optical character recognition systems.
In studies of Old English, "graphotactics" is also used to refer to the variable-length spacing between words.
## Toronto School of communication theory
The scholars most immediately associated with grammatology, understood as the history and theory of writing, include Eric Havelock (The Muse Learns to Write), Walter J. Ong (Orality and Literacy), Jack Goody (Domestication of the Savage Mind), and Marshall McLuhan (The Gutenberg Galaxy).
|
https://en.wikipedia.org/wiki/Graphemics
|
In studies of Old English, "graphotactics" is also used to refer to the variable-length spacing between words.
## Toronto School of communication theory
The scholars most immediately associated with grammatology, understood as the history and theory of writing, include Eric Havelock (The Muse Learns to Write), Walter J. Ong (Orality and Literacy), Jack Goody (Domestication of the Savage Mind), and Marshall McLuhan (The Gutenberg Galaxy). Grammatology brings to any topic a consideration of the contribution of technology and the material and social apparatus of language. A more theoretical treatment of the approach may be seen in the works of Friedrich Kittler (Discourse Networks: 1800/1900) and Avital Ronell (The Telephone Book).
## Structuralism and Deconstruction
Swiss linguist Ferdinand de Saussure, who is considered to be a key figure in structural approaches to language, saw speech and writing as 'two distinct systems of signs' with the second having 'the sole purpose of representing the first.', a view further explained in Peter Barry's the Beginning Theory. In the 1960s, with the writings Roland Barthes and Jacques Derrida, critiques have been put forth to this proposed relation.
In 1967, Jacques Derrida borrowed the term, but put it to different use, in his book Of Grammatology.
|
https://en.wikipedia.org/wiki/Graphemics
|
In the 1960s, with the writings Roland Barthes and Jacques Derrida, critiques have been put forth to this proposed relation.
In 1967, Jacques Derrida borrowed the term, but put it to different use, in his book Of Grammatology. Derrida aimed to show that writing is not simply a reproduction of speech, but that the way in which thoughts are recorded in writing strongly affects the nature of knowledge. Deconstruction from a grammatological perspective places the history of philosophy in general, and metaphysics in particular, in the context of writing as such. In this perspective metaphysics is understood as a category or classification system relative to the invention of alphabetic writing and its institutionalization in School. Plato's Academy, and Aristotle's Lyceum, are as much a part of the invention of literacy as is the introduction of the vowel to create the Classical Greek alphabet. Gregory Ulmer took up this trajectory, from historical to philosophical grammatology, to add applied grammatology (Applied Grammatology: Post(e)-Pedagogy from Jacques Derrida to Joseph Beuys, Johns Hopkins, 1985). Ulmer coined the term "electracy" to call attention to the fact that digital technologies and their elaboration in new media forms are part of an apparatus that is to these inventions what literacy is to alphabetic and print technologies.
|
https://en.wikipedia.org/wiki/Graphemics
|
The electromagnetic wave equation is a second-order partial differential equation that describes the propagation of electromagnetic waves through a medium or in a vacuum. It is a three-dimensional form of the wave equation. The homogeneous form of the equation, written in terms of either the electric field or the magnetic field , takes the form:
$$
\begin{align}
\left(v_{\mathrm{ph}}^2\nabla^2 - \frac{\partial^2}{\partial t^2} \right) \mathbf{E} &= \mathbf{0} \\
\left(v_{\mathrm{ph}}^2\nabla^2 - \frac{\partial^2}{\partial t^2} \right) \mathbf{B} &= \mathbf{0}
\end{align}
$$
where
$$
v_{\mathrm{ph}} = \frac{1}{\sqrt {\mu\varepsilon}}
$$
is the speed of light (i.e. phase velocity) in a medium with permeability , and permittivity , and is the Laplace operator. In a vacuum, , a fundamental physical constant. The electromagnetic wave equation derives from Maxwell's equations.
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.