Navigation
  • Home
  • Recent
  • Most Active
  • Popular
  • Blog
  • Credits
  • RSS
  •   Interaction
  • Register
  • Statistics
  •   Help
  • Suggestions
  • Contact Us
  • How to Edit
  • Help



  • [Edit]



    In computer science, denotational semantics is an approach to formalizing the semantics of computer systems by constructing mathematical objects (called denotations or meanings) which express the semantics of these systems. Other approaches to providing a formal semantics of programming languages include axiomatic semantics and operational semantics. The denotational approach to semantics was originally developed to deal only with systems defined by a single computer program. Later the field broadened to include systems composed of more than one program, such as those found in networking and concurrent systems.

    Denotational semantics originated in the work of Christopher Strachey and Dana Scott in the 1960s. As originally developed by Strachey and Scott, denotational semantics interpreted the denotation (meaning) of a computer program as a function that mapped input into output. Later, this proved to be too limiting to allow the definition of denotations (meanings) for programs that included elements such as recursively defined functions and data structures. Seeking to address these difficulties, Scott introduced a generalized approach to denotational semantics, based on domains . Later researchers introduced approaches based on power domains, in an effort to address difficulties with the semantics of concurrent systems .


        Denotational semantics
            Fixed point semantics
                Example of factorial function
                Derivation of Scott Continuity from Actor Semantics
            Full abstraction
            Compositionality in programming languages
                Environments
                Arithmetic expressions
                Delayed evaluation
            Denotational semantics of concurrency
            Early history of denotational semantics
            Connections to other areas of computer science
            See also

    top

    Fixed point semantics
    The denotational theory of computational system semantics is concerned with finding mathematical objects that represent what systems do. The theory makes use of computational mathematical domains. Examples of such computational domains are partial functions and Actor event diagram scenarios.

    The relationship x≤y means that x can computationally evolve to y. If the denotations are partial functions, for example, f≤g may mean that f agrees with g on all values for which f is defined. If the denotations are Actor event diagram scenarios, x≤y means that a system which satisfies x can evolve into a system which satisfies y.

    Computational domains have the following properties:
      Bottom exists. The domain has a least element denoted by such that for every element x in the domain ⊥≤x.
      Limits exist. As computation continues, the denotations should become better and have a limit so if we have orall i in omega x_i le x_ then the least upper bound vee_ x_i should exist. The property just stated is called omega-completeness.
      Finite elements are countable. An element x is finite (also called isolated in the domain literature) if and only if whenever A is directed, ∨A exists and x le vee A, there exists a in A with x le a. In other words, x is finite if one must go through x in order to get up to or above x via the limit process.
      Every element is the least upper bound of a countable increasing sequence of finite elements. Intuitively this means that every element can be reached by a computational process in which each progression is finite.
      The domain is downward closed.

    The mathematical denotation denoted by a system S is found by solving by constructing increasingly better approximations from an initial empty denotation called S using some denotation approximating function progressionS to construct a denotation (meaning ) for S as follows Hewitt 2006b:
    DenoteS ≡ ∨i∈ω progressionSi(⊥S).


    It would be expected that progressionS would be monotone, i.e., if x≤y then progressionS(x)≤progressionS(y). More generally, we would expect that
    If ∀i∈ω xi≤xi+1, then progressionS(∨i∈ω xi) = ∨i∈ω progressionS(xi)

    This last stated property of progressionS is called ω-continuity.

    A central question of denotational semantics is to characterize when it is possible to create denotations (meanings) in according to the equation for DenoteS. A fundamental theorem of computational domain theory is that if progressionS is ω-continuous then DenoteS will exist.

    It follows from the ω-continuity of progressionS that
    progressionS(DenoteS) = DenoteS


    The above equation motivates the terminology that DenoteS is a fixed point of progressionS.

    Furthermore this fixed point is least among all fixed points of progressionS.

    The denotational semantics of functional programs provides an example of fixed point semantics as shown in the next section.

    top

    Example of factorial function
    Consider the factorial function which is defined on all whole numbers as follows:
    factorial ≡ λ(n)if (n==0)then 1 else n
      factorial(n-1)
    The graph of factorial is the set of all ordered pairs for which factorial is defined with the first element of an ordered pair being the argument and the second element being the value, e.g.,
    graph(factorial) = =

    The denotation (meaning) Denotefactorial for the factorial program is constructed as follows:
    Denotefactorial = graph(factorial) = ∪i∈ω progressionfactoriali()


    where

    progressionfactorial(g) ≡ λ(n)if (n==0)then 1 else n
      g(n-1)

    Note: progressionfactorial is a fix point operator (see definition in section above) whose least fixed point is Denotefactorial, i.e.,
    Denotefactorial = progressionfactorial(Denotefactorial)

    Also progressionfactorial is ω-continuous (see definition in section above).

    top

    Derivation of Scott Continuity from Actor Semantics
    The Actor model provides a foundation for deriving Dana Scott's denotational semantics of functions (as illustrated in the previous section above for factorial) as demonstrated first by a theorem of Carl Hewitt and Henry Baker 1977:

    If an Actor f behaves like a mathematical function, then progressionf is a Scott continuous functional whose least fixed point is
    graph(f) = ∪i∈ω progressionfi()

    where
    progressionf(G)≡

    The paper by Hewitt and Baker contained a small bug in the definition of immediate-descendantsf that was corrected in Will Clinger 1981.

    top

    Full abstraction
    The concept of full abstraction is concerned with whether the denotational semantics for a program is an exact match for its operational semantics.
    Key properties of full abstraction are:
      Abstractness: The denotational semantics must be formalised using mathematical structures that are independent of the representation and operational semantics of the programming language;
      Completeness: Any two programs with distinct denotations must be observably distinct.
    Additional desirable properties we may wish to hold between operational and denotational semantics are:
      Constructivity: The semantic model should be constructive in the sense that it should only include elements that can be intuitively constructed. One way of formalizing this is that every element must be the limit of a directed set of finite elements.
      Progressivity: For each system S, there is a progressionS function for the semantics such that the denotation (meaning) of a system S is i∈ωprogressionSi(⊥S) where S is the initial configuration of s.
      Full completeness: Every morphism of the semantic model should be the denotation of a program.

    A long-standing issue in denotational semantics was full abstraction in the presence of inductive datatypes, particularly the type of natural numbers, as a type admitting usage as a method of recursion. A traditional interpretation of this question was as semantics for the system PCF. The success achieved by game semantics in providing fully abstract models in the 1990s for PCF led to a fundamental change in the way that work on denotational semantics was done.

    top

    Compositionality in programming languages
    See main article principle of 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 "1> + 2>". Compositionality in this case is to provide a meaning for "1> + 2>" in terms of the meanings of 1> and 2>.

    top

    Environments
    The Actor model provides a modern and very general way the compositionality of programs can be analyzed. In this analysis, programs are Actors that are sent Eval messages with the address of an environment Actor so that programs inherit their denotational semantics from the denotational semantics of the Actor model (an idea published in Hewitt 2006a). The environment holds the bindings of identifiers. When an environment is sent a Lookup message with the address of an identifier x, it returns the latest (lexical) binding of x.

    As an example of how this works consider the lambda expression below which implements a tree data structure when supplied with parameters for a leftSubTree and rightSubTree. When such a tree is given a parameter message "getLeft", it returns leftSubTree and likewise when given the message "getRight" it returns rightSubTree.

    λ(leftSubTree, rightSubTree)
    λ(message)
    if (message == "getLeft") then leftSubTree
    else if (message == "getRight") then rightSubTree

    Consider what happens when an expression of the form "( 1 2)" is sent an Eval message with environment E. One semantics for application expressions such as this one is the following: , 1 and 2 are all sent Eval messages with environment E. The integers 1 and 2 immediately reply to the Eval message with themselves.

    However responds to the Eval message by creating a closure Actor (process) C that has an address (called body) for an address (called environment) for E. The Actor "( 1 2)" then sends C the message 1 2.

    When C receives the message 1 2, it creates a new environment Actor F which behaves as follows:
      When it receives a Lookup message for the identifier leftSubTree it responds with 1
      When it receives a Lookup message for the identifier rightSubTree it responds with 2
      When it receives a Lookup message for any other identifier, it forwards the Lookup message to E.

    The Actor (process) C then sends an Eval message with environment F to the following actor (process):

    λ(message)
    if (message == "getLeft") then leftSubTree
    else if (message == "getRight") then rightSubTree

    top

    Arithmetic expressions
    For another example consider the Actor for the expression "1> + 2>" which has addresses for two other actors (processes) 1> and 2>). When the composite expression Actor (process) receives an Eval message with addresses for an environment Actor E and a customer C, it sends Eval messages to expression1 and 2 with environment E and customer a new Actor (process) C0. When C0 has received back two values N1 and N2, it sends C the value N1 + N2. In this way, the denotational semantics for process calculi and the Actor model provide a denotational semantics for "1> + 2>" in terms of the semantics for 1> and 2>.

    top

    Delayed evaluation
    Providing a denotational compositional semantics for delayed evaluation provides a challenge for denotational semantics. The problem with classical approaches for compositional denotational semantics in dealing with expressions of form "delay " has been how to formalize the semantics of the evaluation of .

    The denotational semantics of process calculi and the Actor model provides a perfectly reasonable account:

    The delay expression responds to an message with environment E by creating a closure Actor C that has an address (called body) for an address (called environment) for E.


    When C receives a message M with Customer0, it creates a new Actor (process) Customer1 and sends an Eval message with environment E and the address of Customer1.


    When Customer1 receives a value V, it sends V the message M with Customer0.


    Other programming language constructs can be provided compositional semantics in similar ways.

    The denotational compositional semantics presented above is very general and can be used for functional, imperative, concurrent, logic, etc. programs

    top

    Denotational semantics of concurrency
    Two principle approaches to denotational semantics of concurrency are those based on the process calculi and the Actor model (see denotational semantics of the Actor model).
    Extending denotational semantics to concurrency proved challenging (see unbounded nondeterminism).

    top

    Early history of denotational semantics
    As mentioned earlier, the field was initially developed by Christopher Strachey and Dana Scott in the 1960s and then Joe Stoy in the 1970s at the Programming Research Group, part of the Oxford University Computing Laboratory.

    Montague grammar is a form of denotational semantics for idealized fragments of English.

    According to Clinger 1981,

    Plotkin's original power domain construction was simplified in Smyth 1978 which remains the standard introduction to the subject. A number of nondeterministic programming languages have now been given power domain semantics. Of these the semantics of Francez, Hoare, Lehmann, and de Roever 1979 had the most influence over the development of the denotational model in Clinger's dissertation.


    The denotational semantics in Clinger's dissertation is probably the first power domain semantics for languages with true concurrency, but it is not the first power domain semantics for a language with unbounded nondeterminism. Back 1980 has given a power domain semantics for a language with unboundedly nondeterministic assignment as a primitive operation. Three differences between Back's work and the Actor denotation semantics in Clinger's dissertation stand out:


      The source of nondeterminism in Back's paper is basic assignment statements whereas in the Actor model it is message latency.
      Back's paper treats nondeterministic sequential programming languages whereas the Actor model is concerned with concurrent programming languages.
      The power domain in Back's paper apparently is constructed from a complete underlying domain. This third difference is not entirely clear because Back's power domain construction appears to be nonstandard.

    A similarity between Back's work the Actor denotational semantics in Clinger's dissertation is that Back found it necessary to build the power domain out of execution sequences instead of single states: the Actor power domain is built out of Actor event diagrams, which are generalizations of execution sequences.


    top

    Connections to other areas of computer science
    Some work in denotation semantics has interpreted types as domains in the sense of domain theory which can be seen as a branch of model theory, leading to connections with type theory and category theory. Within computer science, there are connections with abstract interpretation, program verification and functional programming, see for instance monads in functional programming. In particular, denotational semantics has used the concept of continuations to express control flow in sequential programming in terms of functional programming semantics.

    top

    See also
     
    Search more:
     

       
    Source Privacy License Download Contact Us Atlas
    Scientus.org Dictionary (Yet Another Wiki) RC : 1.39
    This article is licensed under the GNU Free Documentation License [copyleft]. It uses material from the Wikipedia article "Denotational semantics". link