Circumscription (logic): Difference between revisions
en>JonRichfield m →See also: Added to See also |
en>Addbot m Bot: Migrating 1 interwiki links, now provided by Wikidata on d:q5121755 |
||
Line 1: | Line 1: | ||
{{No footnotes|date=August 2010}} | |||
In [[computer science]], '''higher-order abstract syntax''' (abbreviated '''HOAS''') is a technique for the representation of [[abstract syntax trees]] for languages with variable [[name binding|binders]]. | |||
==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 [[compiler]]s, 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 | |||
[[lambda calculus|alpha-equivalent]] (differing only in the names of bound variables) have identical representations in HOAS, which can make equivalence checking more efficient. <!-- other uses? --> | |||
==Implementation== | |||
One mathematical object that could be used to implement HOAS is a [[graph (mathematics)|graph]] where variables are associated with their binding sites via [[edge (graph theory)|edges]]. Another popular way to implement HOAS (in, for example, compilers) is with [[de Bruijn index|de Bruijn indices]]. | |||
==Use in logical frameworks== | |||
In the domain of [[logical framework]]s, the term higher-order abstract syntax is usually used to refer to a specific representation that uses the binders of the [[metalanguage|meta-language]] to encode the binding structure of the [[object language]]. | |||
For instance, the logical framework [[LF (logical framework)|LF]] has a λ-construct, which has arrow | |||
(→) type. A first-order encoding of an object language construct <code>let</code> would be (using [[Twelf]] | |||
syntax): | |||
exp : type. | |||
var : type. | |||
v : var -> exp. | |||
let : exp -> var -> exp -> exp. | |||
Here, <code>exp</code> is the family of object language expressions. The family <code>var</code> is the representation of variables (implemented perhaps as natural numbers, which is not shown); the constant <code>v</code> witnesses the fact that variables are expressions. The constant <code>let</code> is an expression that takes three arguments: an expression (that is being bound), a variable (that it is bound to) and another expression (that the variable is bound within). | |||
The [[canonical form|canonical]] HOAS representation of the same object language would be: | |||
exp : type. | |||
let : exp -> (exp -> exp) -> exp. | |||
In this representation, object level variables do not appear explicitly. The constant <code>let</code> takes an expression (that is being bound) and a meta-level function <code>exp</code> → <code>exp</code> | |||
(the body of the let). This function is the ''higher-order'' part: an expression with a free variable is | |||
represented as an expression with ''holes'' that are filled in by the meta-level function when applied. As a concrete example, we would construct the object level expression | |||
let x = 1 + 2 | |||
in x + 3 | |||
(assuming the natural constructors for numbers and addition) using the HOAS signature above as | |||
let (plus 1 2) ([y] plus y 3) | |||
where <code>[y] e</code> is Twelf's syntax for the function <math>\lambda y.e</math>. | |||
This specific representation has advantages beyond the ones above: for one, by reusing the meta-level notion of binding, the encoding enjoys properties such as type-preserving ''substitution'' without the need to define/prove them. In this way using HOAS can drastically reduce the amount of [[boilerplate code]] having to do with binding in an encoding. | |||
Higher-order abstract syntax is generally only applicable when object language variables can be understood as variables in the mathematical sense (that is, as stand-ins for arbitrary members of some domain). This is often, but not always, the case: for instance, there are no advantages to be gained from a HOAS encoding of [[scope (programming)#Dynamic scoping|dynamic scope]] as it appears in some dialects of [[Lisp programming language|Lisp]] because dynamically scoped variables do not act like mathematical variables. | |||
<!-- to-do: history? --> | |||
== See also == | |||
* [[Generalized algebraic data type]] | |||
* [[Parametric higher-order abstract syntax]] (PHOAS) | |||
== References == | |||
* {{cite conference | |||
| author = Dale Miller and Gopalan Nadathur | |||
| year = 1987 | |||
| title = A Logic Programming Approach to Manipulating Formulas and Programs | |||
| url = http://www.lix.polytechnique.fr/Labo/Dale.Miller/papers/slp87.pdf | |||
| booktitle = IEEE Symposium on Logic Programming | |||
| pages = 379–388 | |||
}} | |||
* {{cite conference | |||
| author = [[Frank Pfenning]], Conal Elliott | |||
| year = 1988 | |||
| title = Higher-order abstract syntax | |||
| url = http://www.cs.cmu.edu/~fp/papers/pldi88.pdf | |||
| booktitle = Proceedings of the [[Association for Computing Machinery|ACM]] [[SIGPLAN]] [[PLDI]] '88 | |||
| pages = 199–208 | |||
| doi = 10.1145/53990.54010 | |||
| id = ISBN 0-89791-269-1 | |||
}} | |||
* {{cite journal | |||
| author = J. Despeyroux, A. Felty, A. Hirschowitz | |||
| year = 1995 | |||
| title = Higher-Order Abstract Syntax in Coq | |||
| url = http://www.site.uottawa.ca/~afelty/dist/tlca95.ps | |||
| journal = [[Lecture Notes in Computer Science]] | |||
| volume = 902 | |||
| pages = 124–138 | |||
| id = ISBN 3-540-59048-X | |||
| doi = 10.1007/BFb0014049 | |||
}} | |||
* {{cite conference | |||
| author = Martin Hofmann | |||
| year = 1999 | |||
| title = Semantical analysis of higher-order abstract syntax | |||
| url = http://www.tcs.informatik.uni-muenchen.de/~mhofmann/lics99hoas.ps.gz | |||
| booktitle = 14th Annual [[IEEE Symposium on Logic in Computer Science]] | |||
| pages = 204 | |||
| id = ISBN 0-7695-0158-3 | |||
}} | |||
* {{cite conference | |||
| author = Dale Miller | |||
| year = 2000 | |||
| title = Abstract Syntax for Variable Binders: An Overview | |||
| url = http://www.lix.polytechnique.fr/Labo/Dale.Miller/papers/ltrees.pdf | |||
| booktitle = Computational Logic - {CL} 2000 | |||
| pages = 239–253 | |||
}} | |||
* {{cite conference | |||
| author = Eli Barzilay, Stuart Allen | |||
| title = Reflecting Higher-Order Abstract Syntax in Nuprl | |||
| url = http://www.barzilay.org/misc/hoas-paper.pdf | |||
| booktitle = [[Theorem Proving in Higher-Order Logics]] 2002 | |||
| year = 2002 | |||
| pages = 23–32 | |||
| id = ISBN 3-540-44039-9 | |||
}} | |||
* {{cite conference | |||
| author = Eli Barzilay | |||
| year = 2006 | |||
| title = A Self-Hosting Evaluator using HOAS | |||
| url = http://scheme2006.cs.uchicago.edu/15-barzilay.pdf | |||
| booktitle = [[International Conference on Functional Programming|ICFP]] Workshop on Scheme and Functional Programming 2006 | |||
}} | |||
{{DEFAULTSORT:Higher-Order Abstract Syntax}} | |||
[[Category:Type theory]] | |||
[[Category:Logic programming]] | |||
[[Category:Dependently typed programming]] | |||
[[Category:Programming language theory]] |
Revision as of 16:36, 14 March 2013
Template:No footnotes In computer science, higher-order abstract syntax (abbreviated HOAS) is a technique for the representation of abstract syntax trees for languages with variable binders.
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.
Implementation
One mathematical object that could be used to implement HOAS is a graph where variables are associated with their binding sites via edges. Another popular way to implement HOAS (in, for example, compilers) is with de Bruijn indices.
Use in logical frameworks
In the domain of logical frameworks, the term higher-order abstract syntax is usually used to refer to a specific representation that uses the binders of the meta-language to encode the binding structure of the object language.
For instance, the logical framework LF has a λ-construct, which has arrow
(→) type. A first-order encoding of an object language construct let
would be (using Twelf
syntax):
exp : type. var : type. v : var -> exp. let : exp -> var -> exp -> exp.
Here, exp
is the family of object language expressions. The family var
is the representation of variables (implemented perhaps as natural numbers, which is not shown); the constant v
witnesses the fact that variables are expressions. The constant let
is an expression that takes three arguments: an expression (that is being bound), a variable (that it is bound to) and another expression (that the variable is bound within).
The canonical HOAS representation of the same object language would be:
exp : type. let : exp -> (exp -> exp) -> exp.
In this representation, object level variables do not appear explicitly. The constant let
takes an expression (that is being bound) and a meta-level function exp
→ exp
(the body of the let). This function is the higher-order part: an expression with a free variable is
represented as an expression with holes that are filled in by the meta-level function when applied. As a concrete example, we would construct the object level expression
let x = 1 + 2 in x + 3
(assuming the natural constructors for numbers and addition) using the HOAS signature above as
let (plus 1 2) ([y] plus y 3)
where [y] e
is Twelf's syntax for the function .
This specific representation has advantages beyond the ones above: for one, by reusing the meta-level notion of binding, the encoding enjoys properties such as type-preserving substitution without the need to define/prove them. In this way using HOAS can drastically reduce the amount of boilerplate code having to do with binding in an encoding.
Higher-order abstract syntax is generally only applicable when object language variables can be understood as variables in the mathematical sense (that is, as stand-ins for arbitrary members of some domain). This is often, but not always, the case: for instance, there are no advantages to be gained from a HOAS encoding of dynamic scope as it appears in some dialects of Lisp because dynamically scoped variables do not act like mathematical variables.
See also
References
- 55 years old Systems Administrator Antony from Clarence Creek, really loves learning, PC Software and aerobics. Likes to travel and was inspired after making a journey to Historic Ensemble of the Potala Palace.
You can view that web-site... ccleaner free download - 55 years old Systems Administrator Antony from Clarence Creek, really loves learning, PC Software and aerobics. Likes to travel and was inspired after making a journey to Historic Ensemble of the Potala Palace.
You can view that web-site... ccleaner free download - One of the biggest reasons investing in a Singapore new launch is an effective things is as a result of it is doable to be lent massive quantities of money at very low interest rates that you should utilize to purchase it. Then, if property values continue to go up, then you'll get a really high return on funding (ROI). Simply make sure you purchase one of the higher properties, reminiscent of the ones at Fernvale the Riverbank or any Singapore landed property Get Earnings by means of Renting
In its statement, the singapore property listing - website link, government claimed that the majority citizens buying their first residence won't be hurt by the new measures. Some concessions can even be prolonged to chose teams of consumers, similar to married couples with a minimum of one Singaporean partner who are purchasing their second property so long as they intend to promote their first residential property. Lower the LTV limit on housing loans granted by monetary establishments regulated by MAS from 70% to 60% for property purchasers who are individuals with a number of outstanding housing loans on the time of the brand new housing purchase. Singapore Property Measures - 30 August 2010 The most popular seek for the number of bedrooms in Singapore is 4, followed by 2 and three. Lush Acres EC @ Sengkang
Discover out more about real estate funding in the area, together with info on international funding incentives and property possession. Many Singaporeans have been investing in property across the causeway in recent years, attracted by comparatively low prices. However, those who need to exit their investments quickly are likely to face significant challenges when trying to sell their property – and could finally be stuck with a property they can't sell. Career improvement programmes, in-house valuation, auctions and administrative help, venture advertising and marketing, skilled talks and traisning are continuously planned for the sales associates to help them obtain better outcomes for his or her shoppers while at Knight Frank Singapore. No change Present Rules
Extending the tax exemption would help. The exemption, which may be as a lot as $2 million per family, covers individuals who negotiate a principal reduction on their existing mortgage, sell their house short (i.e., for lower than the excellent loans), or take part in a foreclosure course of. An extension of theexemption would seem like a common-sense means to assist stabilize the housing market, but the political turmoil around the fiscal-cliff negotiations means widespread sense could not win out. Home Minority Chief Nancy Pelosi (D-Calif.) believes that the mortgage relief provision will be on the table during the grand-cut price talks, in response to communications director Nadeam Elshami. Buying or promoting of blue mild bulbs is unlawful.
A vendor's stamp duty has been launched on industrial property for the primary time, at rates ranging from 5 per cent to 15 per cent. The Authorities might be trying to reassure the market that they aren't in opposition to foreigners and PRs investing in Singapore's property market. They imposed these measures because of extenuating components available in the market." The sale of new dual-key EC models will even be restricted to multi-generational households only. The models have two separate entrances, permitting grandparents, for example, to dwell separately. The vendor's stamp obligation takes effect right this moment and applies to industrial property and plots which might be offered inside three years of the date of buy. JLL named Best Performing Property Brand for second year running
The data offered is for normal info purposes only and isn't supposed to be personalised investment or monetary advice. Motley Fool Singapore contributor Stanley Lim would not personal shares in any corporations talked about. Singapore private home costs increased by 1.eight% within the fourth quarter of 2012, up from 0.6% within the earlier quarter. Resale prices of government-built HDB residences which are usually bought by Singaporeans, elevated by 2.5%, quarter on quarter, the quickest acquire in five quarters. And industrial property, prices are actually double the levels of three years ago. No withholding tax in the event you sell your property. All your local information regarding vital HDB policies, condominium launches, land growth, commercial property and more
There are various methods to go about discovering the precise property. Some local newspapers (together with the Straits Instances ) have categorised property sections and many local property brokers have websites. Now there are some specifics to consider when buying a 'new launch' rental. Intended use of the unit Every sale begins with 10 p.c low cost for finish of season sale; changes to 20 % discount storewide; follows by additional reduction of fiftyand ends with last discount of 70 % or extra. Typically there is even a warehouse sale or transferring out sale with huge mark-down of costs for stock clearance. Deborah Regulation from Expat Realtor shares her property market update, plus prime rental residences and houses at the moment available to lease Esparina EC @ Sengkang - 55 years old Systems Administrator Antony from Clarence Creek, really loves learning, PC Software and aerobics. Likes to travel and was inspired after making a journey to Historic Ensemble of the Potala Palace.
You can view that web-site... ccleaner free download - 55 years old Systems Administrator Antony from Clarence Creek, really loves learning, PC Software and aerobics. Likes to travel and was inspired after making a journey to Historic Ensemble of the Potala Palace.
You can view that web-site... ccleaner free download - 55 years old Systems Administrator Antony from Clarence Creek, really loves learning, PC Software and aerobics. Likes to travel and was inspired after making a journey to Historic Ensemble of the Potala Palace.
You can view that web-site... ccleaner free download - 55 years old Systems Administrator Antony from Clarence Creek, really loves learning, PC Software and aerobics. Likes to travel and was inspired after making a journey to Historic Ensemble of the Potala Palace.
You can view that web-site... ccleaner free download