Last active
December 22, 2015 20:09
-
-
Save philnguyen/6524121 to your computer and use it in GitHub Desktop.
Example 14 from "Logical Types for Untyped Languages" translated to OCaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type top = N of int | S of string | |
let f input extra = | |
match input,extra with | |
| N m, (N n,_) -> m + n | |
| _, (N n,_) -> (match input with | |
| S s -> String.length s + n) | |
| _,_ -> 0 | |
let main i e = f i e | |
(* Error message received from MoCHi: | |
Verification result | |
Fatal error: Not implemented (Type_decl.get_base_types) | |
*) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment