Home
Insert
Update snippet 'Solution to the problem mentioned at : http://professor-fish.blogspot.com/2011/01/tiny-bit-of-denotational-semantics.html'
Title
Description
Solution to the problem mentioned at : http://professor-fish.blogspot.com/2011/01/tiny-bit-of-denotational-semantics.html
Source code
type Expr = Const of int | Add of (Expr * Expr) | Exit of Expr let rec eval (e:Expr) (f:int -> int) = match e with | Const x -> f x | Add (a,b) -> eval b (fun z -> z + eval a f) | Exit x -> eval x (fun z -> z) let a = eval (Add (Exit (Add (Exit (Const 1), Const 10)), Exit( Add( Const 8, Const 10) ))) (fun a -> a)
Tags
denotational semantics
expression evaluation
denotational semantics
expression evaluation
Author
Link
Reference NuGet packages
If your snippet has external dependencies, enter the names of NuGet packages to reference, separated by a comma (
#r
directives are not required).
Update