Draft:Ampersand Language

Ampersand is a specification language that focuses on information systems. Its main purpose is to generate information systems correctly by minimizing the human effort and human mistakes involved in programming.

Ampersand is an instance of constraint programming or Invariant-based programming. After specifying a data set structurally as a set of relations, the programmer asserts  constraints on that data set (Ampersand uses the keyword RULE to specify constraints). Each constraint serves as an invariant on the data set, to be kept satisfied throughout time. The programmer writes invariants only. For this reason, the programmer perceives this as specifying rather than programming, even though the compiler generates working software from an Ampersand script. The compiler generates all the code needed to execute the specification.

To specify relations together with constraints is equivalent to specifying an ontology, which is useful to specify a  domain formally. An Ampersand user specifies her constraints in relation algebra, which makes Ampersand suitable for automated theorem proving and program analysis.

On top of the relations and invariants, the programmer specifies interfaces that define the functionality of the system.

The Ampersand compiler is available as free open-source software to generate a working application from a specification. This compiler generates web applications and documentation.

Ampersand has been used in practice both in education and industry (Ordina and TNO-ICT). For example, Ordina designed a proof-of-concept in 2007 of the INDIGO-system. This design was based on Ampersand, to obtain correct, detailed results in the least amount of time. Today INDIGO is used as the core information system of the Dutch immigration authority, IND. More recently, Ampersand was used to design an information system called DTV for the Dutch Food Authority, NVWA. A prototype of DTV was built in Ampersand and was used as a model to build the actual system. TNO-ICT, a major Dutch industrial research laboratory, is using Ampersand for research purposes. For example, TNO-ICT did a study of international standardization efforts such as RBAC (Role-based access control) in 2003 and architecture IEEE 1471-2000 in 2004. TNO-ICT has also used the technique in conceiving several patents, e.g. patents DE60218042D, WO2006126875, EP1727327, WO2004046848, EP1563361, NL1023394C, EP1420323, WO03007571, and NL1013450C. The most elaborate information systems in production, generated by Ampersand, are in the Semantic Treehouse Project.

At the Open University of the Netherlands, Ampersand is being taught in a course called Rule-Based Design. In this course, students use a platform called RAP, which has been built in Ampersand. RAP is the first ever Ampersand generated application that has run in production.

Key features
Declarative
 * Ampersand is free of side effects. So, users can add, update, or delete any rule in the code without affecting other rules, which makes rules composable. (Opposite: imperative programming) As a consequence, the order of statements does not affect the meaning of an Ampersand script.

Reactive
 * Ampersand is a reactive specification language. It does not follow pre-specified threads of action but reacts to events from outside and inside the system. Reactive programming sets Ampersand apart from single-threaded and  multi-threaded computing.

Statically typed
 * The word static refers to type checking at compile-time. The type system of Ampersand presents errors at compile time as type errors, saving modelers' effort and enhancing the quality of the generated code Static type checking is the opposite of dynamic type checking, which is typically done at runtime. Ampersand is related to the business rules approach . However, Ampersand uses constraints for more than decision-making only. A difference with many other constraint-based languages is the use of relation algebra rather than  predicate logic.

Relation Algebra
 * Ampersand is based on Relation Algebra (also known as the Calculus of Relations) to ensure that business rules can be defined precisely and that a compiler can generate an information system. The language uses relation algebra in constraints to specify invariants. It also uses relation algebra in interfaces to specify which data is displayed in interface fields.

Composable
 * The schemas of two different Ampersand applications can be combined to get a new (composed) application. Ampersand allows its users to solve individual problems in separate efforts, and use composability to put everything together in the end.

Scientific foundations of Ampersand  have been verified, peer-reviewed and published in the International Conference on Relational and Algebraic Methods in Computer Science (RAMiCS) and in the Journal of Logic and Algebraic Methods in Programming (JLAMP) from 2011 onwards.