Friday, April 19, 2013

some terminology for discussing programming languages

Abstraction : an immutable value that can be be referenced but not changed. In applicative languages, all values are abstractions. In languages with objects (which includes slots), an expression that references an abstraction can change, but only by being modified to reference a different abstraction. The abstraction itself does not change. This is in contrast to an object which can change while remaining the very same object. Numbers and other mathematical objects are typical abstractions. Queues and other dynamic data structures are typical objects

Active Slot: a slot that can cause a state change when dereferenced or can cause a state change when updated other than simply changing the current value in the slot.

Aliasing: the situation when two or more variables denote the same slot

Constant: a name that denotes a fixed value --that is, not a slot. For a constant, the denotation and reference are the same.

Constraint: a proposition that must be satisfied. A type declaration is the typical kind of constraint. Pre-conditions, post-conditions, and compiler-checked invariants are also constraints. Constraints can be used as a form of redundancy to help ensure program correctness and can also be used to optimize execution. In logic programming languages, the entire program is a constraint and the process of finding a way to satisfy the constraint is the execution of the program.

Denotation: The entity that a name or other expression represents. For a constant, the denotation of the name is the constant value. For a traditional variable, the denotation is a slot which can take on different values over the course of the program. In this case we say that the name denotes the slot but references the value in the slot.

Declaration: A phrase that introduces a constraint.

Definition: A phrase that introduces a name into a namespace and specifies its denotation.

Entity: a language thing that can be denoted by a name or other syntactic construct but may not be a value. Typical non-value entities include types, state changes and slots. In some languages, functions are non-value entities. Entities are divided into two main categories: abstractions and objects, depending on whether they are immutable or mutable.

Expression: a phrase that represents a value.

Object: a mutable entity –an entity that can change over the the course of a program while remaining the same entity. For example, if a set has operations to insert and delete from the set then it is an object. A set that is fixed and unchangeable would be an abstraction rather than an object

Phrase: a program fragment that forms a syntactic unit. For example in C, "x=3" is a phrase because it forms a complete syntactic unit but "x=" is not, because it is an incomplete fragment of syntax. Declarations, definitions, expressions, and statements are types of phrase.

Reference: the value that an expression references. If an expression denotes a value then it also references that value. If it denotes a slot, then it references the object in the slot. If it denotes some other entity that is not a value, then it has no reference. Typically operations and function calls act on the references of their operands or parameters

Signature: the type of an expression. Signature is a statically determined restriction on the types of values that an expression can evaluate to.

Slot: a special object that can be updated to take on different values dynamically. An expression that denotes a slot is said to reference the value in the slot. Slots are entities but not values.

Sort: the type of a value. A sort consists of a set of possibly values and set of basic operations on those values. The base class of an object is its sort, as is the primitive type of a scalar value.

State Change: A change in the world represented by the program. Specifically, a change in one or more objects of the program because only objects can change. Machine level changes such as assignment of intermediate results to registers or the advance of the program counter do not count as state changes within the program.

Statement: a phrase that represents a state change.

Type: a set of values and allowed operations on those values. Sorts, signatures, and classes are all types.

Value: an entity that can be the reference of an expression, passed as a parameter to function, and returned by a function. Slots cannot be values. The value of an expression is the value referenced by the expression.

Variable: a name that can change its reference over the course of a program. Not all variables can be updated. For example, the formal parameters of a function are variables even if they cannot be changed during a given call. They are variables because they take on different values for different calls.

No comments:

Post a Comment