Metraipolis › archive › dc_726123bdc232
Abstract semantic graph — Wikipedia (en)
- Source
- Wikipedia (en)
- Original
- https://en.wikipedia.org/wiki/Abstract_semantic_graph
- License (as archived)
- CC-BY-SA-4.0
- Archived
- 2026-11-07T08:36:26.051Z
- SHA-256 of the archived text
5c9a93c09867339cf4050eef6eac4b0a4f0d88f2bb3e65e58d1e311ce097ac79- Stable URL of this page
https://metraipolis.com/documento/dc_726123bdc232
How to cite
Abstract semantic graph — Wikipedia (en) — Wikipedia (en), https://en.wikipedia.org/wiki/Abstract_semantic_graph (CC-BY-SA-4.0); archived copy: https://metraipolis.com/documento/dc_726123bdc232 (Metraipolis archive dc_726123bdc232, sha256 5c9a93c09867339cf4050eef6eac4b0a4f0d88f2bb3e65e58d1e311ce097ac79)
BibTeX
@misc{dc726123bdc232,
title = {Abstract semantic graph — Wikipedia (en)},
howpublished = {Wikipedia (en)},
url = {https://en.wikipedia.org/wiki/Abstract_semantic_graph},
note = {License CC-BY-SA-4.0; archived copy https://metraipolis.com/documento/dc_726123bdc232; sha256 5c9a93c09867339cf4050eef6eac4b0a4f0d88f2bb3e65e58d1e311ce097ac79},
year = {2026}
}Archived text
Reproduced under CC-BY-SA-4.0. Attribution: Wikipedia (en), https://en.wikipedia.org/wiki/Abstract_semantic_graph. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
In computer science, an abstract semantic graph (ASG) or term graph is a form of abstract syntax in which an expression of a formal or programming language is represented by a graph whose vertices are the expression's subterms. An ASG is at a higher level of abstraction than an abstract syntax tree (or AST), which is used to express the syntactic structure of an expression or program. ASGs are more complex and concise than ASTs because they may contain shared subterms (also known as "common subexpressions"). Abstract semantic graphs are often used as an intermediate representation by compilers to store the results of performing common subexpression elimination upon abstract syntax trees. ASTs are trees and are thus incapable of representing shared terms. ASGs are usually directed acyclic graphs (DAG), although in some applications graphs containing cycles may be permitted. For example, a graph containing a cycle might be used to represent the recursive expressions that are commonly used in functional programming languages as non-looping iteration constructs. The mutability of these types of graphs, is studied in the field of graph rewriting. The nomenclature term graph is associated with the field of term graph rewriting, which involves the transformation and processing of expressions by the specification of rewriting rules, whereas abstract semantic graph is used when discussing linguistics, programming languages, type systems and compilation. Abstract syntax trees are not capable of sharing subexpression nodes because it is not possible for a node in a proper tree to have more than one parent. Although this conceptual simplicity is appealing, it may come at the cost of redundant representation and, in turn, possibly inefficiently duplicating the computation of identical terms. For this reason ASGs are often used as an intermediate language at a subsequent compilation stage to abstract syntax tree construction via parsing. An abstract semantic graph is typically constructed from an abstract syntax tree by a process of enrichment and abstraction. The enrichment can for example be the addition of back-pointers, edges from an identifier node (where a variable is being used) to a node representing the declaration of that variable. The abstraction can entail the removal of details which are relevant only in parsing, not for semantics. Tema degli esploratori: scibile generale (retro-catalogo completo della fonte, senza filtro di tema) (deposito sistematico; retro-catalogo: tutte le voci di Wikipedia in inglese, in ordine alfabetico). Fonte: Wikipedia in inglese, voce «Abstract semantic graph» — https://en.wikipedia.org/wiki/Abstract_semantic_graph Wikidata Q3514616: «form of abstract syntax in which an expression of a language is represented by a graph whose vertices are the expression's subterms» (dati Wikidata in CC0 1.0) — https://www.wikidata.org/wiki/Q3514616 Autori: i contributori di Wikipedia (cronologia: https://en.wikipedia.org/wiki/Abstract_semantic_graph?action=history). Licenza: Creative Commons Attribuzione-Condividi allo stesso modo 4.0 (CC BY-SA 4.0) — https://creativecommons.org/licenses/by-sa/4.0/. Il riuso richiede attribuzione e stessa licenza. Estratto dell'introduzione non modificato nel contenuto; revisione 1380221218, consultata il 2026-11-07T08:32:12.425Z tramite l'API ufficiale di Wikipedia. Impronta SHA-256 dell'estratto: 37ff17a43645a76f627464e364b303948d2d6b0b7689b69d55502b03bebe91be