Questions tagged [denotational-semantics]

Denotational semantics is an approach of formalizing the meanings of programming languages by constructing mathematical objects (called denotations) that describe the meanings of expressions from the languages. Source: Wikipedia

https://en.wikipedia.org/wiki/Denotational_semantics

14 questions
881
votes
6 answers

What part of Hindley-Milner do you not understand?

I swear there used to be a T-shirt for sale featuring the immortal words: What part of do you not understand? In my case, the answer would be... all of it! In particular, I often see notation like this in Haskell papers, but I have no clue what…
26
votes
1 answer

The concept of Bottom in Haskell

Bottom in Haskell described here is said to be any computation that have errors, is unterminated, or involves infinite loop, is of any type... is this specific to Haskell? We know in Lattice theory, there is also a notion of Bottom there.....and…
user618815
12
votes
1 answer

What goes into writing a denotational semantics mapping function?

I am a bit confused on the concept of denotational semantics. As I understand, denotational semantics are supposed to describe how functions and expressions work in a particular programming language. What exactly is the proper form used to describe…
tbogatchev
  • 1,121
  • 2
  • 11
  • 20
8
votes
1 answer

Does Haskell's 'evaluate' reduce to normal or WHNF?

I understand (I think) that Haskell's seq, will (generally) reduce its first argument to WHNF, and see this behavior as expected in GHCi: λ> let x = (trace "foo" Foo (trace "bar" Bar 100)) in seq x 0 foo 0 However, though the documentation for…
orome
  • 35,904
  • 38
  • 156
  • 345
7
votes
1 answer

Termination checking in functional programs

Are there functional languages that can specify, in the typechecker, whether or not a certain computation is guaranteed to terminate? Alternatively, can you do this in just Haskell? Regarding Haskell, in this answer the poster says that The usual…
Dan
  • 10,532
  • 2
  • 42
  • 74
4
votes
1 answer

Writing a haskell program for computing denotational semantics of an imperative programming language

I am trying to write a program in Haskell to compute the denotational semantics of an imperative language program with integer variables, 1-dimensional (integer) arrays and functions. The function I am starting with is of the type: progsem ::…
Justin B
  • 110
  • 1
  • 7
3
votes
2 answers

What is denotational semantics?

I am looking for an accurate and understandable definition. The ones I have found differ from each other: From a book on functional reactive programming Denotational semantics is a mathematical expression of the formal meaning of a programming…
2
votes
1 answer

Free theorem for fmap

Consider the following wrapper: newtype F a = Wrap { unwrap :: Int } I want to disprove (as an exercise to wrap my head around this interesting post) that there’s a legitimate Functor F instance which allows us to apply functions of Int -> Int type…
2
votes
1 answer

In what sense is one function "less defined" than another?

What I mean is that, from definition: fix f is the least fixed point of the function f In other words: the least defined x such that f x = x. The least defined value of any nullary type is undefined. There is some ambiguity here still as…
1
vote
1 answer

Natural map derivation algorithm

This Reddit post by Edward Kmett provides a constructive definition of a natural map, the one from the free theorem for fmap (which I read in yet another Edward Kmett's post): For given f, g, h and k, such that f . g = h . k: $map f . fmap g = fmap…
1
vote
1 answer

Denotational semantics, proving that fixed point iteration results in the least fixed point

I'm working through the Haskell wikibook section on denotational semantics and I'm kind of stuck on this exercise: Prove that the fixed point obtained by fixed point iteration starting with is also the least one, that it is smaller than any…
Sam van Herwaarden
  • 2,281
  • 11
  • 26
1
vote
1 answer

How do I denote this syntax's semantics?

I am writing a language specification, and I need the following rudimentary question resolved. Suppose I have the (admittedly contrived) abstract syntax: ::= | ::= 1 | 2 | 3 ::= 4 | 5 | 6 What does the denotational semantics…
Dan Barowy
  • 2,202
  • 23
  • 35
0
votes
1 answer

How to add function and procedure abstractions denotational semantics using haskell?

I want write a haskell program to implement a simple imperative language based on its denotational semantics. I use GHCi, version 8.4.2 on windows. I encountered some issue when implementing function and procedure abstraction described below. let me…
0
votes
0 answers

Formal verification using denotational semantics?

This might go to cs or cstheory stack exchange, but I have seen the most questions tagged with formal-verification here. Is there extensive literature on using denotational semantics for program verification? With a quick search I have…
Gergely
  • 4,853
  • 2
  • 19
  • 30