ⓘ ATS (programming language)
ATS is a programming language designed to unify programming with formal specification. ATS has support for combining theorem proving with practical programming through the use of advanced type systems. A past version of The Computer Language Benchmarks Game has demonstrated that the performance of ATS is comparable to that of the C and C++ programming languages. By using theorem proving and strict type checking, the compiler can detect and prove that its implemented functions are not susceptible to bugs such as division by zero, memory leaks, buffer overflow, and other forms of memory corruption by verifying pointer arithmetic and reference counting before the program compiles. Additionally, by using the integrated theoremproving system of ATS, the programmer may make use of static constructs that are intertwined with the operative code to prove that a function attains its specification.
1. History
ATS is derived mostly from the ML and OCaml programming languages. An earlier language, Dependent ML, by the same author has been incorporated by the language.
The latest version of ATS1 Anairiats was released as v0.2.12 on 20150120. The first version of ATS2 Postiats was released in September 2013.
2. Theorem proving
The primary focus of ATS is to support theorem proving in combination with practical programming. With theorem proving one can prove, for instance, that an implemented function does not produce memory leaks. It also prevents other bugs that might otherwise only be found during testing. It incorporates a system similar to those of proof assistants which usually only aim to verify mathematical proofs  except ATS uses this ability to prove that the implementations of its functions operate correctly, and produce the expected output.
As a simple example, in a function using division, the programmer may prove that the divisor will never equal zero, preventing a division by zero error. Lets say, the divisor X was computed as 5 times the length of list A. One can prove, that in the case of a nonempty list, X is nonzero, since X is the product of two nonzero numbers 5 and the length of A. A more practical example would be proving through reference counting that the retain count on an allocated block of memory is being counted correctly for each pointer. Then one can know, and quite literally prove, that the object will not be deallocated prematurely, and that memory leaks will not occur.
The benefit of the ATS system is that since all theorem proving occurs strictly within the compiler, it has no effect on the speed of the executable program. ATS code is often harder to compile than standard C code, but once it compiles the programmer can be certain that it is running correctly to the degree specified by their proofs assuming the compiler and runtime system are correct.
In ATS proofs are separate from implementation, so it is possible to implement a function without proving it if the programmer so desires.
3. Data representation
According to the author Hongwei Xi, ATSs efficiency is largely due to the way that data is represented in the language and tailcall optimizations which are generally important for the efficiency of functional programming languages. Data can be stored in a flat or unboxed representation rather than a boxed representation.
4.1. Theorem Proving: An introductory case Propositions
dataprop expresses predicates as algebraic types.
Predicates in pseudo‑code somewhat similar to ATS source see below for valid ATS source:
FACTn, r iff factn = r MULn, m, prod iff n * m = prod FACTn, r = FACT0, 1  FACTn, r iff FACTn1, r1 and MULn, r1, r // for n > 0 // expresses factn = r iff r = n * r1 and r1 = factn1In ATS code:
where FACT int, int is a proof type
4.2. Theorem Proving: An introductory case Example
Non tailrecursive factorial with proposition or "Theorem" proving through the construction dataprop.
The evaluation of fact1n1 returns a pair proof_n_minus_1  result_of_n_minus_1 which is used in the calculation of fact1n. The proofs express the predicates of the proposition.
4.3. Theorem Proving: An introductory case Part 1 algorithm and propositions
existential quantification. . proof  value. flat tuple or variadic function parameters tuple. termination metric5. Features
Basic types
 int literals: 255, 0377, 0xFF, unary minus as ~ as in ML
 double
 char a
 bool true, false
 string "abc"
Tuples and records
prefix or none means direct, flat or unboxed allocation prefix means indirect or boxed allocation specialWith  as separator, some functions return wrapped the result value with an evaluation of predicates
val predicate_proofs  values = myfunct paramsCommon
{.} universal quantification 0 p_bufSee val and var declarations

Oberon (programming language) 

Swift (programming language) 

C (programming language) 

Alice (programming language) 

List of programming languages by type 

PHP 

ABC (programming language) 

AMPL 
APL (programming language) 

Arc (programming language) 

CPL (programming language) 

Chapel (programming language) 
Clarion (programming language) 

Cobra (programming language) 

Curl (programming language) 

Cyclone (programming language) 

D (programming language) 

Dylan (programming language) 

E (programming language) 

Elixir (programming language) 

Elm (programming language) 

Euphoria (programming language) 

Factor (programming language) 

Hack (programming language) 

Hope (programming language) 

Icon (programming language) 

Idris (programming language) 

J (programming language) 

Joy (programming language) 

Julia (programming language) 

K (programming language) 
Magik (programming language) 

Mercury (programming language) 

Orwell (programming language) 

Oxygene (programming language) 
Pyrex (programming language) 

R (programming language) 
IBM RPG 

Racket (programming language) 

Red (programming language) 

Rust (programming language) 

S (programming language) 
SASL (programming language) 

Scala (programming language) 

Shakespeare Programming Language 

Snap! (programming language) 

Tea (programming language) 

Wolfram Language 

X10 (programming language) 

Film 

Television show 

Game 

Sport 

Science 

Hobby 

Travel 

Technology 

Brand 

Outer space 

Cinematography 

Photography 

Music 

Literature 

Theatre 

History 

Transport 

Visual arts 

Recreation 

Politics 

Religion 

Nature 

Fashion 

Subculture 

Animation 

Award 

Interest 