Glossary

Index

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 

V

Index


Variable

Context

A term in Prolog.

Short definition

A variable is a name we give to a memory storage location within the computer for the purpose of holding a piece of data whose value is unknown when we write the variable.

This is a quick definition, and it leaves much to be desired in terms of depth. The rest of this entry will attempt to fill in the gaps.

Longer definition

When we say "variable", we mean one of two things:

  1. We can mean "variable name", e.g., "X". That is, a string of characters that make up a name. This name identifies the variable (in the next sense).

  2. We can mean the memory storage location that holds the value that the variable name stands for.

Thus the term "variable" is ambiguous: It can either mean the name of a variable or the memory storage location which the name refers to.

A variable is a term just like string constants and structures. This means that anywhere you can use a term, you can use a variable (except as a complete head).

Variables can either be free or bound. Variables can also share the same value.


Variable binding

Context

A term in Prolog.

Definition

A variable can either be free or bound. A bound variable is a variable that has been given a value.

A variable binding is a specification of a variable name and the value to which the variable is bound. For example, the following is a variable binding:

{X = name(Nick)}


A B C D E F G H I J K L M N O P Q R S T U V W X Y Z