Advertisement
Guest User

Untitled

a guest
Aug 21st, 2014
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 7.06 KB | None | 0 0
  1. # module type NOMINALS =
  2. sig
  3.   type symbol
  4.   type nominal
  5. end
  6.  
  7. module type TERMS =
  8. sig
  9.   type term
  10. end
  11.  
  12. module rec NOMINAL :
  13.   functor ( Term : TERMS ) ->
  14.     sig
  15.       type symbol
  16.       type nominal =
  17.           Transcription of Term.term
  18.           | Symbol of symbol
  19.     end = functor ( Term : TERMS ) ->
  20. struct
  21.   type symbol
  22.   type nominal =
  23.       Transcription of Term.term
  24.       | Symbol of symbol
  25. end
  26. and TERM :
  27.   functor ( Nominal : NOMINALS ) ->
  28. sig
  29.   type var = Nominal.nominal
  30.   type term =
  31.       Sequence of term list
  32.       | Application of term * term list
  33.       | Supposition of pattern * term * term
  34.       | Recurrence of pattern * term * term
  35.       | Abstraction of pattern * term * term
  36.       | Condition of term * term * term
  37.       | Comprehension of binding list * term
  38.       | Consolidation of binding list * term
  39.       | Filtration of binding list * pattern list * term
  40.       | Concentration of binding list * pattern list * term
  41.       | Equation of term * term
  42.       | ComparisonLT of term * term
  43.       | ComparisonGT of term * term
  44.       | ComparisonLTE of term * term
  45.       | ComparisonGTE of term * term
  46.       | Acquisition
  47.       | Suspension of term * term
  48.       | Release of term * term
  49.       | InnerSuspension of term * term
  50.       | Calculation of arithmeticTerm
  51.   and arithmeticTerm =
  52.       Division of arithmeticTerm * arithmeticTerm
  53.       | Addition of arithmeticTerm * arithmeticTerm
  54.       | Multiplication of arithmeticTerm * arithmeticTerm
  55.       | Juxtaposition of arithmeticTerm * arithmeticTerm
  56.       | Negation of arithmeticTerm
  57.       | Mention of variation
  58.       | Actualization of value
  59.       | Aggregation of term
  60.   and binding =
  61.       Question of pattern * term
  62.   and pattern =
  63.       Element of symbol * pattern list
  64.       | Variable of variation
  65.       | Materialization of value
  66.       | Procession of lyst
  67.   and variation =
  68.       Identifer of var
  69.       | Abandon of wild
  70.   and lyst =
  71.       Empty
  72.       | Enum of pattern list
  73.       | Cons of pattern list * lyst
  74.       | ConsV of pattern list * variation
  75.   and value =
  76.       BooleanLiteral of duality
  77.       | StringLiteral of string
  78.       | IntegerLiteral of int
  79.       | DoubleLiteral of float
  80.       | Reification of term
  81.   and duality =
  82.       Verity
  83.       | Absurdity
  84.   and symbol =
  85.       Tag of lIdent
  86.   and lIdent = LIdent of string
  87.   and uIdent = UIdent of string
  88.   and wild = Wild of string    
  89. end = functor ( Nominal : NOMINALS ) ->
  90. struct
  91.   type var = Nominal.nominal
  92.   type term =
  93.       Sequence of term list
  94.       | Application of term * term list
  95.       | Supposition of pattern * term * term
  96.       | Recurrence of pattern * term * term
  97.       | Abstraction of pattern * term * term
  98.       | Condition of term * term * term
  99.       | Comprehension of binding list * term
  100.       | Consolidation of binding list * term
  101.       | Filtration of binding list * pattern list * term
  102.       | Concentration of binding list * pattern list * term
  103.       | Equation of term * term
  104.       | ComparisonLT of term * term
  105.       | ComparisonGT of term * term
  106.       | ComparisonLTE of term * term
  107.       | ComparisonGTE of term * term
  108.       | Acquisition
  109.       | Suspension of term * term
  110.       | Release of term * term
  111.       | InnerSuspension of term * term
  112.       | Calculation of arithmeticTerm
  113.   and arithmeticTerm =
  114.       Division of arithmeticTerm * arithmeticTerm
  115.       | Addition of arithmeticTerm * arithmeticTerm
  116.       | Multiplication of arithmeticTerm * arithmeticTerm
  117.       | Juxtaposition of arithmeticTerm * arithmeticTerm
  118.       | Negation of arithmeticTerm
  119.       | Mention of variation
  120.       | Actualization of value
  121.       | Aggregation of term
  122.   and binding =
  123.       Question of pattern * term
  124.   and pattern =
  125.       Element of symbol * pattern list
  126.       | Variable of variation
  127.       | Materialization of value
  128.       | Procession of lyst
  129.   and variation =
  130.       Identifer of var
  131.       | Abandon of wild
  132.   and lyst =
  133.       Empty
  134.       | Enum of pattern list
  135.       | Cons of pattern list * lyst
  136.       | ConsV of pattern list * variation
  137.   and value =
  138.       BooleanLiteral of duality
  139.       | StringLiteral of string
  140.       | IntegerLiteral of int
  141.       | DoubleLiteral of float
  142.       | Reification of term
  143.   and duality =
  144.       Verity
  145.       | Absurdity
  146.   and symbol =
  147.       Tag of lIdent
  148.   and lIdent = LIdent of string
  149.   and uIdent = UIdent of string
  150.   and wild = Wild of string
  151. end;;
  152.                                                                                                                                                                                                                                                                                                             module type NOMINALS = sig type symbol type nominal end
  153. module type TERMS = sig type term end
  154. module rec NOMINAL :
  155.   functor (Term : TERMS) ->
  156.     sig
  157.       type symbol
  158.       type nominal = Transcription of Term.term | Symbol of symbol
  159.     end
  160. and TERM :
  161.   functor (Nominal : NOMINALS) ->
  162.     sig
  163.       type var = Nominal.nominal
  164.       type term =
  165.           Sequence of term list
  166.         | Application of term * term list
  167.         | Supposition of pattern * term * term
  168.         | Recurrence of pattern * term * term
  169.         | Abstraction of pattern * term * term
  170.         | Condition of term * term * term
  171.         | Comprehension of binding list * term
  172.         | Consolidation of binding list * term
  173.         | Filtration of binding list * pattern list * term
  174.         | Concentration of binding list * pattern list * term
  175.         | Equation of term * term
  176.         | ComparisonLT of term * term
  177.         | ComparisonGT of term * term
  178.         | ComparisonLTE of term * term
  179.         | ComparisonGTE of term * term
  180.         | Acquisition
  181.         | Suspension of term * term
  182.         | Release of term * term
  183.         | InnerSuspension of term * term
  184.         | Calculation of arithmeticTerm
  185.       and arithmeticTerm =
  186.           Division of arithmeticTerm * arithmeticTerm
  187.         | Addition of arithmeticTerm * arithmeticTerm
  188.         | Multiplication of arithmeticTerm * arithmeticTerm
  189.         | Juxtaposition of arithmeticTerm * arithmeticTerm
  190.         | Negation of arithmeticTerm
  191.         | Mention of variation
  192.         | Actualization of value
  193.         | Aggregation of term
  194.       and binding = Question of pattern * term
  195.       and pattern =
  196.           Element of symbol * pattern list
  197.         | Variable of variation
  198.         | Materialization of value
  199.         | Procession of lyst
  200.       and variation = Identifer of var | Abandon of wild
  201.       and lyst =
  202.           Empty
  203.         | Enum of pattern list
  204.         | Cons of pattern list * lyst
  205.         | ConsV of pattern list * variation
  206.       and value =
  207.           BooleanLiteral of duality
  208.         | StringLiteral of string
  209.         | IntegerLiteral of int
  210.         | DoubleLiteral of float
  211.         | Reification of term
  212.       and duality = Verity | Absurdity
  213.       and symbol = Tag of lIdent
  214.       and lIdent = LIdent of string
  215.       and uIdent = UIdent of string
  216.       and wild = Wild of string
  217.     end
  218. #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement