Broadly speaking, denotational semantics is concerned with finding mathematical objects called domains that represent what programs do. For example, programs (or program phrases) might be represented by partial functions[1][2] or by games[3] between the environment and the system.
An important tenet of denotational semantics is that semantics should be compositional: the denotation of a program phrase should be built out of the denotations of its subphrases.
Historical development
Denotational semantics originated in the work of Christopher Strachey and Dana Scott published in the early 1970s.[1][2] As originally developed by Strachey and Scott, denotational semantics provided the meaning of a computer program as a function that mapped input into output.[2] To give meanings to recursively defined programs, Scott proposed working with continuous functions between domains, specifically complete partial orders. As described below, work has continued in investigating appropriate denotational semantics for aspects of programming languages such as sequentiality, concurrency, non-determinism and local state.
Denotational semantics has been developed for modern programming languages that use capabilities like concurrency and exceptions, e.g., Concurrent ML,[4]CSP,[5] and Haskell.[6] The semantics of these languages is compositional in that the meaning of a phrase depends on the meanings of its subphrases. For example, the meaning of the applicative expressionf(E1,E2) is defined in terms of semantics of its subphrases f, E1 and E2. In a modern programming language, E1 and E2 can be evaluated concurrently and the execution of one of them might affect the other by interacting through shared objects causing their meanings to be defined in terms of each other. Also, E1 or E2 might throw an exception which could terminate the execution of the other one. The sections below describe special cases of the semantics of these modern programming languages.
Meanings of recursive programs
Denotational semantics is ascribed to a program phrase as a function from an environment (holding current values of its free variables) to its denotation. For example, the phrase n*m produces a denotation when provided with an environment that has binding for its two free variables: n and m. If in the environment n has the value 3 and m has the value 5, then the denotation is 15.[2]
A function can be represented as a set of ordered pairs of argument and corresponding result values. For example, the set {(0,1), (4,3)} denotes a function with result 1 for argument 0, result 3 for the argument 4, and undefined otherwise.
Consider for example the factorial function, which might be defined recursively as:
To provide a meaning for this recursive definition, the denotation is built up as the limit of approximations, where each approximation limits the number of calls to factorial. At the beginning, we start with no calls - hence nothing is defined. In the next approximation, we can add the ordered pair (0,1), because this doesn't require calling factorial again. Similarly we can add (1,1), (2,2), etc., adding one pair each successive approximation because computing factorial(n) requires n+1 calls. In the limit we get a total function from to defined everywhere in its domain.
Formally we model each approximation as a partial function. Our approximation is then repeatedly applying a function implementing "make a more defined partial factorial function", i.e. , starting with the empty function (empty set). F could be defined in code as follows (using Map<int,int> for ):
Then we can introduce the notation Fn to indicate F applied n times.
F0({}) is the totally undefined partial function, represented as the set {};
F1({}) is the partial function represented as the set {(0,1)}: it is defined at 0, to be 1, and undefined elsewhere;
F5({}) is the partial function represented as the set {(0,1), (1,1), (2,2), (3,6), (4,24)}: it is defined for arguments 0,1,2,3,4.
This iterative process builds a sequence of partial functions from to . Partial functions form a chain-complete partial order using ⊆ as the ordering. Furthermore, this iterative process of better approximations of the factorial function forms an expansive (also called progressive) mapping because each using ⊆ as the ordering. So by a fixed-point theorem (specifically Bourbaki–Witt theorem), there exists a fixed point for this iterative process.
In this case, the fixed point is the least upper bound of this chain, which is the full factorial function, which can be expressed as the union
The fixed point we found is the least fixed point of F, because our iteration started with the smallest element in the domain (the empty set). To prove this we need a more complex fixed point theorem such as the Knaster–Tarski theorem.
Denotational semantics of non-deterministic programs
The concept of power domains has been developed to give a denotational semantics to non-deterministic sequential programs. Writing P for a power-domain constructor, the domain P(D) is the domain of non-deterministic computations of type denoted by D.
There are difficulties with fairness and unboundedness in domain-theoretic models of non-determinism.[7]
Denotational semantics of concurrency
Many researchers have argued that the domain-theoretic models given above do not suffice for the more general case of concurrent computation. For this reason various new models have been introduced. In the early 1980s, people began using the style of denotational semantics to give semantics for concurrent languages. Examples include Will Clinger's work with the actor model; Glynn Winskel's work with event structures and Petri nets;[8] and the work by Francez, Hoare, Lehmann, and de Roever (1979) on trace semantics for CSP.[9] All these lines of inquiry remain under investigation (see e.g. the various denotational models for CSP[5]).
Recently, Winskel and others have proposed the category of profunctors as a domain theory for concurrency.[10][11]
Denotational semantics of state
State (such as a heap) and simple imperative features can be straightforwardly modeled in the denotational semantics described above. The key idea is to consider a command as a partial function on some domain of states. The meaning of "x:=3" is then the function that takes a state to the state with 3 assigned to x. The sequencing operator ";" is denoted by composition of functions. Fixed-point constructions are then used to give a semantics to looping constructs, such as "while".
Things become more difficult in modelling programs with local variables. One approach is to no longer work with domains, but instead to interpret types as functors from some category of worlds to a category of domains. Programs are then denoted by natural continuous functions between these functors.[12][13]
Denotations of data types
Many programming languages allow users to define recursive data types. For example, the type of lists of numbers can be specified by
datatypelist=Consofnat*list|Empty
This section deals only with functional data structures that cannot change. Conventional imperative programming languages would typically allow the elements of such a recursive list to be changed.
The problem of solving domain equations is concerned with finding domains that model these kinds of datatypes. One approach, roughly speaking, is to consider the collection of all domains as a domain itself, and then solve the recursive definition there.
Polymorphic data types are data types that are defined with a parameter. For example, the type of α lists is defined by
datatypeαlist=Consofα*αlist|Empty
Lists of natural numbers, then, are of type nat list, while lists of strings are of string list.
Some researchers have developed domain theoretic models of polymorphism. Other researchers have also modeled parametric polymorphism within constructive set theories.
A recent research area has involved denotational semantics for object and class based programming languages.[14]
Denotational semantics for programs of restricted complexity
Following the development of programming languages based on linear logic, denotational semantics have been given to languages for linear usage (see e.g. proof nets, coherence spaces) and also polynomial time complexity.[15]
Denotational semantics of sequentiality
The problem of full abstraction for the sequential programming language PCF was, for a long time, a big open question in denotational semantics. The difficulty with PCF is that it is a very sequential language. For example, there is no way to define the parallel-or function in PCF. It is for this reason that the approach using domains, as introduced above, yields a denotational semantics that is not fully abstract.
This open question was mostly resolved in the 1990s with the development of game semantics and also with techniques involving logical relations.[16] For more details, see the page on PCF.
Denotational semantics as source-to-source translation
It is often useful to translate one programming language into another. For example, a concurrent programming language might be translated into a process calculus; a high-level programming language might be translated into byte-code. (Indeed, conventional denotational semantics can be seen as the interpretation of programming languages into the internal language of the category of domains.)
In this context, notions from denotational semantics, such as full abstraction, help to satisfy security concerns.[17][18]
Abstraction
It is often considered important to connect denotational semantics with operational semantics. This is especially important when the denotational semantics is rather mathematical and abstract, and the operational semantics is more concrete or closer to the computational intuitions. The following properties of a denotational semantics are often of interest.
Syntax independence: The denotations of programs should not involve the syntax of the source language.
Adequacy (or soundness): All observably distinct programs have distinct denotations;
Full abstraction: All observationally equivalent programs have equal denotations.
For semantics in the traditional style, adequacy and full abstraction may be understood roughly as the requirement that "operational equivalence coincides with denotational equality". For denotational semantics in more intensional models, such as the actor model and process calculi, there are different notions of equivalence within each model, and so the concepts of adequacy and of full abstraction are a matter of debate, and harder to pin down. Also the mathematical structure of operational semantics and denotational semantics can become very close.
Additional desirable properties we may wish to hold between operational and denotational semantics are:
Constructivism: Constructivism is concerned with whether domain elements can be shown to exist by constructive methods.
Independence of denotational and operational semantics: The denotational semantics should be formalized using mathematical structures that are independent of the operational semantics of a programming language; However, the underlying concepts can be closely related. See the section on Compositionality below.
Full completeness or definability: Every morphism of the semantic model should be the denotation of a program.[19]
Compositionality
An important aspect of denotational semantics of programming languages is compositionality, by which the denotation of a program is constructed from denotations of its parts. For example, consider the expression "7 + 4". Compositionality in this case is to provide a meaning for "7 + 4" in terms of the meanings of "7", "4" and "+".
A basic denotational semantics in domain theory is compositional because it is given as follows. We start by considering program fragments, i.e. programs with free variables. A typing context assigns a type to each free variable. For instance, in the expression (x + y) might be considered in a typing context (x:nat,y:nat). We now give a denotational semantics to program fragments, using the following scheme.
We begin by describing the meaning of the types of our language: the meaning of each type must be a domain. We write 〚τ〛 for the domain denoting the type τ. For instance, the meaning of type nat should be the domain of natural numbers: 〚nat〛= ⊥.
From the meaning of types we derive a meaning for typing contexts. We set 〚 x1:τ1,..., xn:τn〛 = 〚 τ1〛× ... ×〚τn〛. For instance, 〚x:nat,y:nat〛= ⊥×⊥. As a special case, the meaning of the empty typing context, with no variables, is the domain with one element, denoted 1.
Finally, we must give a meaning to each program-fragment-in-typing-context. Suppose that P is a program fragment of type σ, in typing context Γ, often written Γ⊢P:σ. Then the meaning of this program-in-typing-context must be a continuous function 〚Γ⊢P:σ〛:〚Γ〛→〚σ〛. For instance, 〚⊢7:nat〛:1→⊥ is the constantly "7" function, while 〚x:nat,y:nat⊢x+y:nat〛:⊥×⊥→⊥ is the function that adds two numbers.
Now, the meaning of the compound expression (7+4) is determined by composing the three functions 〚⊢7:nat〛:1→⊥, 〚⊢4:nat〛:1→⊥, and 〚x:nat,y:nat⊢x+y:nat〛:⊥×⊥→⊥.
In fact, this is a general scheme for compositional denotational semantics. There is nothing specific about domains and continuous functions here. One can work with a different category instead. For example, in game semantics, the category of games has games as objects and strategies as morphisms: we can interpret types as games, and programs as strategies. For a simple language without general recursion, we can make do with the category of sets and functions. For a language with side-effects, we can work in the Kleisli category for a monad. For a language with state, we can work in a functor category. Milner has advocated modelling location and interaction by working in a category with interfaces as objects and bigraphs as morphisms.[20]
Usually, however, the formal semantics of a conventional sequential programming language may itself be interpreted to provide an (inefficient) implementation of the language. A formal semantics need not always provide such an implementation, though, and to believe that semantics must provide an implementation leads to confusion about the formal semantics of concurrent languages. Such confusion is painfully evident when the presence of unbounded nondeterminism in a programming language's semantics is said to imply that the programming language cannot be implemented.
^ abcdDana Scott and Christopher Strachey. Toward a mathematical semantics for computer languages Oxford Programming Research Group Technical Monograph. PRG-6. 1971.
^Jan Jürjens. J. Games In The Semantics Of Programming Languages – An Elementary Introduction. Synthese 133, 131–158 (2002). https://doi.org/10.1023/A:1020883810034
^Peter W. O'Hearn, John Power, Robert D. Tennent, Makoto Takeyama. Syntactic control of interference revisited. Electron. Notes Theor. Comput. Sci. 1. 1995.
^Frank J. Oles. A Category-Theoretic Approach to the Semantics of Programming. PhD thesis, Syracuse University, New York, USA. 1982.
Stoy, Joseph E. (1977). Denotational Semantics: The Scott-Strachey Approach to Programming Language Semantics. MIT Press. ISBN978-0-262-19147-0. (A classic if dated textbook.)
Schmidt, David A. (1986). Denotational semantics: a methodology for language development. Allyn & Bacon. ISBN978-0-205-10450-5.
Gunter, Carl (1992). Semantics of Programming Languages: Structures and Techniques. MIT Press. ISBN978-0-262-07143-7.
Winskel, Glynn (1993). Formal Semantics of Programming Languages. MIT Press. ISBN978-0-262-73103-4.
Tennent, R.D. (1994). "Denotational semantics". In Abramsky, S.; Gabbay, Dov M.; Maibaum, T.S.E. (eds.). Semantic Structures. Handbook of logic in computer science. Vol. 3. Oxford University Press. pp. 169–322. ISBN978-0-19-853762-5.
Ini adalah nama Korea; marganya adalah Lee. ChangminNama asal이창민LahirLee Chang-min1 Mei 1986 (umur 37)Tenafly, New Jersey, Amerika SerikatTempat tinggalSeoul, Korea SelatanPekerjaanPenyanyiPenariAktorMCKarier musikGenreK-popR&BInstrumenVokalTahun aktif2008–sekarangLabelJYP Entertainment (2008–2015) Big Hit Entertainment (2015–sekarang)Artis terkait2AM2PMJYP NationOne DayHomme Templat:Korean membutuhkan parameter |hangul=. Lee Chang-min (Hangul: 이�...
هذه المقالة يتيمة إذ تصل إليها مقالات أخرى قليلة جدًا. فضلًا، ساعد بإضافة وصلة إليها في مقالات متعلقة بها. (أكتوبر 2019) ديزيري مونيانيزا معلومات شخصية الميلاد سنة 1966 (العمر 57–58 سنة) رواندا مواطنة رواندا المهنة مجرم تهم التهم جريمة ضد الإنسانية تعديل مصدري -...
Artikel ini memiliki beberapa masalah. Tolong bantu memperbaikinya atau diskusikan masalah-masalah ini di halaman pembicaraannya. (Pelajari bagaimana dan kapan saat yang tepat untuk menghapus templat pesan ini) Artikel ini sebagian besar atau seluruhnya berasal dari satu sumber. Diskusi terkait dapat dibaca pada the halaman pembicaraan. Tolong bantu untuk memperbaiki artikel ini dengan menambahkan rujukan ke sumber lain yang tepercaya. Artikel ini tidak memiliki referensi atau sumber tepercay...
Jozef Poniatowski. Pangeran Józef Antoni Poniatowski (7 Mei 1763 – 19 Oktober 1813) adalah seorang pemimpin, jenderal, juga menteri peperangan dari Polandia yang akhirnya menjadi marsekal Napoleon. Lihat pula Daftar Marsekal Kekaisaran Prancis Pertama Peperangan era Napoleon Pranala luar Wikimedia Commons memiliki media mengenai Józef Antoni Poniatowski. lbsMarshals dari Kekaisaran Napoleon (1804 - 1815) Augereau Bernadotte Berthier Bessières Brune Davout Gouvion Saint-Cyr ...
Artikel ini tidak memiliki referensi atau sumber tepercaya sehingga isinya tidak bisa dipastikan. Tolong bantu perbaiki artikel ini dengan menambahkan referensi yang layak. Tulisan tanpa sumber dapat dipertanyakan dan dihapus sewaktu-waktu.Cari sumber: Angin surya – berita · surat kabar · buku · cendekiawan · JSTOR Plasma pada angin surya bertemu di heliopause Angin surya adalah suatu aliran partikel bermuatan (yakni plasma) yang menyebar ke segala ara...
X-15 Jenis Pesawat eksperimental kecepatan tinggi bertenaga roket Pembuat North American Aviation Penerbangan perdana 8 Juni 1959 Diperkenalkan 17 September 1959 Dipensiunkan December 1970 Pengguna utama United States Air ForceNASA Jumlah 3 Berkas:Profile and pertinent details of a flight in which the X-15 achieved its design goals.jpg Reaction Motors XLR99 North American X-15 adalah pesawat roket percontohan AS, yang dibuat dalam rangka program penelitian pada penerbangan dengan kecepa...
Perang DiponegoroLukisan Peristiwa Penangkapan Pangeran Diponegoro oleh Raden SalehTanggal21 Juli 1825 - 9 Februari 1830LokasiYogyakarta, Surakarta, Jawa Tengah, dan Jawa TimurHasil Kemenangan Belanda Penangkapan dan pengasingan Pangeran Diponegoro [1]Pihak terlibat BelandaKesultanan YogyakartaPasukan Tulungan Pasukan Jawa/DiponegoroTokoh dan pemimpin Hendrik M. de KockHermanus W. Dotulong DiponegoroSentot PrawirodirdjoKiai MadjaNyi Ageng SerangPakubuwana VITumenggung PrawirodigdoyoKe...
Jeroen Dijsselbloem Menteri KeuanganMasa jabatan5 November 2012 – 26 Oktober 2017Perdana MenteriMark Rutte PendahuluJan Kees de JagerPenggantiWopke HoekstraPemimpin Partai Buruh dalam Dewan PerwakilanSementaraMasa jabatan20 Februari 2012 – 20 Maret 2012 PendahuluJob CohenPenggantiDiederik Samsom Informasi pribadiLahirJeroen René Victor Anton Dijsselbloem29 Maret 1966 (umur 58)Eindhoven, BelandaPartai politikPartai BuruhAnak1 putra1 putriAlma materUniversitas Wageni...
State park in Massachusetts, United States Dighton Rock State ParkDighton Rock Museum 18931853 Historic pictures of the rock in its natural stateLocation in MassachusettsShow map of MassachusettsDighton Rock State Park (the United States)Show map of the United StatesLocationBerkley, Bristol, Massachusetts, United StatesCoordinates41°48′46″N 71°06′23″W / 41.81278°N 71.10639°W / 41.81278; -71.10639[1]Area98 acres (40 ha)[2]Elevation66...
Genus of bats Nyctalus Scientific classification Domain: Eukaryota Kingdom: Animalia Phylum: Chordata Class: Mammalia Order: Chiroptera Family: Vespertilionidae Tribe: Pipistrellini Genus: NyctalusBowdich, 1825 Type species Nyctalus verrucosus [1] Species See text Nyctalus is a genus of vespertilionid bats commonly known as the noctule bats. They are distributed in the temperate and subtropical areas of Europe, Asia and North Africa. There are eight species within this genus: Birdlike...
Major League Baseball season This article relies largely or entirely on a single source. Relevant discussion may be found on the talk page. Please help improve this article by introducing citations to additional sources.Find sources: 2000 Colorado Rockies season – news · newspapers · books · scholar · JSTOR (November 2023) Major League Baseball team season 2000 Colorado RockiesLeagueNational LeagueDivisionWestBallparkCoors FieldCityDenver, Colorad...
Stan Pameran Pameran adalah suatu kegiatan penyajian karya seni rupa untuk dikomunikasikan sehingga dapat diapresiasi oleh masyarakat luas.[1] Pameran merupakan suatu bentuk dalam usaha jasa pertemuan, yang mempertemukan antara produsen dan pembeli. Namun pengertian pameran lebih jauh adalah suatu kegiatan promosi yang dilakukan oleh suatu produsen, kelompok, organisasi, perkumpulan tertentu dalam bentuk menampilkan display produk kepada calon relasi atau pembeli. Adapun macam pameran...
Town in Texas, United StatesTown of PantegoTownLocation of Pantego in Tarrant County, TexasCoordinates: 32°42′55″N 97°09′17″W / 32.71528°N 97.15472°W / 32.71528; -97.15472CountryUnited StatesStateTexasCountyTarrantIncorporated (city)May 22, 1952Government • MayorDoug Davis 2017-Present Melody Paradise 2010-2017[1]Area[2] • Total1.04 sq mi (2.70 km2) • Land1.04 sq mi (2.70 km2...
Football match1988 FA Charity ShieldThe match programme cover Liverpool Wimbledon 2 1 Date20 August 1988VenueWembley Stadium, LondonRefereeJ MartinAttendance54,887← 1987 1989 → The 1988 FA Charity Shield was the 66th Charity Shield, a football match contested by the winners of the previous season's Football League and FA Cup competitions. The match was played on 20 August 1988 between 1987–88 Football League champions Liverpool and 1987–88 FA Cup winners Wimbledon. Th...
Johnny DorelliBiographieNaissance 20 février 1937 (87 ans)MedaNom dans la langue maternelle Giorgio GuidiNom de naissance Giorgio Domenico GuidiPseudonyme Johnny DorelliNationalité italienneFormation High School of Music & Art (en)Activités Chanteur, acteur, artiste d'enregistrement, animateur de radio, animateur de télévision, compositeur, forainPériode d'activité depuis 1951Père Nino D 'Aurelio (d)Conjoint Gloria Guida (depuis 1981)Enfant Gianluca Guidi (d)Autres infor...
RAMP1 التراكيب المتوفرة بنك بيانات البروتينOrtholog search: PDBe RCSB قائمة رموز معرفات بنك بيانات البروتين 2YX8, 3N7P, 3N7R, 3N7S, 4RWG المعرفات الأسماء المستعارة RAMP1, entrez:10267, receptor activity modifying protein 1 معرفات خارجية الوراثة المندلية البشرية عبر الإنترنت 605153 MGI: MGI:1858418 HomoloGene: 4275 GeneCards: 10267 علم الوجود الجي�...
Distretto di TulceadistrettoJudețul Tulcea LocalizzazioneStato Romania Regione Dobrugia AmministrazioneCapoluogoTulcea TerritorioCoordinatedel capoluogo45°11′N 28°48′E / 45.183333°N 28.8°E45.183333; 28.8 (Distretto di Tulcea)Coordinate: 45°11′N 28°48′E / 45.183333°N 28.8°E45.183333; 28.8 (Distretto di Tulcea) Superficie8 499 km² Abitanti250 641[1] (2007) Densità29,49 ab./km² Altre informazioniFuso orarioU...
Rolling stock manufacturer This article uses bare URLs, which are uninformative and vulnerable to link rot. Please consider converting them to full citations to ensure the article remains verifiable and maintains a consistent citation style. Several templates and tools are available to assist in formatting, such as reFill (documentation) and Citation bot (documentation). (August 2022) (Learn how and when to remove this message) Brookville Equipment CorporationCompany typePrivateIndustryRail t...
Artikel ini tidak memiliki referensi atau sumber tepercaya sehingga isinya tidak bisa dipastikan. Tolong bantu perbaiki artikel ini dengan menambahkan referensi yang layak. Tulisan tanpa sumber dapat dipertanyakan dan dihapus sewaktu-waktu.Cari sumber: Makam Kekaisaran Dinasti Ming dan Qing – berita · surat kabar · buku · cendekiawan · JSTOR Makam Kekaisaran Dinasti Ming dan QingSitus Warisan Dunia UNESCOLokasiRepublik Rakyat TiongkokKriteriaKebudayaan...