doc-src/Codegen/Thy/examples/class.ocaml
author bulwahn
Tue, 08 May 2012 14:31:03 +0200
changeset 47893 4cf901b1089a
parent 30226 2f4684e2ea95
permissions -rw-r--r--
specialised fact in the Record theory should not be appear in proofs discovered by sledgehammer

module Nat = 
struct

type nat = Suc of nat | Zero_nat;;

end;; (*struct Nat*)

module Codegen = 
struct

type 'a null = {null : 'a};;
let null _A = _A.null;;

let rec head _A = function x :: xs -> x
                  | [] -> null _A;;

let rec null_option = None;;

let null_optiona () = ({null = null_option} : ('a option) null);;

let rec dummy
  = head (null_optiona ()) [Some (Nat.Suc Nat.Zero_nat); None];;

end;; (*struct Codegen*)