Taxonomy/supplement/Multiple semantics

Uit Werkplaats
Ga naar: navigatie, zoeken

The semantics of a →formal language maps expressions unambiguously into some mathematical space. A language can have multiple semantics.

Example

Here are some examples for what in a formal language the expression

3*4

could 'mean':

  • the product of 3 and 4, viz.
mult(3, 4) WHERE mult := ...

Note that that is not the same as the number 7. In a specification, the customer may want to see the 3 and the 4 because she can relate these to the original problem, while she does not necessarily unterstand what the number 7 has to do with it.

  • the result of this multiplication: the natural numer 7, viz.
0'''''''
  • the bit pattern:
00000000000000000000000000000111

in a 32 bit computer

  • the machine program obtained by assembling:
PUSH 3; PUSH 4; MULT
  • the blueprint of a circuit feeding some representation of the numbers 3 and 4 into a multiplication chip, viz.:
   +----+
 3-|    |
   |mult|---
 4-|    |
   +----+