Higher-order Abstract Syntax - Relation To First-order Abstract Syntax

Relation To First-order Abstract Syntax

An abstract syntax tree is abstract because it is a mathematical object that has certain structure by its very nature. For instance, in first-order abstract syntax (FOAS) trees, as commonly used in compilers, the tree structure implies the subexpression relation, meaning that no parentheses are required to disambiguate programs (as they are in the concrete syntax). HOAS exposes additional structure: the relationship between variables and their binding sites. In FOAS representations, a variable is typically represented with an identifier, with the relation between binding site and use being indicated by using the same identifier. With HOAS, there is no name for the variable; each use of the variable refers directly to the binding site.

There are a number of reasons why this technique is useful. First, it makes the binding structure of a program explicit: just as there is no need to explain operator precedence in a FOAS representation, there is no need to have the rules of binding and scope at hand to interpret a HOAS representation. Second, programs that are alpha-equivalent (differing only in the names of bound variables) have identical representations in HOAS, which can make equivalence checking more efficient.

Read more about this topic:  Higher-order Abstract Syntax

Famous quotes containing the words relation to, relation and/or abstract:

    In relation to God, we are like a thief who has burgled the house of a kindly householder and been allowed to keep some of the gold. From the point of view of the lawful owner this gold is a gift; From the point of view of the burglar it is a theft. He must go and give it back. It is the same with our existence. We have stolen a little of God’s being to make it ours. God has made us a gift of it. But we have stolen it. We must return it.
    Simone Weil (1909–1943)

    There is undoubtedly something religious about it: everyone believes that they are special, that they are chosen, that they have a special relation with fate. Here is the test: you turn over card after card to see in which way that is true. If you can defy the odds, you may be saved. And when you are cleaned out, the last penny gone, you are enlightened at last, free perhaps, exhilarated like an ascetic by the falling away of the material world.
    Andrei Codrescu (b. 1947)

    Some ghosts are women,
    neither abstract nor pale,
    their breasts as limp as killed fish.
    Anne Sexton (1928–1974)