Questions tagged [formal-semantics]

In programming language theory, semantics is the field concerned with the rigorous mathematical study of the meaning of programming languages. It does so by evaluating the meaning of syntactically legal strings defined by a specific programming language, showing the computation involved. In such a case that the evaluation would be of syntactically illegal strings, the result would be non-computation.

In programming language theory, semantics is the field concerned with the rigorous mathematical study of the meaning of programming languages. It does so by evaluating the meaning of syntactically legal strings defined by a specific programming language, showing the computation involved. In such a case that the evaluation would be of syntactically illegal strings, the result would be non-computation.

Semantics describes the processes a computer follows when executing a program in that specific language. This can be shown by describing the relationship between the input and output of a program, or an explanation of how the program will execute on a certain platform, hence creating a model of computation.

Formal semantics, for instance, helps to write compilers, better understand what a program is doing and to prove, e.g., that the following if statement:

if 1 == 1 then S1 else S2

has the same effect as S1 alone.

Source:http://en.wikipedia.org/wiki/Formal_semantics_of_programming_languages

28 questions
13
votes
1 answer

PLT Redex: parameterizing a language definition

This is a problem that's been nagging at me for some time, and I wonder if anyone here can help. I have a PLT Redex model of a language called lambdaLVar that is more or less a garden-variety untyped lambda calculus, but extended with a store…
Lindsey Kuper
  • 984
  • 8
  • 21
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,531
  • 3
  • 14
  • 21
12
votes
2 answers

Are denotational semantic mappings decidable?

Apologies for my poor expression of this question, I'm not sure I have the vocabulary to ask it appropriately. I've written (very recently) something akin to ⟦let x = x in x⟧ = ⊥ but really I'm failing to understand something tricky here. I can…
J. Abrahamson
  • 72,246
  • 9
  • 135
  • 180
8
votes
1 answer

Why don't I have to declare that x is reusable/duplicable with affine semantics and function types?

I was told that Rust has a semantics in affine logic -- so one has deletion/weakening but not duplication/contraction. The following compiles: fn throw_away(x: A, _y: B) -> A { x } Because duplication is disallowed, the following does not…
Jonathan Gallagher
  • 2,115
  • 2
  • 17
  • 31
8
votes
4 answers

What is "formal semantics"?

I'm reading a very silly paper and it keeps on talking about how Giotto defines a "formal semantics". Giotto has a formal semantics that specifies the meaning of mode switches, of intertask communication, and of communication with the program…
bobobobo
  • 64,917
  • 62
  • 258
  • 363
8
votes
5 answers

PHP formal semantics?

I am tasked with learning PHP, but there are many things I don't understand. For example, the concept of "variable functions" is not one I've seen anywhere else. There are many other examples, but for brevity, I found PHPWTF, which has many examples…
jameshfisher
  • 34,029
  • 31
  • 121
  • 167
6
votes
3 answers

Is static analysis really formal verification?

I have been reading about formal verification and the basic point is that it requires a formal specification and model to work with. However, many sources classify static analysis as a formal verification technique, some mention abstract…
John V
  • 4,855
  • 15
  • 39
  • 63
6
votes
6 answers

is there a Universal Model for languages?

Many programming languages share generic and even fairly universal features. For example, if you compared Java, VB6, .NET, PHP, Python, then you would find common functions such as control structures, numeric and string manipulation, etc. What…
Smandoli
  • 6,919
  • 3
  • 49
  • 83
5
votes
1 answer

Formal semantics of CSS box positioning

I'm a (theoretical) computer science student, and as such the investigating of semantics of programming languages is one of the subjects of my study (wikipedia). I've played around a lot with CSS and have a reasonable understanding of the box…
Kelley van Evert
  • 1,063
  • 2
  • 9
  • 17
3
votes
1 answer

What does InjL and InjR operator means in coq-Iris?

I'm trying to understand the iris, a state-of-art verification framework based on separation logic. lang.v is the default language used by Iris. Following code defines the value of the expression where LitV means the basic value, RecV means value of…
Huan Sun
  • 147
  • 6
3
votes
1 answer

What is the relationship between loop invariant and weakest precondition

Given a loop invariant, Wikipedia lists, a nice way to produce the weakest preconditions for a loop (from http://en.wikipedia.org/wiki/Predicate_transformer_semantics): wp(while E inv I do S, R) = I \wedge \forall y. ((E \wedge I) \implies…
2
votes
1 answer

How to create a lattice-type data structure in Haskell?

I am trying to build a lattice-type of FCA-type of data structure in Haskell where I could check if two entities have a join or not. Actually, I'm not even sure that the lattice is the right structure as it might be a bit "too much". Here is the…
2
votes
1 answer

What is the difference between operational, denotational and axiomatic semantics?

While reading papers about computer science and programming languages I often stumble on terms denotational semantics and operational semantics. Sometimes, but rarely, I also find axiomatical ones. While I know what semantics are, I don't get the…
2
votes
0 answers

K Framework produces an error in the OCaml backend

I am using the K semantics Framework and running tutorials this is my TEST1.k : module TEST1-SYNTAX import DOMAINS syntax Fun ::= "add(" Pgm "," Pgm ")" [strict] syntax Pgm ::= Int | Fun endmodule module TEST1 import…
1
vote
1 answer

Given a function in Agda, some argument, and a new value, how to generate new function where the result for this argument will be the new value

Let's suppose that I have some f : A -> B, a : A, b : B. I want new function, that is almost a copy of f, but it should produce b for an argument a. I was trying something like this. replace_f : ∀ {A B} (f : A -> B) (a : A) (b : B) -> (A ->…
1
2