Programs
General

Comments
Constants
Exceptions
Execution Environments
Identifiers
Relaxations
Spacing
T-Tables
Text
Variables

Lines
Expressions
Types
Operators
Binary Arithmetic Operators
Boolean Operators
Conversion Operators
Relational Operators
Structural Operators
Unary Arithmetic Operators

Literals
Comments
Constants
Exceptions
Execution Environments
Identifiers
Relaxations
Spacing
T-Tables
Text
Variables

Lines
Expressions
Types
Operators
Binary Arithmetic Operators
Boolean Operators
Conversion Operators
Relational Operators
Structural Operators
Unary Arithmetic Operators

Literals
A T-Table sets up each step of the evaluation of an expression. The left-hand-side column holds the current version of the expression according to its current evaluation progress. The right-hand-side holds the operation and assignment of the current step.

The table is called a T-Table because each step assigns a variable starting with a t, short for *temporary*.

The list in operation column is called the *T-Form* of the expression.

The following is the T-Table for the arithmetic expression `x^2 + 5*x`

.

Expression | Operation |
---|---|

`x^2 + 5*x` | |

`t1 + 5*x` | `t1 = x ^ 2` |

`t1 + t2` | `t2 = 5 * x` |

`t3` | `t3 = t1 + t2` |

Thus, the T-Form of `x^2 + 5*x`

is

```
t1 = x ^ 2
t2 = 5 * x
t3 = t1 + t2
```

The algorithm for creating a T-Form from an expression is the *automatic programming algorithm*.

It is possible to convert back and forth between an expression and its T-Form. This can be set up in a reverse T-Table.

The reverse T-Table of

```
t1 = x ^ 2
t2 = 5 * x
t3 = t1 + t2
```

is

Expression | Operation |
---|---|

`t3` | `t3 = t1 + t2` |

`t1 + t2` | `t2 = 5 * x` |

`t1 + 5*x` | `t1 = x ^ 2` |

`x^2 + 5*x` |

The expression is

`x^2 + 5*x`

If an expression constains a parenthesis that is added for readability, the paranthesis can be preserved using an assignment without an operator.

`a + (b*c)`

:

Expression | Operation |
---|---|

`a + (b*c)` | |

`a + (t1)` | `t1 = b*c` |

`a + t2` | `t2 = t1` |

`t3` | `t3 = a + t2` |

The assignment to t2 is interpreted as a parenthesis.

We would be more than happy to help you. Our opening hours are 9–15 (CET).

📞 (+47) 93 68 22 77

Nils Bays vei 50, 0876 Oslo, Norway

Copyright © 2018-22 progsbase.com by Inductive AS.