OCaml Preliminary Declaration

Is there a way to make a C style declaration in OCaml?

My problem is that I have two options that are mutually related to each other:

type path_formula =
  [ `Next of state_formula
  | `Until of (state_formula * state_formula)
  | `UntilB of (state_formula * int * state_formula)  
  ]

type state_formula = 
    [ `True | `False
    | `Not of state_formula
    | `And of (state_formula * state_formula)
    | `Or of (state_formula * state_formula)
    | `Imply of (state_formula * state_formula)
    | `Label of string
    | `Prob` of (boundf * path_formula)
    | `Expc` of (boundi * formula)
    ]

Thus, both types must know the other. I searched it on Google, but unfortunately, OCaml is not such a widely used programming language.

+5
source share
1 answer

Using

type T1 = ...
and T2 = ...

have recursive types.

+13
source

All Articles