Nominal/nominal_function_core.ML
changeset 2822 23befefc6e73
parent 2821 c7d4bd9e89e0
child 2848 da7e6655cd4c
equal deleted inserted replaced
2821:c7d4bd9e89e0 2822:23befefc6e73
     4     heavily based on the code of Alexander Krauss
     4     heavily based on the code of Alexander Krauss
     5     (code forked on 14 January 2011)
     5     (code forked on 14 January 2011)
     6 
     6 
     7 Core of the nominal function package.
     7 Core of the nominal function package.
     8 *)
     8 *)
     9 
       
    10 
       
    11 structure Nominal_Function_Common =
       
    12 struct
       
    13 
       
    14 
       
    15 (* Configuration management *)
       
    16 datatype nominal_function_opt
       
    17   = Sequential
       
    18   | Default of string
       
    19   | DomIntros
       
    20   | No_Partials
       
    21   | Invariant of string
       
    22 
       
    23 datatype nominal_function_config = NominalFunctionConfig of
       
    24  {sequential: bool,
       
    25   default: string option,
       
    26   domintros: bool,
       
    27   partials: bool,
       
    28   inv: string option}
       
    29 
       
    30 fun apply_opt Sequential (NominalFunctionConfig {sequential, default, domintros, partials, inv}) =
       
    31     NominalFunctionConfig 
       
    32       {sequential=true, default=default, domintros=domintros, partials=partials, inv=inv}
       
    33   | apply_opt (Default d) (NominalFunctionConfig {sequential, default, domintros, partials, inv}) =
       
    34     NominalFunctionConfig 
       
    35       {sequential=sequential, default=SOME d, domintros=domintros, partials=partials, inv=inv}
       
    36   | apply_opt DomIntros (NominalFunctionConfig {sequential, default, domintros, partials, inv}) =
       
    37     NominalFunctionConfig 
       
    38       {sequential=sequential, default=default, domintros=true, partials=partials, inv=inv}
       
    39   | apply_opt No_Partials (NominalFunctionConfig {sequential, default, domintros, partials, inv}) =
       
    40     NominalFunctionConfig 
       
    41       {sequential=sequential, default=default, domintros=domintros, partials=false, inv=inv}
       
    42   | apply_opt (Invariant s) (NominalFunctionConfig {sequential, default, domintros, partials, inv}) =
       
    43     NominalFunctionConfig 
       
    44       {sequential=sequential, default=default, domintros=domintros, partials=partials, inv = SOME s}
       
    45 
       
    46 val nominal_default_config =
       
    47   NominalFunctionConfig { sequential=false, default=NONE,
       
    48     domintros=false, partials=true, inv=NONE}
       
    49 
       
    50 end
       
    51 
     9 
    52 
    10 
    53 signature NOMINAL_FUNCTION_CORE =
    11 signature NOMINAL_FUNCTION_CORE =
    54 sig
    12 sig
    55   val trace: bool Unsynchronized.ref
    13   val trace: bool Unsynchronized.ref