Advertisement
Guest User

Untitled

a guest
Aug 31st, 2014
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 3.07 KB | None | 0 0
  1. # module type NOMINALS =
  2. sig
  3.   type nominal
  4. end;;
  5.       module type NOMINALS = sig type nominal end
  6. # module type TERMS =
  7. sig
  8.   type term
  9.   type pattern
  10. end;;
  11.         module type TERMS = sig type term type pattern end
  12. # module type ENVIRONMENTS =
  13. sig
  14.   type ( 'n, 'v ) env
  15. end;;
  16.       module type ENVIRONMENTS = sig type ('n, 'v) env end
  17. # module type VALUES =
  18.   functor (Nominal : NOMINALS) ->
  19.     functor (Term : TERMS) ->
  20.       functor (Env : ENVIRONMENTS) ->
  21. sig
  22.   type ident = Nominal.nominal
  23.   type term = Term.term
  24.   type ptrn = Term.pattern
  25.   type value =
  26.       Ground of ground
  27.       | Closure of ptrn * term * env
  28.       | BOTTOM
  29.       | UNIT
  30.   and ground =
  31.       Boolean of bool
  32.       | String of string
  33.       | Integer of int
  34.       | Double of float
  35.       | Reification of Term.term
  36.   and env = (ident, value) Env.env
  37. end;;
  38.                                         module type VALUES =
  39.   functor (Nominal : NOMINALS) ->
  40.     functor (Term : TERMS) ->
  41.       functor (Env : ENVIRONMENTS) ->
  42.         sig
  43.           type ident = Nominal.nominal
  44.           type term = Term.term
  45.           type ptrn = Term.pattern
  46.           type value =
  47.               Ground of ground
  48.             | Closure of ptrn * term * env
  49.             | BOTTOM
  50.             | UNIT
  51.           and ground =
  52.               Boolean of bool
  53.             | String of string
  54.             | Integer of int
  55.             | Double of float
  56.             | Reification of Term.term
  57.           and env = (ident, value) Env.env
  58.         end
  59. # module VALUE ( Nominal : NOMINALS ) ( Term : TERMS ) ( Env : ENVIRONMENTS ) : VALUES =
  60. struct
  61.   type ident = Nominal.nominal
  62.   type term = Term.term
  63.   type ptrn = Term.pattern
  64.   type value =
  65.       Ground of ground
  66.       | Closure of ptrn * term * env
  67.       | BOTTOM
  68.       | UNIT
  69.   and ground =
  70.       Boolean of bool
  71.       | String of string
  72.       | Integer of int
  73.       | Double of float
  74.       | Reification of Term.term
  75.   and env = ( ident, value ) Env.env
  76. end;;
  77.                                   Characters 87-461:
  78.   struct
  79.     type ident = Nominal.nominal
  80.     type term = Term.term
  81.     type ptrn = Term.pattern
  82.     type value =
  83.         Ground of ground
  84.         | Closure of ptrn * term * env
  85.         | BOTTOM
  86.         | UNIT
  87.     and ground =
  88.         Boolean of bool
  89.         | String of string
  90.         | Integer of int
  91.         | Double of float
  92.         | Reification of Term.term
  93.     and env = ( ident, value ) Env.env
  94.   end..
  95. Error: Signature mismatch:
  96.        Modules do not match:
  97.          sig
  98.            type ident = Nominal.nominal
  99.            type term = Term.term
  100.            type ptrn = Term.pattern
  101.            type value =
  102.                Ground of ground
  103.              | Closure of ptrn * term * env
  104.              | BOTTOM
  105.              | UNIT
  106.            and ground =
  107.                Boolean of bool
  108.              | String of string
  109.              | Integer of int
  110.              | Double of float
  111.              | Reification of Term.term
  112.            and env = (ident, value) Env.env
  113.          end
  114.        is not included in
  115.          VALUES
  116. #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement