> For the complete documentation index, see [llms.txt](https://ampersandtarski.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ampersandtarski.gitbook.io/documentation/the-language-ampersand/syntactical-conventions/the-table-statement.md).

# The TABLE statement

## Disclaimer

This statement will be available in Ampersand vs. 4.

## Purpose

This statement provides syntactic sugar for defining tabular information conveniently. It introduces a number of relations and rules in a single statement, to simplify a script.

## Syntax

```
`TABLE` <Concept> `(` (<term> `:` <Concept> <Multiplicities>?)* `)`
```

where:

* `<label>` is the name of the rule. It can be a single word or a string (enclosed by double brackets). It is followed by a colon (`:`) to distinguish the label from the concept that follows.
* `<Concept>` is the name of the Concept for atoms of which the rule specifies an identity
* Between brackets are terms whose source concept must be `<Concept>`. This is enforced by the type system.

## Semantics by example

```
TABLE  C (e1:C1, e2:C2)
```

translates into the following declarations:

```
RELATION E1[C*C1]
RELATION E2[C*C2]
```

Multiplicity annotations are allowed. For example:

```
TABLE  C (e1:C1[UNI,TOT], e2:C2, e3:C[ASY], ...)
```

translates into the following declarations:

```
RELATION E1[C*C1] [UNI,TOT]
RELATION E2[C*C2]
RELATION E3[C*C] [ASY]
...
```

## Practice

This statement makes nice combinations with the IDENT statement. For example to define two identities for persons:

```
TABLE Person(name:String, ssn:SSN, birthplace:City, birthdate:Date)
IDENT Person(ssn)
IDENT Person(name,birthplace,birthdate)
```

This states that a person is uniquely defined by `ssn`, but also by the combination of `name`, `birthplace`, and `birthdate`. This statement can also be used to objectify (reify) an term `e`

```
TABLE T(pi:P, rho:R)
IDENT T(pi,rho)
RULE "Create T" : e |- pi~;rho
RULE "Delete T" : pi~;rho |- e
```

If a user is tempted to replace the Create/Delete pair with a single equivalence, this becomes:

```
TABLE T(pi:P, rho:R)
IDENT T(pi,rho)
RULE e = pi~;rho
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ampersandtarski.gitbook.io/documentation/the-language-ampersand/syntactical-conventions/the-table-statement.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
