Session Isabelle_C

Theory C_Lexer_Language

(******************************************************************************
 * Isabelle/C
 *
 * Copyright (c) 2018-2019 Université Paris-Saclay, Univ. Paris-Sud, France
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *
 *     * Redistributions in binary form must reproduce the above
 *       copyright notice, this list of conditions and the following
 *       disclaimer in the documentation and/or other materials provided
 *       with the distribution.
 *
 *     * Neither the name of the copyright holders nor the names of its
 *       contributors may be used to endorse or promote products derived
 *       from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 ******************************************************************************)

section ‹Core Language: Lexing Support, with Filtered Annotations (without Annotation Lexing)›

theory C_Lexer_Language
  imports Main
begin

text ‹
The part implementing the C lexer might resemble to the implementation of the ML one, but the C
syntax is much complex: for example, the preprocessing of directives is implemented with several
parsing layers. Also, we will see that the way antiquotations are handled in C is slightly different
than in ML (especially in the execution part).

Overall, the next ML structures presented here in this theory are all aligned with
🗏‹~~/src/Pure/ROOT.ML›, and are thus accordingly sorted in the same order
(except for 🗏‹~~/src/Pure/ML/ml_options.ML› which is early included in the boot
process).

This theory will stop at 🗏‹~~/src/Pure/ML/ml_lex.ML›. It is basically situated
in the phase 1 of the bootstrap process (of 🗏‹~~/src/Pure/ROOT.ML›), i.e., the
part dealing with how to get some C tokens from a raw string:
ML_text‹Position.T -> string -> token list›.
›

ML ― ‹🗏‹~~/src/Pure/General/scan.ML› structure C_Scan =
struct
datatype ('a, 'b) either = Left of 'a | Right of 'b

fun opt x = Scan.optional x [];
end

ML ― ‹🗏‹~~/src/Pure/General/symbol.ML›
(*  Author:     Frédéric Tuong, Université Paris-Saclay *)
(*  Title:      Pure/General/symbol.ML
    Author:     Makarius

Generalized characters with infinitely many named symbols.
*)
structure C_Symbol =
struct
fun is_ascii_quasi "_" = true
  | is_ascii_quasi "$" = true
  | is_ascii_quasi _ = false;

fun is_identletter s =
  Symbol.is_ascii_letter s orelse is_ascii_quasi s

fun is_ascii_oct s =
  Symbol.is_char s andalso Char.ord #"0" <= ord s andalso ord s <= Char.ord #"7";

fun is_ascii_digit1 s =
  Symbol.is_char s andalso Char.ord #"1" <= ord s andalso ord s <= Char.ord #"9";

fun is_ascii_letdig s =
  Symbol.is_ascii_letter s orelse Symbol.is_ascii_digit s orelse is_ascii_quasi s;

fun is_ascii_identifier s =
  size s > 0 andalso forall_string is_ascii_letdig s;

val is_ascii_blank_no_line =
  fn " " => true | "\t" => true | "\^K" => true | "\f" => true
    | _ => false;
end

ML ― ‹🗏‹~~/src/Pure/General/position.ML› structure C_Position =
struct
type reports_text = Position.report_text list
end

ML ― ‹🗏‹~~/src/Pure/General/symbol_pos.ML›
(*  Author:     Frédéric Tuong, Université Paris-Saclay *)
(*  Title:      Pure/General/symbol_pos.ML
    Author:     Makarius

Symbols with explicit position information.
*)
structure C_Basic_Symbol_Pos =   (*not open by default*)
struct
open Basic_Symbol_Pos;

fun one f = Scan.one (f o Symbol_Pos.symbol)
fun many f = Scan.many (f o Symbol_Pos.symbol)
fun many1 f = Scan.many1 (f o Symbol_Pos.symbol)
val one' = Scan.single o one
fun scan_full !!! mem msg scan =
  scan --| (Scan.ahead (one' (not o mem)) || !!! msg Scan.fail)
fun this_string s =
  (fold (fn s0 => uncurry (fn acc => one (fn s1 => s0 = s1) >> (fn x => x :: acc)))
        (Symbol.explode s)
   o pair [])
  >> rev
val one_not_eof = Scan.one (Symbol.not_eof o #1)
fun unless_eof scan = Scan.unless scan one_not_eof >> single
val repeats_one_not_eof = Scan.repeats o unless_eof
val newline =   $$$ "\n"
             || $$$ "\^M" @@@ $$$ "\n"
             || $$$ "\^M"
val repeats_until_nl = repeats_one_not_eof newline
end

structure C_Symbol_Pos =
struct

(* basic scanners *)

val !!! = Symbol_Pos.!!!

fun !!!! text scan =
  let
    fun get_pos [] = " (end-of-input)"
      | get_pos ((_, pos) :: _) = Position.here pos;

    fun err ((_, syms), msg) = fn () =>
      text () ^ get_pos syms ^
      Markup.markup Markup.no_report (" at " ^ Symbol.beginning 10 (map Symbol_Pos.symbol syms)) ^
      (case msg of NONE => "" | SOME m => "\n" ^ m ());
  in Scan.!! err scan end;

val $$ = Symbol_Pos.$$

val $$$ = Symbol_Pos.$$$

val ~$$$ = Symbol_Pos.~$$$


(* scan string literals *)

local

val char_code =
  Scan.one (Symbol.is_ascii_digit o Symbol_Pos.symbol) --
  Scan.one (Symbol.is_ascii_digit o Symbol_Pos.symbol) --
  Scan.one (Symbol.is_ascii_digit o Symbol_Pos.symbol) :|--
  (fn (((a, pos), (b, _)), (c, _)) =>
    let val (n, _) = Library.read_int [a, b, c]
    in if n <= 255 then Scan.succeed [(chr n, pos)] else Scan.fail end);

fun scan_str q err_prefix stop =
  $$$ "\\" |-- !!! (fn () => err_prefix ^ "bad escape character in string")
    ($$$ q || $$$ "\\" || char_code) ||
  Scan.unless stop
              (Scan.one (fn (s, _) => s <> q andalso s <> "\\" andalso Symbol.not_eof s)) >> single;

fun scan_strs q err_prefix err_suffix stop =
  Scan.ahead ($$ q) |--
    !!! (fn () => err_prefix ^ "unclosed string literal within " ^ err_suffix)
      ((Symbol_Pos.scan_pos --| $$$ q)
       -- (Scan.repeats (scan_str q err_prefix stop) -- ($$$ q |-- Symbol_Pos.scan_pos)));

in

fun scan_string_qq_multi err_prefix stop = scan_strs "\"" err_prefix "the comment delimiter" stop;
fun scan_string_bq_multi err_prefix stop = scan_strs "`" err_prefix "the comment delimiter" stop;
fun scan_string_qq_inline err_prefix =
  scan_strs "\"" err_prefix "the same line" C_Basic_Symbol_Pos.newline;
fun scan_string_bq_inline err_prefix =
  scan_strs "`" err_prefix "the same line" C_Basic_Symbol_Pos.newline;

end;


(* nested text cartouches *)

fun scan_cartouche_depth stop =
  Scan.repeat1 (Scan.depend (fn (depth: int option) =>
    (case depth of
      SOME d =>
        $$ Symbol.open_ >> pair (SOME (d + 1)) ||
          (if d > 0 then
            Scan.unless stop
                        (Scan.one (fn (s, _) => s <> Symbol.close andalso Symbol.not_eof s))
            >> pair depth ||
            $$ Symbol.close >> pair (if d = 1 then NONE else SOME (d - 1))
          else Scan.fail)
    | NONE => Scan.fail)));

fun scan_cartouche err_prefix err_suffix stop =
  Scan.ahead ($$ Symbol.open_) |--
    !!! (fn () => err_prefix ^ "unclosed text cartouche within " ^ err_suffix)
      (Scan.provide is_none (SOME 0) (scan_cartouche_depth stop));

fun scan_cartouche_multi err_prefix stop =
  scan_cartouche err_prefix "the comment delimiter" stop;
fun scan_cartouche_inline err_prefix =
  scan_cartouche err_prefix "the same line" C_Basic_Symbol_Pos.newline;


(* C-style comments *)

local
val par_l = "/"
val par_r = "/"

val scan_body1 = $$$ "*" --| Scan.ahead (~$$$ par_r)
val scan_body2 = Scan.one (fn (s, _) => s <> "*" andalso Symbol.not_eof s) >> single
val scan_cmt =
  Scan.depend (fn (d: int) => $$$ par_l @@@ $$$ "*" >> pair (d + 1)) ||
  Scan.depend (fn 0 => Scan.fail | d => $$$ "*" @@@ $$$ par_r >> pair (d - 1)) ||
  Scan.lift scan_body1 ||
  Scan.lift scan_body2;

val scan_cmts = Scan.pass 0 (Scan.repeats scan_cmt);

in

fun scan_comment err_prefix =
  Scan.ahead ($$ par_l -- $$ "*") |--
    !!! (fn () => err_prefix ^ "unclosed comment")
      ($$$ par_l @@@ $$$ "*" @@@ scan_cmts @@@ $$$ "*" @@@ $$$ par_r)
  || $$$ "/" @@@ $$$ "/" @@@ C_Basic_Symbol_Pos.repeats_until_nl;

fun scan_comment_no_nest err_prefix =
  Scan.ahead ($$ par_l -- $$ "*") |--
    !!! (fn () => err_prefix ^ "unclosed comment")
      ($$$ par_l @@@ $$$ "*" @@@ Scan.repeats (scan_body1 || scan_body2) @@@ $$$ "*" @@@ $$$ par_r)
  || $$$ "/" @@@ $$$ "/" @@@ C_Basic_Symbol_Pos.repeats_until_nl;

val recover_comment =
  $$$ par_l @@@ $$$ "*" @@@ Scan.repeats (scan_body1 || scan_body2);

end
end

ML ― ‹🗏‹~~/src/Pure/General/antiquote.ML›
(*  Author:     Frédéric Tuong, Université Paris-Saclay *)
(*  Title:      Pure/General/antiquote.ML
    Author:     Makarius

Antiquotations within plain text.
*)
structure C_Antiquote =
struct

(* datatype antiquote *)

type antiq = { explicit: bool
             , start: Position.T
             , stop: Position.T option
             , range: Position.range
             , body: Symbol_Pos.T list
             , body_begin: Symbol_Pos.T list
             , body_end: Symbol_Pos.T list }

(* scan *)

open C_Basic_Symbol_Pos;

local

val err_prefix = "Antiquotation lexical error: ";

val par_l = "/"
val par_r = "/"

val scan_body1 = $$$ "*" --| Scan.ahead (~$$$ par_r)
val scan_body1' = $$$ "*" @@@ $$$ par_r
val scan_body2 = Scan.one (fn (s, _) => s <> "*" andalso Symbol.not_eof s) >> single

val scan_antiq_body_multi =
  Scan.trace (C_Symbol_Pos.scan_string_qq_multi err_prefix scan_body1' ||
              C_Symbol_Pos.scan_string_bq_multi err_prefix scan_body1') >> #2 ||
  C_Symbol_Pos.scan_cartouche_multi err_prefix scan_body1' ||
  scan_body1 ||
  scan_body2;

val scan_antiq_body_multi_recover =
  scan_body1 ||
  scan_body2;

val scan_antiq_body_inline =
  Scan.trace (C_Symbol_Pos.scan_string_qq_inline err_prefix ||
              C_Symbol_Pos.scan_string_bq_inline err_prefix) >> #2 ||
  C_Symbol_Pos.scan_cartouche_inline err_prefix ||
  unless_eof newline;

val scan_antiq_body_inline_recover =
  unless_eof newline;

fun control_name sym = (case Symbol.decode sym of Symbol.Control name => name);

fun scan_antiq_multi scan =
  Symbol_Pos.scan_pos
  -- (Scan.trace ($$ par_l |-- $$ "*" |-- scan)
      -- Symbol_Pos.scan_pos
      -- Symbol_Pos.!!! (fn () => err_prefix ^ "missing closing antiquotation")
                        (Scan.repeats scan_antiq_body_multi
                         -- Symbol_Pos.scan_pos
                         -- ($$$ "*" @@@ $$$ par_r)
                         -- Symbol_Pos.scan_pos))

fun scan_antiq_multi_recover scan =
  Symbol_Pos.scan_pos
  -- ($$ par_l |-- $$ "*" |-- scan -- Symbol_Pos.scan_pos --
      (Scan.repeats scan_antiq_body_multi_recover
       -- Symbol_Pos.scan_pos -- ($$ "*" |-- $$ par_r |-- Symbol_Pos.scan_pos)))

fun scan_antiq_inline scan =
  (Symbol_Pos.scan_pos -- Scan.trace ($$ "/" |-- $$ "/" |-- scan)
  -- Symbol_Pos.scan_pos
  -- Scan.repeats scan_antiq_body_inline -- Symbol_Pos.scan_pos)

fun scan_antiq_inline_recover scan =
  (Symbol_Pos.scan_pos --| $$ "/" --| $$ "/" -- scan
  -- Symbol_Pos.scan_pos
  -- Scan.repeats scan_antiq_body_inline_recover -- Symbol_Pos.scan_pos)

in

val scan_control =
  Scan.option (Scan.one (Symbol.is_control o Symbol_Pos.symbol)) --
  Symbol_Pos.scan_cartouche err_prefix >>
    (fn (opt_control, body) =>
      let
        val (name, range) =
          (case opt_control of
            SOME (sym, pos) => ((control_name sym, pos), Symbol_Pos.range ((sym, pos) :: body))
          | NONE => (("cartouche", #2 (hd body)), Symbol_Pos.range body));
      in {name = name, range = range, body = body} end) ||
  Scan.one (Symbol.is_control o Symbol_Pos.symbol) >>
    (fn (sym, pos) =>
      {name = (control_name sym, pos), range = Symbol_Pos.range [(sym, pos)], body = []});

val scan_antiq =
  scan_antiq_multi ($$$ "@" >> K true || scan_body1 >> K false)
  >> (fn (pos1, (((explicit, body_begin), pos2), (((body, pos3), body_end), pos4))) =>
      {explicit = explicit,
       start = Position.range_position (pos1, pos2),
       stop = SOME (Position.range_position (pos3, pos4)),
       range = Position.range (pos1, pos4),
       body = body,
       body_begin = body_begin,
       body_end = body_end}) ||
  scan_antiq_inline ($$$ "@" >> K true || $$$ "*" >> K false)
  >> (fn ((((pos1, (explicit, body_begin)), pos2), body), pos3) => 
      {explicit = explicit,
       start = Position.range_position (pos1, pos2),
       stop = NONE,
       range = Position.range (pos1, pos3),
       body = body,
       body_begin = body_begin,
       body_end = []})

val scan_antiq_recover =
  scan_antiq_multi_recover ($$$ "@" >> K true || scan_body1 >> K false)
    >> (fn (_, ((explicit, _), _)) => explicit)
  ||
  scan_antiq_inline_recover ($$$ "@" >> K true || $$$ "*" >> K false)
   >> (fn ((((_, explicit), _), _), _) => explicit)

end;

end;

ML ― ‹🗏‹~~/src/Pure/ML/ml_options.ML›
(*  Author:     Frédéric Tuong, Université Paris-Saclay *)
(*  Title:      Pure/ML/ml_options.ML
    Author:     Makarius

ML configuration options.
*)
structure C_Options =
struct

(* source trace *)

val lexer_trace = Attrib.setup_config_bool @{binding C_lexer_trace} (K false);
val parser_trace = Attrib.setup_config_bool @{binding C_parser_trace} (K false);
val ML_verbose = Attrib.setup_config_bool @{binding C_ML_verbose} (K true);
val starting_env = Attrib.setup_config_string @{binding C_starting_env} (K "empty");
val starting_rule = Attrib.setup_config_string @{binding C_starting_rule} (K "translation_unit");

end

ML ― ‹🗏‹~~/src/Pure/ML/ml_lex.ML›
(*  Author:     Frédéric Tuong, Université Paris-Saclay *)
(*  Title:      Pure/ML/ml_lex.ML
    Author:     Makarius

Lexical syntax for Isabelle/ML and Standard ML.
*)
structure C_Lex =
struct

open C_Scan;
open C_Basic_Symbol_Pos;


(** keywords **)

val keywords =
 ["(",
  ")",
  "[",
  "]",
  "->",
  ".",
  "!",
  "~",
  "++",
  "--",
  "+",
  "-",
  "*",
  "/",
  "%",
  "&",
  "<<",
  ">>",
  "<",
  "<=",
  ">",
  ">=",
  "==",
  "!=",
  "^",
  "|",
  "&&",
  "||",
  "?",
  ":",
  "=",
  "+=",
  "-=",
  "*=",
  "/=",
  "%=",
  "&=",
  "^=",
  "|=",
  "<<=",
  ">>=",
  ",",
  ";",
  "{",
  "}",
  "...",
  (**)
  "_Alignas",
  "_Alignof",
  "__alignof",
  "alignof",
  "__alignof__",
  "__asm",
  "asm",
  "__asm__",
  "_Atomic",
  "__attribute",
  "__attribute__",
  "auto",
  "_Bool",
  "break",
  "__builtin_offsetof",
  "__builtin_types_compatible_p",
  "__builtin_va_arg",
  "case",
  "char",
  "_Complex",
  "__complex__",
  "__const",
  "const",
  "__const__",
  "continue",
  "default",
  "do",
  "double",
  "else",
  "enum",
  "__extension__",
  "extern",
  "float",
  "for",
  "_Generic",
  "goto",
  "if",
  "__imag",
  "__imag__",
  "__inline",
  "inline",
  "__inline__",
  "int",
  "__int128",
  "__label__",
  "long",
  "_Nonnull",
  "__nonnull",
  "_Noreturn",
  "_Nullable",
  "__nullable",
  "__real",
  "__real__",
  "register",
  "__restrict",
  "restrict",
  "__restrict__",
  "return",
  "short",
  "__signed",
  "signed",
  "__signed__",
  "sizeof",
  "static",
  "_Static_assert",
  "struct",
  "switch",
  "__thread",
  "_Thread_local",
  "typedef",
  "__typeof",
  "typeof",
  "__typeof__",
  "union",
  "unsigned",
  "void",
  "__volatile",
  "volatile",
  "__volatile__",
  "while"];

val keywords2 =
 ["__asm",
  "asm",
  "__asm__",
  "extern"];

val keywords3 =
 ["_Bool",
  "char",
  "double",
  "float",
  "int",
  "__int128",
  "long",
  "short",
  "__signed",
  "signed",
  "__signed__",
  "unsigned",
  "void"];

val lexicon = Scan.make_lexicon (map raw_explode keywords);



(** tokens **)

(* datatype token *)

datatype token_kind_comment =
   Comment_formal of C_Antiquote.antiq
 | Comment_suspicious of (bool * string * ((Position.T * Markup.T) * string) list) option

datatype token_kind_encoding =
   Encoding_L
 | Encoding_default
 | Encoding_file of string (* error message *) option

type token_kind_string =
  token_kind_encoding
  * (Symbol.symbol, Position.range * int ― ‹exceeding ML‹Char.maxOrd›) either list

datatype token_kind_int_repr = Repr_decimal
                             | Repr_hexadecimal
                             | Repr_octal

datatype token_kind_int_flag = Flag_unsigned
                             | Flag_long
                             | Flag_long_long
                             | Flag_imag

datatype token_kind =
  Keyword | Ident | Type_ident | GnuC | ClangC |
  (**)
  Char of token_kind_string |
  Integer of int * token_kind_int_repr * token_kind_int_flag list |
  Float of Symbol_Pos.T list |
  String of token_kind_string |
  File of token_kind_string |
  (**)
  Space | Comment of token_kind_comment | Sharp of int |
  (**)
  Unknown | Error of string * token_group | Directive of token_kind_directive | EOF

and token_kind_directive = Inline of token_group (* a not yet analyzed directive *)
                         | Include of token_group
                         | Define of token_group (* define *)
                                   * token_group (* name *)
                                   * token_group option (* functional arguments *)
                                   * token_group (* rewrite body *)
                         | Undef of token_group (* name *)
                         | Cpp of token_group
                         | Conditional of token_group (* if *)
                                        * token_group list (* elif *)
                                        * token_group option (* else *)
                                        * token_group (* endif *)

and token_group = Group1 of token list (* spaces and comments filtered from the directive *)
                          * token list (* directive: raw data *)
                | Group2 of token list (* spaces and comments filtered from the directive *)
                          * token list (* directive: function *)
                          * token list (* directive: arguments (same line) *)
                | Group3 of (  Position.range (* full directive (with blanks) *)
                             * token list (* spaces and comments filtered from the directive *)
                             * token list (* directive: function *)
                             * token list (* directive: arguments (same line) *))
                          * (Position.range * token list) (* C code or directive:
                                                               arguments (following lines) *)

and token = Token of Position.range * (token_kind * string);


(* position *)

fun set_range range (Token (_, x)) = Token (range, x);
fun range_of (Token (range, _)) = range;

val pos_of = #1 o range_of;
val end_pos_of = #2 o range_of;


(* stopper *)

fun mk_eof pos = Token ((pos, Position.none), (EOF, ""));
val eof = mk_eof Position.none;

fun is_eof (Token (_, (EOF, _))) = true
  | is_eof _ = false;

val stopper =
  Scan.stopper (fn [] => eof | toks => mk_eof (end_pos_of (List.last toks))) is_eof;

val one_not_eof = Scan.one (not o is_eof)

(* token content *)

fun kind_of (Token (_, (k, _))) = k;

val group_list_of = fn
   Inline g => [g]
 | Include g => [g]
 | Define (g1, g2, o_g3, g4) => flat [[g1], [g2], the_list o_g3, [g4]]
 | Undef g => [g]
 | Cpp g => [g]
 | Conditional (g1, gs2, o_g3, g4) => flat [[g1], gs2, the_list o_g3, [g4]]

fun content_of (Token (_, (_, x))) = x;
fun token_leq (tok, tok') = content_of tok <= content_of tok';

val directive_cmds = fn
   Inline (Group1 (_, _ :: tok2 :: _)) => [tok2]
 | Include (Group2 (_, [_, tok2], _)) => [tok2]
 | Define (Group1 (_, [_, tok2]), _, _, _) => [tok2]
 | Undef (Group2 (_, [_, tok2], _)) => [tok2]
 | Conditional (c1, cs2, c3, c4) =>
     maps (fn Group3 ((_, _, [_, tok2], _), _) => [tok2]
            | _ => error "Only expecting Group3")
          (flat [[c1], cs2, the_list c3, [c4]])
 | _ => []

fun is_keyword (Token (_, (Keyword, _))) = true
  | is_keyword _ = false;

fun is_ident (Token (_, (Ident, _))) = true
  | is_ident _ = false;

fun is_integer (Token (_, (Integer _, _))) = true
  | is_integer _ = false;

fun is_delimiter (Token (_, (Keyword, x))) = not (C_Symbol.is_ascii_identifier x)
  | is_delimiter _ = false;

(* range *)

val range_list_of0 =
 fn [] => Position.no_range
  | toks as tok1 :: _ => Position.range (pos_of tok1, end_pos_of (List.last toks))
    (* WARNING the use of:
       ―‹MLfn content_of => fn pos_of => fn tok2 =>
             List.last (Symbol_Pos.explode (content_of tok2, pos_of tok2)) |-> Position.advance››
       would not return an accurate position if for example several
       "backslash newlines" are present in the symbol *)

fun range_list_of toks = (range_list_of0 toks, toks)
fun range_list_of' toks1 toks2 = (range_list_of0 toks1, toks2)

local
fun cmp_pos x2 x1 = case Position.distance_of (pos_of x2, pos_of x1) of SOME dist => dist < 0
                                                                      | NONE => error "cmp_pos"

fun merge_pos xs = case xs of (xs1, []) => xs1
                            | ([], xs2) => xs2
                            | (x1 :: xs1, x2 :: xs2) =>
                                let val (x, xs) = if cmp_pos x2 x1 then (x1, (xs1, x2 :: xs2))
                                                                   else (x2, (x1 :: xs1, xs2))
                                in x :: merge_pos xs end
in
fun merge_blank toks_bl xs1 xs2 =
  let val cmp_tok2 = cmp_pos (List.last xs1)
  in ( range_list_of (merge_pos (xs1, filter cmp_tok2 toks_bl))
     , range_list_of (merge_pos (xs2, filter_out cmp_tok2 toks_bl)))
  end
end

val token_list_of = 
  let fun merge_blank' toks_bl xs1 xs2 =
    let val ((_, l1), (_, l2)) = merge_blank toks_bl xs1 xs2
    in [l1, l2] end
  in group_list_of
    #> maps (fn
        Group1 (toks_bl, []) => [toks_bl]
      | Group1 (toks_bl, xs1) => merge_blank' toks_bl xs1 []
      | Group2 (toks_bl, xs1, xs2) => merge_blank' toks_bl xs1 xs2
      | Group3 ((_, toks_bl, xs1, xs2), (_, xs3)) => flat [merge_blank' toks_bl xs1 xs2, [xs3]])
    #> flat
  end

local

fun warn0 pos l s =
  ()
  |> tap
       (fn _ =>
        if exists (fn Left s => not (Symbol.is_printable s) | _ => false) l then
          app (fn (s, pos) =>
                if Symbol.is_printable s
                then ()
                else Output.information ("Not printable character " ^ @{make_string} (ord s, s)
                                         ^ Position.here pos))
              (Symbol_Pos.explode (s, pos))
        else ())
  |> tap
       (fn _ =>
        app (fn Left _ => ()
              | Right ((pos1, _), n) =>
                  Output.information
                    ("Out of the supported range (character number " ^ Int.toString n ^ ")"
                     ^ Position.here pos1))
            l)



fun unknown pos = Output.information ("Unknown symbol" ^ Position.here pos)

val app_directive =
      app (fn Token (_, (Error (msg, _), _)) => warning msg
            | Token ((pos, _), (Unknown, _)) => unknown pos
            | _ => ())

in
val warn = fn
    Token ((pos, _), (Char (_, l), s)) => warn0 pos l s
  | Token ((pos, _), (String (_, l), s)) => warn0 pos l s
  | Token ((pos, _), (File (_, l), s)) => warn0 pos l s
  | Token ((pos, _), (Unknown, _)) => unknown pos
  | Token (_, (Comment (Comment_suspicious (SOME (explicit, msg, _))), _)) =>
      (if explicit then warning else tracing) msg
  | Token (_, (Directive (kind as Conditional _), _)) => app_directive (token_list_of kind)
  | Token (_, (Directive (Define (_, _, _, Group1 (_, toks4))), _)) => app_directive toks4
  | Token (_, (Directive (Include (Group2 (_, _, toks))), _)) =>
    (case toks of
       [Token (_, (String _, _))] => ()
     | [Token (_, (File _, _))] => ()
     | _ => Output.information
              ("Expecting at least and at most one file"
               ^ Position.here
                   (Position.range_position (pos_of (hd toks), end_pos_of (List.last toks)))))
  | _ => ();
end

fun check_error tok =
  case kind_of tok of
    Error (msg, _) => [msg]
  | _ => [];

(* markup *)

local

val token_kind_markup0 =
 fn Char _ => (Markup.ML_char, "")
  | Integer _ => (Markup.ML_numeral, "")
  | Float _ => (Markup.ML_numeral, "")
  | ClangC => (Markup.ML_numeral, "")
  | String _ => (Markup.ML_string, "")
  | File _ => (Markup.ML_string, "")
  | Sharp _ => (Markup.antiquote, "")
  | Unknown => (Markup.intensify, "")
  | Error (msg, _) => (Markup.bad (), msg)
  | _ => (Markup.empty, "");

fun token_report' escape_directive (tok as Token ((pos, _), (kind, x))) =
  if escape_directive andalso (is_keyword tok orelse is_ident tok) then
    [((pos, Markup.antiquote), "")]
  else if is_keyword tok then
    let
      val (markup, txt) = if is_delimiter tok then (Markup.ML_delimiter, "")
        else if member (op =) keywords2 x then (Markup.ML_keyword2 |> Markup.keyword_properties, "")
        else if member (op =) keywords3 x then (Markup.ML_keyword3 |> Markup.keyword_properties, "")
        else (Markup.ML_keyword1 |> Markup.keyword_properties, "");
    in [((pos, markup), txt)] end
  else
    case kind of
     Directive (tokens as Inline _) =>
       ((pos, Markup.antiquoted), "") :: maps token_report0 (token_list_of tokens)
   | Directive (Include (Group2 (toks_bl, tok1 :: _, toks2))) =>
       ((pos, Markup.antiquoted), "")
       :: flat [ maps token_report1 [tok1]
               , maps token_report0 toks2
               , maps token_report0 toks_bl ]
   | Directive
       (Define
         (Group1 (toks_bl1, tok1 :: _), Group1 (toks_bl2, _), toks3, Group1 (toks_bl4, toks4))) =>
       let val (toks_bl3, toks3) = case toks3 of SOME (Group1 x) => x | _ => ([], [])
       in ((pos, Markup.antiquoted), "")
         :: ((range_list_of0 toks4 |> #1, Markup.intensify), "")
         :: flat [ maps token_report1 [tok1]
                 , maps token_report0 toks3
                 , maps token_report0 toks4
                 , maps token_report0 toks_bl1
                 , maps token_report0 toks_bl2
                 , map (fn tok => ((pos_of tok, Markup.antiquote), "")) toks_bl3
                 , maps token_report0 toks_bl4 ] end
   | Directive (Undef (Group2 (toks_bl, tok1 :: _, _))) =>
       ((pos, Markup.antiquoted), "")
       :: flat [ maps token_report1 [tok1]
               , maps token_report0 toks_bl ]
   | Directive (Cpp (Group2 (toks_bl, toks1, toks2))) =>
       ((pos, Markup.antiquoted), "")
       :: flat [ maps token_report1 toks1
               , maps token_report0 toks2
               , maps token_report0 toks_bl ]
   | Directive (Conditional (c1, cs2, c3, c4)) =>
       maps (fn Group3 (((pos, _), toks_bl, tok1 :: _, toks2), ((pos3, _), toks3)) => 
                ((pos, Markup.antiquoted), "")
                :: ((pos3, Markup.intensify), "")
                :: flat [ maps token_report1 [tok1]
                        , maps token_report0 toks2
                        , maps token_report0 toks3
                        , maps token_report0 toks_bl ]
              | _ => error "Only expecting Group3")
            (flat [[c1], cs2, the_list c3, [c4]])
   | Error (msg, Group2 (toks_bl, toks1, toks2)) =>
        ((range_list_of0 toks1 |> #1, Markup.bad ()), msg)
        :: ((pos, Markup.antiquoted), "")
        :: flat [ maps token_report1 toks1
                , maps token_report0 toks2
                , maps token_report0 toks_bl ]
   | Error (msg, Group3 ((_, toks_bl, toks1, toks2), _)) =>
        ((range_list_of0 toks1 |> #1, Markup.bad ()), msg)
        :: ((pos, Markup.antiquoted), "")
        :: flat [ maps token_report1 toks1
                , maps token_report0 toks2
                , maps token_report0 toks_bl ]
   | Comment (Comment_suspicious c) => ((pos, Markup.ML_comment), "")
                                       :: (case c of NONE => [] | SOME (_, _, l) => l)
   | x => [let val (markup, txt) = token_kind_markup0 x in ((pos, markup), txt) end]

and token_report0 tok = token_report' false tok
and token_report1 tok = token_report' true tok

in
val token_report = token_report0
end;



(** scanners **)

val err_prefix = "C lexical error: ";

fun !!! msg = Symbol_Pos.!!! (fn () => err_prefix ^ msg);

fun !!!! msg = C_Symbol_Pos.!!!! (fn () => err_prefix ^ msg);

val many1_blanks_no_line = many1 C_Symbol.is_ascii_blank_no_line

(* identifiers *)

val scan_ident_sym =
  let val hex = one' Symbol.is_ascii_hex
  in   one' C_Symbol.is_identletter
    || $$$ "\\" @@@ $$$ "u" @@@ hex @@@ hex @@@ hex @@@ hex
    || $$$ "\\" @@@ $$$ "U" @@@ hex @@@ hex @@@ hex @@@ hex @@@ hex @@@ hex @@@ hex @@@ hex
    || one' Symbol.is_symbolic
    || one' Symbol.is_control
    || one' Symbol.is_utf8
  end
  
val scan_ident =
      scan_ident_sym
  @@@ Scan.repeats (scan_ident_sym || one' Symbol.is_ascii_digit);

val keywords_ident =
  map_filter
    (fn s => 
         Source.of_list (Symbol_Pos.explode (s, Position.none))
      |> Source.source
           Symbol_Pos.stopper
           (Scan.bulk (scan_ident >> SOME || Scan.one (not o Symbol_Pos.is_eof) >> K NONE))
      |> Source.exhaust
      |> (fn [SOME _] => SOME s | _ => NONE))
    keywords

(* numerals *)

fun read_bin s = #1 (read_radix_int 2 s)
fun read_oct s = #1 (read_radix_int 8 s)
fun read_dec s = #1 (read_int s)
val read_hex =
  let fun conv_ascii c1 c0 = String.str (Char.chr (Char.ord #"9" + Char.ord c1 - Char.ord c0 + 1))
  in map (fn s => let val c = String.sub (s, 0) in
                  if c >= #"A" andalso c <= #"F" then
                    conv_ascii c #"A"
                  else if c >= #"a" andalso c <= #"f" then
                    conv_ascii c #"a"
                  else s
                  end)
  #> read_radix_int 16
  #> #1
  end

local
val many_digit = many Symbol.is_ascii_digit
val many1_digit = many1 Symbol.is_ascii_digit
val many_hex = many Symbol.is_ascii_hex
val many1_hex = many1 Symbol.is_ascii_hex

val scan_suffix_ll = ($$$ "l" @@@ $$$ "l" || $$$ "L" @@@ $$$ "L") >> K [Flag_long_long]
fun scan_suffix_gnu flag = ($$$ "i" || $$$ "j") >> K [flag]
val scan_suffix_int = 
  let val u = ($$$ "u" || $$$ "U") >> K [Flag_unsigned]
      val l = ($$$ "l" || $$$ "L") >> K [Flag_long] in
      u @@@ scan_suffix_ll
   || scan_suffix_ll @@@ opt u
   || u @@@ opt l
   || l @@@ opt u
  end

val scan_suffix_gnu_int0 = scan_suffix_gnu Flag_imag
val scan_suffix_gnu_int = scan_full !!!
                                    (member (op =) (raw_explode "uUlLij"))
                                    "Invalid integer constant suffix"
                                    (   scan_suffix_int @@@ opt scan_suffix_gnu_int0
                                     || scan_suffix_gnu_int0 @@@ opt scan_suffix_int)

fun scan_intgnu x =
  x -- opt scan_suffix_gnu_int
  >> (fn ((s1', read, repr), l) => (read (map (Symbol_Pos.content o single) s1'), repr, l))

val scan_intoct = scan_intgnu ($$ "0" |--
                               scan_full
                                 !!!
                                 Symbol.is_ascii_digit
                                 "Invalid digit in octal constant"
                                 (Scan.max
                                   (fn ((xs2, _, _), (xs1, _, _)) => length xs2 < length xs1)
                                   (many C_Symbol.is_ascii_oct
                                      >> (fn xs => (xs, read_oct, Repr_octal)))
                                   (many (fn x => x = "0")
                                      >> (fn xs => (xs, read_dec, Repr_decimal)))))
val scan_intdec = scan_intgnu (one C_Symbol.is_ascii_digit1 -- many Symbol.is_ascii_digit
                               >> (fn (x, xs) => (x :: xs, read_dec, Repr_decimal)))
val scan_inthex = scan_intgnu (($$ "0" -- ($$ "x" || $$ "X")) |-- many1_hex
                               >> (fn xs2 => (xs2, read_hex, Repr_hexadecimal)))

(**)

fun scan_signpart a A = ($$$ a || $$$ A) @@@ opt ($$$ "+" || $$$ "-") @@@ many1_digit
val scan_exppart = scan_signpart "e" "E"

val scan_suffix_float = $$$ "f" || $$$ "F" || $$$ "l" || $$$ "L"
val scan_suffix_gnu_float0 = Scan.trace (scan_suffix_gnu ()) >> #2
val scan_suffix_gnu_float = scan_full !!!
                                      (member (op =) (raw_explode "fFlLij"))
                                      "Invalid float constant suffix"
                                      (   scan_suffix_float @@@ opt scan_suffix_gnu_float0
                                       || scan_suffix_gnu_float0 @@@ opt scan_suffix_float)

val scan_hex_pref = $$$ "0" @@@ $$$ "x"

val scan_hexmant = many_hex @@@ $$$ "." @@@ many1_hex
                || many1_hex @@@ $$$ "."
val scan_floatdec =
      (       (   many_digit @@@ $$$ "." @@@ many1_digit
               || many1_digit @@@ $$$ ".")
          @@@ opt scan_exppart
       || many1_digit @@@ scan_exppart)
  @@@ opt scan_suffix_gnu_float

val scan_floathex = scan_hex_pref @@@ (scan_hexmant || many1_hex)
                    @@@ scan_signpart "p" "P" @@@ opt scan_suffix_gnu_float
val scan_floatfail = scan_hex_pref @@@ scan_hexmant
in
val scan_int = scan_inthex
            || scan_intoct
            || scan_intdec

val recover_int =
     many1 (fn s => Symbol.is_ascii_hex s orelse member (op =) (raw_explode "xXuUlLij") s)

val scan_float = scan_floatdec
              || scan_floathex
              || scan_floatfail @@@ !!! "Hexadecimal floating constant requires an exponent"
                                        Scan.fail

val scan_clangversion = many1_digit @@@ $$$ "." @@@ many1_digit @@@ $$$ "." @@@ many1_digit

end;


(* chars and strings *)

val scan_blanks1 = many1 Symbol.is_ascii_blank

local
val escape_char = [ ("n", #"\n")
                  , ("t", #"\t")
                  , ("v", #"\v")
                  , ("b", #"\b")
                  , ("r", #"\r")
                  , ("f", #"\f")
                  , ("a", #"\a")
                  , ("e", #"\^[")
                  , ("E", #"\^[")
                  , ("\\", #"\\")
                  , ("?", #"?")
                  , ("'", #"'")
                  , ("\"", #"\"") ]

val _ = ― ‹printing a ML function translating code point from ML_type‹int -> string›
 fn _ => 
  app (fn (x0, x) => writeln (" | "
                              ^ string_of_int (Char.ord x)
                              ^ " => \"\\\\"
                              ^ (if exists (fn x1 => x0 = x1) ["\"", "\\"] then "\\" ^ x0 else x0)
                              ^ "\""))
      escape_char

fun scan_escape s0 =
  let val oct = one' C_Symbol.is_ascii_oct
      val hex = one' Symbol.is_ascii_hex
      fun chr' f l =
        let val x = f (map Symbol_Pos.content l)
        in [if x <= Char.maxOrd then Left (chr x) else Right (Symbol_Pos.range (flat l), x)] end
      val read_oct' = chr' read_oct
      val read_hex' = chr' read_hex
  in one' (member (op =) (raw_explode (s0 ^ String.concat (map #1 escape_char))))
     >> (fn i =>
          [Left (case AList.lookup (op =) escape_char (Symbol_Pos.content i) of
                   NONE => s0
                 | SOME c => String.str c)])
  || oct -- oct -- oct >> (fn ((o1, o2), o3) => read_oct' [o1, o2, o3])
  || oct -- oct >> (fn (o1, o2) => read_oct' [o1, o2])
  || oct >> (read_oct' o single)
  || $$ "x" |-- many1 Symbol.is_ascii_hex
     >> (read_hex' o map single)
  || $$ "u" |-- hex -- hex -- hex -- hex
     >> (fn (((x1, x2), x3), x4) => read_hex' [x1, x2, x3, x4])
  || $$ "U" |-- hex -- hex -- hex -- hex -- hex -- hex -- hex -- hex
     >> (fn (((((((x1, x2), x3), x4), x5), x6), x7), x8) =>
          read_hex' [x1, x2, x3, x4, x5, x6, x7, x8])
  end

fun scan_str s0 =
     Scan.unless newline
                 (Scan.one (fn (s, _) => Symbol.not_eof s andalso s <> s0 andalso s <> "\\"))
     >> (fn s => [Left (#1 s)])
  || Scan.ahead newline |-- !!! "bad newline" Scan.fail
  || $$ "\\" |-- !!! "bad escape character" (scan_escape s0);

fun scan_string0 s0 msg repeats =
  Scan.optional ($$ "L" >> K Encoding_L) Encoding_default --
    (Scan.ahead ($$ s0) |--
      !!! ("unclosed " ^ msg ^ " literal")
        ($$ s0 |-- repeats (scan_str s0) --| $$ s0))

fun recover_string0 s0 repeats =
  opt ($$$ "L") @@@ $$$ s0 @@@ repeats (Scan.permissive (Scan.trace (scan_str s0) >> #2));
in

val scan_char = scan_string0 "'" "char" Scan.repeats1
val scan_string = scan_string0 "\"" "string" Scan.repeats
fun scan_string' src =
  case
    Source.source
      Symbol_Pos.stopper
      (Scan.recover (Scan.bulk (!!! "bad input" scan_string >> K NONE))
                    (fn msg => C_Basic_Symbol_Pos.one_not_eof >> K [SOME msg]))
      (Source.of_list src)
    |> Source.exhaust
  of
      [NONE] => NONE
    | [] => SOME "Empty input"
    | l => case map_filter I l of msg :: _ => SOME msg
                                | _ => SOME "More than one string"
val scan_file =
  let fun scan !!! s_l s_r =
    Scan.ahead ($$ s_l) |--
          !!!
          ($$ s_l
           |-- Scan.repeats
                 (Scan.unless newline
                              (Scan.one (fn (s, _) => Symbol.not_eof s andalso s <> s_r)
                               >> (fn s => [Left (#1 s)])))
           --| $$ s_r)
  in
     Scan.trace (scan (!!! ("unclosed file literal")) "\"" "\"")
       >> (fn (s, src) => String (Encoding_file (scan_string' src), s))
  || scan I ― ‹Due to conflicting symbols, raising ML‹Symbol_Pos.!!!› here will not let a potential
                legal ML"<" symbol be tried and parsed as a ‹keyword›.›
            "<" ">" >> (fn s => File (Encoding_default, s))
  end

val recover_char = recover_string0 "'" Scan.repeats1
val recover_string = recover_string0 "\"" Scan.repeats

end;

(* scan tokens *)

val check = fold (tap warn #> fold cons o check_error)

local

fun token k ss = Token (Symbol_Pos.range ss, (k, Symbol_Pos.content ss));
fun scan_token f1 f2 = Scan.trace f1 >> (fn (v, s) => token (f2 v) s)

val comments =
     Scan.recover
       (scan_token C_Antiquote.scan_antiq (Comment o Comment_formal))
       (fn msg => Scan.ahead C_Antiquote.scan_antiq_recover
                  -- C_Symbol_Pos.scan_comment_no_nest err_prefix
                  >> (fn (explicit, res) =>
                       token (Comment (Comment_suspicious (SOME (explicit, msg, [])))) res)
               || Scan.fail_with (fn _ => fn _ => msg))
  || C_Symbol_Pos.scan_comment_no_nest err_prefix >> token (Comment (Comment_suspicious NONE))

fun scan_fragment blanks comments sharps non_blanks =
     non_blanks (scan_token scan_char Char)
  || non_blanks (scan_token scan_string String)
  || blanks
  || comments
  || non_blanks sharps
  || non_blanks (Scan.max token_leq (Scan.literal lexicon >> token Keyword)
                                    (   scan_clangversion >> token ClangC
                                     || scan_token scan_float Float
                                     || scan_token scan_int Integer
                                     || scan_ident >> token Ident))
  || non_blanks (Scan.one (Symbol.is_printable o #1) >> single >> token Unknown)

(* scan tokens, directive part *)

val scan_sharp1 = $$$ "#"
val scan_sharp2 = $$$ "#" @@@ $$$ "#"

val scan_directive =
  let val f_filter = fn Token (_, (Space, _)) => true
                      | Token (_, (Comment _, _)) => true
                      | Token (_, (Error _, _)) => true
                      | _ => false
      val sharp1 = scan_sharp1 >> token (Sharp 1)
  in    (sharp1 >> single)
    @@@ Scan.repeat (   scan_token scan_file I
                     || scan_fragment (many1_blanks_no_line >> token Space)
                                      comments
                                      (scan_sharp2 >> token (Sharp 2) || sharp1)
                                      I)
    >> (fn tokens => Inline (Group1 (filter f_filter tokens, filter_out f_filter tokens)))
  end

local
fun !!! text scan =
  let
    fun get_pos [] = " (end-of-input)"
      | get_pos (t :: _) = Position.here (pos_of t);

    fun err (syms, msg) = fn () =>
      err_prefix ^ text ^ get_pos syms ^
      (case msg of NONE => "" | SOME m => "\n" ^ m ());
  in Scan.!! err scan end

val pos_here_of = Position.here o pos_of

fun one_directive f =
  Scan.one (fn Token (_, (Directive ( Inline (Group1 (_, Token (_, (Sharp 1, _))
                                                         :: Token (_, s)
                                                         :: _)))
                                    , _))
                 => f s
             | _ => false)

val get_cond = fn Token (pos, (Directive (Inline (Group1 (toks_bl, tok1 :: tok2 :: toks))), _)) =>
                    (fn t3 => Group3 ((pos, toks_bl, [tok1, tok2], toks), range_list_of t3))
                | _ => error "Inline directive expected"

val one_start_cond = one_directive (fn (Keyword, "if") => true
                                     | (Ident, "ifdef") => true
                                     | (Ident, "ifndef") => true
                                     | _ => false)
val one_elif = one_directive (fn (Ident, "elif") => true | _ => false)
val one_else = one_directive (fn (Keyword, "else") => true | _ => false)
val one_endif = one_directive (fn (Ident, "endif") => true | _ => false)

val not_cond =
 Scan.unless
  (one_start_cond || one_elif || one_else || one_endif)
  (one_not_eof
   >>
    (fn Token (pos, ( Directive (Inline (Group1 ( toks_bl
                                                , (tok1 as Token (_, (Sharp _, _)))
                                                  :: (tok2 as Token (_, (Ident, "include")))
                                                  :: toks)))
                    , s)) =>
          Token (pos, ( case toks of [] =>
                          Error ( "Expecting at least one file"
                                  ^ Position.here (end_pos_of tok2)
                                , Group2 (toks_bl, [tok1, tok2], toks))
                        | _ => Directive (Include (Group2 (toks_bl, [tok1, tok2], toks)))
                      , s))
      | Token (pos, ( Directive (Inline (Group1 ( toks_bl
                                                , (tok1 as Token (_, (Sharp _, _)))
                                                  :: (tok2 as Token (_, (Ident, "define")))
                                                  :: toks)))
                    , s)) =>
         let
          fun define tok3 toks = 
           case
             case toks of
               (tok3' as Token (pos, (Keyword, "("(*)*)))) :: toks => 
                 if Position.offset_of (end_pos_of tok3) = Position.offset_of (pos_of tok3')
                 then
                  let
                    fun right msg pos = Right (msg ^ Position.here pos)
                    fun right1 msg = right msg o #1
                    fun right2 msg = right msg o #2
                    fun take_prefix' toks_bl toks_acc pos =
                     fn
                       (tok1 as Token (_, (Ident, _)))
                       :: (tok2 as Token (pos2, (Keyword, key)))
                       :: toks =>
                         if key = ","
                         then take_prefix' (tok2 :: toks_bl) (tok1 :: toks_acc) pos2 toks
                         else if key = (*( *)")" then
                           Left (rev (tok2 :: toks_bl), rev (tok1 :: toks_acc), toks)
                         else
                           right1 "Expecting a colon delimiter or a closing parenthesis" pos2
                     | Token (pos1, (Ident, _)) :: _ =>
                         right2 "Expecting a colon delimiter or a closing parenthesis" pos1
                     | (tok1 as Token (_, (Keyword, key1)))
                       :: (tok2 as Token (pos2, (Keyword, key2)))
                       :: toks =>
                         if key1 = "..." then
                           if key2 = (*( *)")"
                           then Left (rev (tok2 :: toks_bl), rev (tok1 :: toks_acc), toks)
                           else right1 "Expecting a closing parenthesis" pos2
                         else right2 "Expecting an identifier or the keyword '...'" pos
                     | _ => right2 "Expecting an identifier or the keyword '...'" pos
                  in case
                      case toks of
                        (tok2 as Token (_, (Keyword, (*( *)")"))) :: toks => Left ([tok2], [], toks)
                      | _ => take_prefix' [] [] pos toks
                     of Left (toks_bl, toks_acc, toks) =>
                          Left (SOME (Group1 (tok3' :: toks_bl, toks_acc)), Group1 ([], toks))
                      | Right x => Right x
                  end
                 else Left (NONE, Group1 ([], tok3' :: toks))
             | _ => Left (NONE, Group1 ([], toks))
           of Left (gr1, gr2) =>
                Directive (Define (Group1 (toks_bl, [tok1, tok2]), Group1 ([], [tok3]), gr1, gr2))
            | Right msg => Error (msg, Group2 (toks_bl, [tok1, tok2], tok3 :: toks))
          fun err () = Error ( "Expecting at least one identifier" ^ Position.here (end_pos_of tok2)
                             , Group2 (toks_bl, [tok1, tok2], toks))
         in
           Token (pos, ( case toks of
                           (tok3 as Token (_, (Ident, _))) :: toks => define tok3 toks
                         | (tok3 as Token (_, (Keyword, cts))) :: toks =>
                             if exists (fn cts0 => cts = cts0) keywords_ident
                             then define tok3 toks
                             else err ()
                         | _ => err ()
                       , s))
         end
      | Token (pos, ( Directive (Inline (Group1 ( toks_bl
                                                , (tok1 as Token (_, (Sharp _, _)))
                                                  :: (tok2 as Token (_, (Ident, "undef")))
                                                  :: toks)))
                    , s)) =>
          Token (pos, ( let fun err () = Error ( "Expecting at least and at most one identifier"
                                                 ^ Position.here (end_pos_of tok2)
                                               , Group2 (toks_bl, [tok1, tok2], toks))
                        in
                          case toks of
                            [Token (_, (Ident, _))] =>
                              Directive (Undef (Group2 (toks_bl, [tok1, tok2], toks)))
                          | [Token (_, (Keyword, cts))] =>
                              if exists (fn cts0 => cts = cts0) keywords_ident
                              then Directive (Undef (Group2 (toks_bl, [tok1, tok2], toks)))
                              else err ()
                          | _ => err ()
                        end
                      , s))
      | Token (pos, ( Directive (Inline (Group1 ( toks_bl
                                                , (tok1 as Token (_, (Sharp _, _)))
                                                  :: (tok2 as Token (_, (Integer _, _)))
                                                  :: (tok3 as Token (_, (String _, _)))
                                                  :: toks)))
                    , s)) =>
          Token (pos, ( if forall is_integer toks then
                          Directive (Cpp (Group2 (toks_bl, [tok1], tok2 :: tok3 :: toks)))
                        else Error ( "Expecting an integer"
                                     ^ Position.here (drop_prefix is_integer toks |> hd |> pos_of)
                                   , Group2 (toks_bl, [tok1], tok2 :: tok3 :: toks))
                      , s))
      | x => x))

fun scan_cond xs = xs |>
  (one_start_cond -- scan_cond_list
   -- Scan.repeat (one_elif -- scan_cond_list)
   -- Scan.option (one_else -- scan_cond_list)
   -- Scan.recover one_endif
                   (fn msg =>
                     Scan.fail_with
                       (fn toks => fn () =>
                         case toks of
                           tok :: _ => "can be closed here" ^ Position.here (pos_of tok)
                         | _ => msg))
    >> (fn (((t_if, t_elif), t_else), t_endif) =>
         Token ( Position.no_range
               , ( Directive
                     (Conditional
                       let fun t_body x = x |-> get_cond
                       in
                       ( t_body t_if
                       , map t_body t_elif
                       , Option.map t_body t_else
                       , t_body (t_endif, []))
                       end)
                 , ""))))

and scan_cond_list xs = xs |> Scan.repeat (not_cond || scan_cond)

val scan_directive_cond0 =
     not_cond
  || Scan.ahead ( one_start_cond |-- scan_cond_list
                 |-- Scan.repeat (one_elif -- scan_cond_list)
                 |-- one_else --| scan_cond_list -- (one_elif || one_else))
     :-- (fn (tok1, tok2) => !!! ( "directive" ^ pos_here_of tok2
                                 ^ " not expected after" ^ pos_here_of tok1
                                 ^ ", detected at")
                                 Scan.fail)
     >> #2
  || (Scan.ahead one_start_cond |-- !!! "unclosed directive" scan_cond)
  || (Scan.ahead one_not_eof |-- !!! "missing or ambiguous beginning of conditional" Scan.fail)

fun scan_directive_recover msg =
     not_cond
  || one_not_eof >>
       (fn tok as Token (pos, (_, s)) => Token (pos, (Error (msg, get_cond tok []), s)))

in

val scan_directive_cond =
  Scan.recover
    (Scan.bulk scan_directive_cond0)
    (fn msg => scan_directive_recover msg >> single)

end

(* scan tokens, main *)

val scan_ml =
  Scan.depend
    let
      fun non_blanks st scan = scan >> pair st 
      fun scan_frag st =
        scan_fragment (   C_Basic_Symbol_Pos.newline >> token Space >> pair true
                       || many1_blanks_no_line >> token Space >> pair st)
                      (non_blanks st comments)
                      ((scan_sharp2 || scan_sharp1) >> token Keyword)
                      (non_blanks false)
    in
      fn true => scan_token scan_directive Directive >> pair false || scan_frag true
       | false => scan_frag false
    end;

fun recover msg =
 (recover_char ||
  recover_string ||
  Symbol_Pos.recover_cartouche ||
  C_Symbol_Pos.recover_comment ||
  recover_int ||
  one' Symbol.not_eof)
  >> token (Error (msg, Group1 ([], [])));

fun reader scan syms =
  let
    val termination =
      if null syms then []
      else
        let
          val pos1 = List.last syms |-> Position.advance;
          val pos2 = Position.advance Symbol.space pos1;
        in [Token (Position.range (pos1, pos2), (Space, Symbol.space))] end;

    val backslash1 =
          $$$ "\\" @@@ many C_Symbol.is_ascii_blank_no_line @@@ C_Basic_Symbol_Pos.newline
    val backslash2 = Scan.one (not o Symbol_Pos.is_eof)

    val input0 =
      Source.of_list syms
      |> Source.source Symbol_Pos.stopper (Scan.bulk (backslash1 >> SOME || backslash2 >> K NONE))
      |> Source.map_filter I
      |> Source.exhaust
      |> map (Symbol_Pos.range #> Position.range_position)

    val input1 =
      Source.of_list syms
      |> Source.source Symbol_Pos.stopper (Scan.bulk (backslash1 >> K NONE || backslash2 >> SOME))
      |> Source.map_filter I
      |> Source.source' true
                        Symbol_Pos.stopper
                        (Scan.recover (Scan.bulk (!!!! "bad input" scan))
                                      (fn msg => Scan.lift (recover msg) >> single))
      |> Source.source stopper scan_directive_cond
      |> Source.exhaust
      |> (fn input => input @ termination);

    val _ = app (fn pos => Output.information ("Backslash newline" ^ Position.here pos)) input0
    val _ = Position.reports_text (map (fn pos => ((pos, Markup.intensify), "")) input0);
  in (input1, check input1)
end;

in

fun op @@ ((input1, f_error_lines1), (input2, f_error_lines2)) =
  (input1 @ input2, f_error_lines1 #> f_error_lines2)

val read_init = ([], I)

fun read text = (reader scan_ml o Symbol_Pos.explode) (text, Position.none);

fun read_source' {language, symbols} scan source =
  let
    val pos = Input.pos_of source;
    val _ =
      if Position.is_reported_range pos
      then Position.report pos (language (Input.is_delimited source))
      else ();
  in
    Input.source_explode source
    |> not symbols ? maps (fn (s, p) => raw_explode s |> map (rpair p))
    |> reader scan
  end;

val read_source =
  read_source' { language =
                  Markup.language' {name = "C", symbols = false, antiquotes = true}, symbols = true}
               scan_ml;

end;

end;

end

Theory C_Ast

(******************************************************************************
 * Isabelle/C
 *
 * Copyright (c) 2018-2019 Université Paris-Saclay, Univ. Paris-Sud, France
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *
 *     * Redistributions in binary form must reproduce the above
 *       copyright notice, this list of conditions and the following
 *       disclaimer in the documentation and/or other materials provided
 *       with the distribution.
 *
 *     * Neither the name of the copyright holders nor the names of its
 *       contributors may be used to endorse or promote products derived
 *       from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 ******************************************************************************)

chapter ‹Isabelle/C›

section ‹Core Language: An Abstract Syntax Tree Definition (C Language without Annotations)›

theory C_Ast
  imports Main
begin

subsection ‹Loading the Generated AST›

text ‹ The abstract syntax tree of the C language considered in the Isabelle/C project is
arbitrary, but it must already come with a grammar making the connection with a default AST, so that
both the grammar and AST can be imported to SML.‹Additionally, the grammar and AST
must both have a free licence --- compatible with the Isabelle AFP, for them to be publishable
there.› The Haskell Language.C project fulfills this property: see for instance
🌐‹http://hackage.haskell.org/package/language-c› and
🌐‹https://github.com/visq/language-c/blob/master/src/Language/C/Syntax/AST.hs›,
where its AST is being imported in the present theory file 🗏‹C_Ast.thy›, whereas
its grammar will be later in 🗏‹C_Parser_Language.thy›
(🗏‹C_Parser_Language.thy› depends on 🗏‹C_Ast.thy›). The AST
importation is based on a modified version of Haskabelle, which generates the C AST from Haskell to
an ML file. ›

ML ― ‹🗏‹../generated/c_ast.ML› val fresh_ident0 =
  let val i = Synchronized.var "counter for new identifier" 38 in
    fn () => Int.toString (Synchronized.change_result i (fn i => (i, i + 1)))
  end

ML ― ‹🗏‹../generated/c_ast.ML› ― ‹🌐‹https://gitlri.lri.fr/ftuong/isabelle_c/blob/C/Citadelle/src/compiler_generic/meta_isabelle/Printer_init.thy›
structure CodeType = struct
  type mlInt = string
  type 'a mlMonad = 'a option
end

structure CodeConst = struct
  structure Monad = struct
    val bind = fn
        NONE => (fn _ => NONE)
      | SOME a => fn f => f a
    val return = SOME
  end

  structure Printf = struct
    local
      fun sprintf s l =
        case String.fields (fn #"%" => true | _ => false) s of
          [] => ""
        | [x] => x
        | x :: xs =>
            let fun aux acc l_pat l_s =
              case l_pat of
                [] => rev acc
              | x :: xs => aux (String.extract (x, 1, NONE) :: hd l_s :: acc) xs (tl l_s) in
            String.concat (x :: aux [] xs l)
      end
    in
      fun sprintf0 s_pat = s_pat
      fun sprintf1 s_pat s1 = sprintf s_pat [s1]
      fun sprintf2 s_pat s1 s2 = sprintf s_pat [s1, s2]
      fun sprintf3 s_pat s1 s2 s3 = sprintf s_pat [s1, s2, s3]
      fun sprintf4 s_pat s1 s2 s3 s4 = sprintf s_pat [s1, s2, s3, s4]
      fun sprintf5 s_pat s1 s2 s3 s4 s5 = sprintf s_pat [s1, s2, s3, s4, s5]
    end
  end

  structure String = struct
    val concat = String.concatWith
  end

  structure Sys = struct
    val isDirectory2 = SOME o File.is_dir o Path.explode handle ERROR _ => K NONE
  end

  structure To = struct
    fun nat f = Int.toString o f
  end

  fun outFile1 _ _ = tap (fn _ => warning "not implemented") NONE
  fun outStand1 f = outFile1 f ""
end

ML_file ‹../generated/c_ast.ML›

text ‹ Note that the purpose of 🗀‹../generated› is to host any generated
files of the Isabelle/C project. It contains among others:

   🗏‹../generated/c_ast.ML› representing the Abstract Syntax Tree of C,
  which has just been loaded.
  
   🗏‹../generated/c_grammar_fun.grm› is a generated file not used by the
  project, except for further generating 🗏‹../generated/c_grammar_fun.grm.sig›
  and 🗏‹../generated/c_grammar_fun.grm.sml›. Its physical presence in the
  directory is actually not necessary, but has been kept for informative documentation purposes. It
  represents the basis point of our SML grammar file, generated by an initial Haskell grammar file
  (namely
  🌐‹https://github.com/visq/language-c/blob/master/src/Language/C/Parser/Parser.y›)
  using a modified version of Happy.

   🗏‹../generated/c_grammar_fun.grm.sig› and
  🗏‹../generated/c_grammar_fun.grm.sml› are the two files generated from
  🗏‹../generated/c_grammar_fun.grm› with a modified version of ML-Yacc. This
  last comes from MLton source in 🗀‹../../src_ext/mlton›, see for example
  🗀‹../../src_ext/mlton/mlyacc›.
›

text ‹ For the case of 🗏‹../generated/c_ast.ML›, it is actually not
mandatory to have a ``physical'' representation of the file in 🗀‹../generated›:
it could be generated ``on-the-fly'' with code_reflect and immediately
loaded: Citadelle has an option to choose between the two
tasks~\cite{DBLP:journals/afp/TuongW15}.🌐‹https://gitlri.lri.fr/ftuong/citadelle-devel›

text ‹ After loading the AST, it is possible in Citadelle to do various meta-programming
renaming, such as the one depicted in the next command. Actually, its content is explicitly included
here by hand since we decided to manually load the AST using the above
ML_file command. (Otherwise, one can automatically execute the overall
generation and renaming tasks in Citadelle without resorting to a manual copying-pasting.)›

ML ― ‹🗏‹../generated/c_ast.ML› structure C_Ast =
struct
  val Position = C_Ast.position val NoPosition = C_Ast.noPosition val BuiltinPosition = C_Ast.builtinPosition val InternalPosition = C_Ast.internalPosition val Name = C_Ast.name val OnlyPos = C_Ast.onlyPos val NodeInfo = C_Ast.nodeInfo val AnonymousRef = C_Ast.anonymousRef val NamedRef = C_Ast.namedRef val CChar = C_Ast.cChar val CChars = C_Ast.cChars val DecRepr = C_Ast.decRepr val HexRepr = C_Ast.hexRepr val OctalRepr = C_Ast.octalRepr val FlagUnsigned = C_Ast.flagUnsigned val FlagLong = C_Ast.flagLong val FlagLongLong = C_Ast.flagLongLong val FlagImag = C_Ast.flagImag val CFloat = C_Ast.cFloat val Flags = C_Ast.flags val CInteger = C_Ast.cInteger val CAssignOp = C_Ast.cAssignOp val CMulAssOp = C_Ast.cMulAssOp val CDivAssOp = C_Ast.cDivAssOp val CRmdAssOp = C_Ast.cRmdAssOp val CAddAssOp = C_Ast.cAddAssOp val CSubAssOp = C_Ast.cSubAssOp val CShlAssOp = C_Ast.cShlAssOp val CShrAssOp = C_Ast.cShrAssOp val CAndAssOp = C_Ast.cAndAssOp val CXorAssOp = C_Ast.cXorAssOp val COrAssOp = C_Ast.cOrAssOp val CMulOp = C_Ast.cMulOp val CDivOp = C_Ast.cDivOp val CRmdOp = C_Ast.cRmdOp val CAddOp = C_Ast.cAddOp val CSubOp = C_Ast.cSubOp val CShlOp = C_Ast.cShlOp val CShrOp = C_Ast.cShrOp val CLeOp = C_Ast.cLeOp val CGrOp = C_Ast.cGrOp val CLeqOp = C_Ast.cLeqOp val CGeqOp = C_Ast.cGeqOp val CEqOp = C_Ast.cEqOp val CNeqOp = C_Ast.cNeqOp val CAndOp = C_Ast.cAndOp val CXorOp = C_Ast.cXorOp val COrOp = C_Ast.cOrOp val CLndOp = C_Ast.cLndOp val CLorOp = C_Ast.cLorOp val CPreIncOp = C_Ast.cPreIncOp val CPreDecOp = C_Ast.cPreDecOp val CPostIncOp = C_Ast.cPostIncOp val CPostDecOp = C_Ast.cPostDecOp val CAdrOp = C_Ast.cAdrOp val CIndOp = C_Ast.cIndOp val CPlusOp = C_Ast.cPlusOp val CMinOp = C_Ast.cMinOp val CCompOp = C_Ast.cCompOp val CNegOp = C_Ast.cNegOp val CAuto = C_Ast.cAuto val CRegister = C_Ast.cRegister val CStatic = C_Ast.cStatic val CExtern = C_Ast.cExtern val CTypedef = C_Ast.cTypedef val CThread = C_Ast.cThread val CInlineQual = C_Ast.cInlineQual val CNoreturnQual = C_Ast.cNoreturnQual val CStructTag = C_Ast.cStructTag val CUnionTag = C_Ast.cUnionTag val CIntConst = C_Ast.cIntConst val CCharConst = C_Ast.cCharConst val CFloatConst = C_Ast.cFloatConst val CStrConst = C_Ast.cStrConst val CStrLit = C_Ast.cStrLit val CFunDef = C_Ast.cFunDef val CDecl = C_Ast.cDecl val CStaticAssert = C_Ast.cStaticAssert val CDeclr = C_Ast.cDeclr val CPtrDeclr = C_Ast.cPtrDeclr val CArrDeclr = C_Ast.cArrDeclr val CFunDeclr = C_Ast.cFunDeclr val CNoArrSize = C_Ast.cNoArrSize val CArrSize = C_Ast.cArrSize val CLabel = C_Ast.cLabel val CCase = C_Ast.cCase val CCases = C_Ast.cCases val CDefault = C_Ast.cDefault val CExpr = C_Ast.cExpr val CCompound = C_Ast.cCompound val CIf = C_Ast.cIf val CSwitch = C_Ast.cSwitch val CWhile = C_Ast.cWhile val CFor = C_Ast.cFor val CGoto = C_Ast.cGoto val CGotoPtr = C_Ast.cGotoPtr val CCont = C_Ast.cCont val CBreak = C_Ast.cBreak val CReturn = C_Ast.cReturn val CAsm = C_Ast.cAsm val CAsmStmt = C_Ast.cAsmStmt val CAsmOperand = C_Ast.cAsmOperand val CBlockStmt = C_Ast.cBlockStmt val CBlockDecl = C_Ast.cBlockDecl val CNestedFunDef = C_Ast.cNestedFunDef val CStorageSpec = C_Ast.cStorageSpec val CTypeSpec = C_Ast.cTypeSpec val CTypeQual = C_Ast.cTypeQual val CFunSpec = C_Ast.cFunSpec val CAlignSpec = C_Ast.cAlignSpec val CVoidType = C_Ast.cVoidType val CCharType = C_Ast.cCharType val CShortType = C_Ast.cShortType val CIntType = C_Ast.cIntType val CLongType = C_Ast.cLongType val CFloatType = C_Ast.cFloatType val CDoubleType = C_Ast.cDoubleType val CSignedType = C_Ast.cSignedType val CUnsigType = C_Ast.cUnsigType val CBoolType = C_Ast.cBoolType val CComplexType = C_Ast.cComplexType val CInt128Type = C_Ast.cInt128Type val CSUType = C_Ast.cSUType val CEnumType = C_Ast.cEnumType val CTypeDef = C_Ast.cTypeDef val CTypeOfExpr = C_Ast.cTypeOfExpr val CTypeOfType = C_Ast.cTypeOfType val CAtomicType = C_Ast.cAtomicType val CConstQual = C_Ast.cConstQual val CVolatQual = C_Ast.cVolatQual val CRestrQual = C_Ast.cRestrQual val CAtomicQual = C_Ast.cAtomicQual val CAttrQual = C_Ast.cAttrQual val CNullableQual = C_Ast.cNullableQual val CNonnullQual = C_Ast.cNonnullQual val CAlignAsType = C_Ast.cAlignAsType val CAlignAsExpr = C_Ast.cAlignAsExpr val CStruct = C_Ast.cStruct val CEnum = C_Ast.cEnum val CInitExpr = C_Ast.cInitExpr val CInitList = C_Ast.cInitList val CArrDesig = C_Ast.cArrDesig val CMemberDesig = C_Ast.cMemberDesig val CRangeDesig = C_Ast.cRangeDesig val CAttr = C_Ast.cAttr val CComma = C_Ast.cComma val CAssign = C_Ast.cAssign val CCond = C_Ast.cCond val CBinary = C_Ast.cBinary val CCast = C_Ast.cCast val CUnary = C_Ast.cUnary val CSizeofExpr = C_Ast.cSizeofExpr val CSizeofType = C_Ast.cSizeofType val CAlignofExpr = C_Ast.cAlignofExpr val CAlignofType = C_Ast.cAlignofType val CComplexReal = C_Ast.cComplexReal val CComplexImag = C_Ast.cComplexImag val CIndex = C_Ast.cIndex val CCall = C_Ast.cCall val CMember = C_Ast.cMember val CVar = C_Ast.cVar val CConst = C_Ast.cConst val CCompoundLit = C_Ast.cCompoundLit val CGenericSelection = C_Ast.cGenericSelection val CStatExpr = C_Ast.cStatExpr val CLabAddrExpr = C_Ast.cLabAddrExpr val CBuiltinExpr = C_Ast.cBuiltinExpr val CBuiltinVaArg = C_Ast.cBuiltinVaArg val CBuiltinOffsetOf = C_Ast.cBuiltinOffsetOf val CBuiltinTypesCompatible = C_Ast.cBuiltinTypesCompatible val CDeclExt = C_Ast.cDeclExt val CFDefExt = C_Ast.cFDefExt val CAsmExt = C_Ast.cAsmExt val CTranslUnit = C_Ast.cTranslUnit
  open C_Ast
end

subsection ‹Basic Aliases and Initialization of the Haskell Library›

ML ― ‹🗏‹../generated/c_ast.ML› structure C_Ast =
struct
type class_Pos = Position.T * Position.T
(**)
type NodeInfo = C_Ast.nodeInfo
type CStorageSpec = NodeInfo C_Ast.cStorageSpecifier
type CFunSpec = NodeInfo C_Ast.cFunctionSpecifier
type CConst = NodeInfo C_Ast.cConstant
type 'a CInitializerList = ('a C_Ast.cPartDesignator List.list * 'a C_Ast.cInitializer) List.list
type CTranslUnit = NodeInfo C_Ast.cTranslationUnit
type CExtDecl = NodeInfo C_Ast.cExternalDeclaration
type CFunDef = NodeInfo C_Ast.cFunctionDef
type CDecl = NodeInfo C_Ast.cDeclaration
type CDeclr = NodeInfo C_Ast.cDeclarator
type CDerivedDeclr = NodeInfo C_Ast.cDerivedDeclarator
type CArrSize = NodeInfo C_Ast.cArraySize
type CStat = NodeInfo C_Ast.cStatement
type CAsmStmt = NodeInfo C_Ast.cAssemblyStatement
type CAsmOperand = NodeInfo C_Ast.cAssemblyOperand
type CBlockItem = NodeInfo C_Ast.cCompoundBlockItem
type CDeclSpec = NodeInfo C_Ast.cDeclarationSpecifier
type CTypeSpec = NodeInfo C_Ast.cTypeSpecifier
type CTypeQual = NodeInfo C_Ast.cTypeQualifier
type CAlignSpec = NodeInfo C_Ast.cAlignmentSpecifier
type CStructUnion = NodeInfo C_Ast.cStructureUnion
type CEnum = NodeInfo C_Ast.cEnumeration
type CInit = NodeInfo C_Ast.cInitializer
type CInitList = NodeInfo CInitializerList
type CDesignator = NodeInfo C_Ast.cPartDesignator
type CAttr = NodeInfo C_Ast.cAttribute
type CExpr = NodeInfo C_Ast.cExpression
type CBuiltin = NodeInfo C_Ast.cBuiltinThing
type CStrLit = NodeInfo C_Ast.cStringLiteral
(**)
type ClangCVersion = C_Ast.clangCVersion
type Ident = C_Ast.ident
type Position = C_Ast.positiona
type PosLength = Position * int
type Name = C_Ast.namea
type Bool = bool
type CString = C_Ast.cString
type CChar = C_Ast.cChar
type CInteger = C_Ast.cInteger
type CFloat = C_Ast.cFloat
type CStructTag = C_Ast.cStructTag
type CUnaryOp = C_Ast.cUnaryOp
type 'a CStringLiteral = 'a C_Ast.cStringLiteral
type 'a CConstant = 'a C_Ast.cConstant
type ('a, 'b) Either = ('a, 'b) C_Ast.either
type CIntRepr = C_Ast.cIntRepr
type CIntFlag = C_Ast.cIntFlag
type CAssignOp = C_Ast.cAssignOp
type Comment = C_Ast.comment
(**)
type 'a Reversed = 'a
datatype CDeclrR = CDeclrR0 of C_Ast.ident C_Ast.optiona
                             * NodeInfo C_Ast.cDerivedDeclarator list Reversed
                             * NodeInfo C_Ast.cStringLiteral C_Ast.optiona
                             * NodeInfo C_Ast.cAttribute list
                             * NodeInfo
type 'a Maybe = 'a C_Ast.optiona
datatype 'a Located = Located of 'a * (Position * (Position * int))
(**)
fun CDeclrR ide l s a n = CDeclrR0 (ide, l, s, a, n)
val reverse = rev
val Nothing = C_Ast.None
val Just = C_Ast.Some
val False = false
val True = true
val Ident = C_Ast.Ident0
(**)
val CDecl_flat = fn l1 => C_Ast.CDecl l1 o map (fn (a, b, c) => ((a, b), c))
fun flat3 (a, b, c) = ((a, b), c)
fun maybe def f = fn C_Ast.None => def | C_Ast.Some x => f x 
val Reversed = I
(**)
val From_string =
    C_Ast.SS_base
  o C_Ast.ST
  o implode
  o map (fn s => ― ‹prevent functions in 🗏‹~~/src/HOL/String.thy› of raising additional errors
                     (e.g., see the ML code associated to term‹String.asciis_of_literal›)›
          if Symbol.is_char s then s
          else if Symbol.is_utf8 s then translate_string (fn c => "\\" ^ string_of_int (ord c)) s
          else s)
  o Symbol.explode
val From_char_hd = hd o C_Ast.explode
(**)
val Namea = C_Ast.name
(**)
open C_Ast
fun flip f b a = f a b
open Basic_Library
end

end

File ‹$AFP/Isabelle_C/C11-FrontEnd/generated/c_ast.ML›

(* Generated from Run.thy; DO NOT EDIT! *)

structure C_Ast : sig
  datatype inta = Int_of_integer of int
  datatype num = One | Bit0 of num | Bit1 of num
  val one_inta : inta
  type 'a one
  val one : 'a one -> 'a
  val one_int : inta one
  val integer_of_int : inta -> int
  val times_inta : inta -> inta -> inta
  type 'a times
  val times : 'a times -> 'a -> 'a -> 'a
  type 'a power
  val one_power : 'a power -> 'a one
  val times_power : 'a power -> 'a times
  val times_int : inta times
  val power_int : inta power
  datatype nat = Nat of int
  val integer_of_nat : nat -> int
  val equal_nata : nat -> nat -> bool
  type 'a equal
  val equala : 'a equal -> 'a -> 'a -> bool
  val equal_nat : nat equal
  val zero_nata : nat
  type 'a zero
  val zero : 'a zero -> 'a
  val zero_nat : nat zero
  val eq : 'a equal -> 'a -> 'a -> bool
  val equal_lista : 'a equal -> 'a list -> 'a list -> bool
  val equal_list : 'a equal -> ('a list) equal
  val equal_bool : bool -> bool -> bool
  datatype char = Chara of bool * bool * bool * bool * bool * bool * bool * bool
  val equal_chara : char -> char -> bool
  val equal_char : char equal
  val shows_prec_char : nat -> char -> char list -> char list
  val shows_string : char list -> char list -> char list
  val shows_list_char : char list -> char list -> char list
  type 'a show
  val shows_prec : 'a show -> nat -> 'a -> char list -> char list
  val shows_list : 'a show -> 'a list -> char list -> char list
  val show_char : char show
  datatype string_b_a_s_e = ST of string | STa of int list
  val equal_integer : int equal
  val equal_string_b_a_s_e : string_b_a_s_e -> string_b_a_s_e -> bool
  datatype abr_string = SS_base of string_b_a_s_e | String_concatWith of abr_string * abr_string list
  val equal_abr_stringa : abr_string -> abr_string -> bool
  val equal_abr_string : abr_string equal
  datatype sourcePos = Ta of int * abr_string * int
  val equal_SourcePos : sourcePos -> sourcePos -> bool
  datatype region = Bogus | T of sourcePos * sourcePos
  val equal_Region : region -> region -> bool
  datatype 'a region_Wrap = Tb of 'a * region
  val equal_Region_Wrap : 'a equal -> 'a region_Wrap -> 'a region_Wrap -> bool
  datatype stringCvt_radix = BIN | OCT | DEC | HEX
  datatype literalconstant_node = NUMCONST of int * abr_string * stringCvt_radix | STRING_LIT of abr_string
  datatype 'a unsynchronized_ref = Unsynchronized_ref of 'a
  datatype more_info = MungedVar of abr_string * abr_string option | EnumC | FunctionName
  datatype binoptype = LogOr | LogAnd | Equals | NotEquals | BitwiseAnd | BitwiseOr | BitwiseXOr | Lt | Gt | Leq | Geq | Plus | Minus | Times | Divides | Modulus | RShift | LShift
  datatype unoptype = Negate | Not | Addr | BitNegate
  datatype base_inttype = Charb | Short | Inta | Long | LongLong | Double | Float
  datatype 'a ctype = Signed of base_inttype | Unsigned of base_inttype | Bool | PlainChar | StructTy of abr_string | UnionTy of abr_string | EnumTy of abr_string option | Ptr of 'a ctype | Array of 'a ctype * 'a option |
    Bitfield of bool * 'a | Identa of abr_string | Function of 'a ctype * 'a ctype list | Void
  datatype expr = E of expr_node region_Wrap
  and designator = DesignE of expr | DesignFld of abr_string
  and initializer = InitE of expr | InitList of (designator list * initializer) list
  and expr_node = BinOp of binoptype * expr * expr | UnOp of unoptype * expr | CondExp of expr * expr * expr | Constant of literalconstant_node region_Wrap | Vara of abr_string * ((int ctype * more_info) option) unsynchronized_ref |
    StructDot of expr * abr_string | ArrayDeref of expr * expr | Deref of expr | TypeCast of expr ctype region_Wrap * expr | Sizeof of expr | SizeofTy of expr ctype region_Wrap | EFnCall of expr * expr list |
    CompLiteral of expr ctype * (designator list * initializer) list | Arbitrary of expr ctype | MKBOOL of expr
  val equal_Unsynchronized_ref : 'a equal -> 'a unsynchronized_ref -> 'a unsynchronized_ref -> bool
  val equal_binoptype : binoptype -> binoptype -> bool
  val equal_unoptype : unoptype -> unoptype -> bool
  val equal_base_inttype : base_inttype -> base_inttype -> bool
  val equal_optiona : 'a equal -> 'a option -> 'a option -> bool
  val equal_ctypea : 'a equal -> 'a ctype -> 'a ctype -> bool
  val equal_ctype : 'a equal -> 'a ctype equal
  val equal_StringCvt_radix : stringCvt_radix -> stringCvt_radix -> bool
  val equal_literalconstant_nodea : literalconstant_node -> literalconstant_node -> bool
  val equal_literalconstant_node : literalconstant_node equal
  val equal_proda : 'a equal -> 'b equal -> 'a * 'b -> 'a * 'b -> bool
  val equal_prod : 'a equal -> 'b equal -> ('a * 'b) equal
  val equal_more_infoa : more_info -> more_info -> bool
  val equal_more_info : more_info equal
  val equal_option : 'a equal -> ('a option) equal
  val equal_expr : expr equal
  val equal_expr_nodea : expr_node -> expr_node -> bool
  val equal_expr_node : expr_node equal
  val equal_expra : expr -> expr -> bool
  val equal_designatora : designator -> designator -> bool
  val equal_designator : designator equal
  val equal_initializera : initializer -> initializer -> bool
  val equal_initializer : initializer equal
  val equal_literal : string equal
  datatype ocl_multiplicity_single = Mult_nat of Code_Numeral.natural | Mult_star | Mult_infinity
  datatype ocl_collection = Set | Sequence | Ordered0 | Subsets0 | Union0 | Redefines0 | Derived0 | Qualifier0 | Nonunique0
  datatype 'a ocl_multiplicity_ext = Ocl_multiplicity_ext of (ocl_multiplicity_single * ocl_multiplicity_single option) list * abr_string option * ocl_collection list * 'a
  val equal_naturala : Code_Numeral.natural -> Code_Numeral.natural -> bool
  val equal_ocl_multiplicity_singlea : ocl_multiplicity_single -> ocl_multiplicity_single -> bool
  val equal_ocl_multiplicity_single : ocl_multiplicity_single equal
  val equal_ocl_collectiona : ocl_collection -> ocl_collection -> bool
  val equal_ocl_collection : ocl_collection equal
  val equal_ocl_multiplicity_ext : 'a equal -> 'a ocl_multiplicity_ext -> 'a ocl_multiplicity_ext -> bool
  datatype 'a ocl_ty_class_node_ext = Ocl_ty_class_node_ext of Code_Numeral.natural * unit ocl_multiplicity_ext * abr_string * 'a
  val equal_unita : unit -> unit -> bool
  val equal_unit : unit equal
  val equal_ocl_ty_class_node_ext : 'a equal -> 'a ocl_ty_class_node_ext -> 'a ocl_ty_class_node_ext -> bool
  datatype 'a ocl_ty_class_ext = Ocl_ty_class_ext of abr_string * Code_Numeral.natural * Code_Numeral.natural * unit ocl_ty_class_node_ext * unit ocl_ty_class_node_ext * 'a
  val equal_ocl_ty_class_ext : 'a equal -> 'a ocl_ty_class_ext -> 'a ocl_ty_class_ext -> bool
  datatype ocl_ty_obj_core = OclTyCore_pre of abr_string | OclTyCore of unit ocl_ty_class_ext
  val equal_ocl_ty_obj_corea : ocl_ty_obj_core -> ocl_ty_obj_core -> bool
  datatype ocl_ty_obj = OclTyObj of ocl_ty_obj_core * (ocl_ty_obj_core list) list
  val equal_ocl_ty_obj_core : ocl_ty_obj_core equal
  val equal_ocl_ty_obj : ocl_ty_obj -> ocl_ty_obj -> bool
  datatype ocl_ty = OclTy_base_void | OclTy_base_boolean | OclTy_base_integer | OclTy_base_unlimitednatural | OclTy_base_real | OclTy_base_string | OclTy_object of ocl_ty_obj | OclTy_collection of unit ocl_multiplicity_ext * ocl_ty |
    OclTy_pair of ocl_ty * ocl_ty | OclTy_binding of (abr_string option * ocl_ty) | OclTy_arrow of ocl_ty * ocl_ty | OclTy_class_syn of abr_string | OclTy_enum of abr_string | OclTy_raw of abr_string
  val equal_ocl_ty : ocl_ty equal
  val equal_ocl_tya : ocl_ty -> ocl_ty -> bool
  datatype 'a itself = Type
  type 'a len0
  val len_of : 'a len0 -> 'a itself -> nat
  val times_nat : nat -> nat -> nat
  type 'a ord
  val less_eq : 'a ord -> 'a -> 'a -> bool
  val less : 'a ord -> 'a -> 'a -> bool
  val max : 'a ord -> 'a -> 'a -> 'a
  val ord_integer : int ord
  val nat_of_integer : int -> nat
  type 'a finite
  datatype 'a bit0 = Abs_bit0 of inta
  val len_of_bit0 : 'a len0 -> 'a bit0 itself -> nat
  val len0_bit0 : 'a len0 -> 'a bit0 len0
  val one_nat : nat
  datatype num1 = One_num1
  val len_of_num1 : num1 itself -> nat
  val len0_num1 : num1 len0
  datatype ocl_class = OclClass of abr_string * (abr_string * ocl_ty) list * ocl_class list
  val equal_ocl_class : ocl_class equal
  val equal_ocl_classa : ocl_class -> ocl_class -> bool
  datatype opt_ident = OptIdent of Code_Numeral.natural
  val equal_opt_identa : opt_ident -> opt_ident -> bool
  val equal_opt_ident : opt_ident equal
  val one_integera : int
  val one_integer : int one
  type 'a plus
  val plusa : 'a plus -> 'a -> 'a -> 'a
  val plus_integer : int plus
  val zero_integer : int zero
  type 'a zero_neq_one
  val one_zero_neq_one : 'a zero_neq_one -> 'a one
  val zero_zero_neq_one : 'a zero_neq_one -> 'a zero
  val zero_neq_one_integer : int zero_neq_one
  val equal_natural : Code_Numeral.natural equal
  val one_natural : Code_Numeral.natural one
  val plus_natural : Code_Numeral.natural plus
  val zero_natural : Code_Numeral.natural zero
  datatype gcc_attribute = GCC_AttribID of abr_string | GCC_AttribFn of abr_string * expr list | OWNED_BY of abr_string
  val equal_gcc_attributea : gcc_attribute -> gcc_attribute -> bool
  val equal_gcc_attribute : gcc_attribute equal
  datatype opt_attr_type = OptInh | OptOwn
  val equal_opt_attr_typea : opt_attr_type -> opt_attr_type -> bool
  val equal_opt_attr_type : opt_attr_type equal
  datatype internal_oid = Oid of Code_Numeral.natural
  val equal_internal_oida : internal_oid -> internal_oid -> bool
  val equal_internal_oid : internal_oid equal
  datatype generation_lemma_mode = Gen_sorry | Gen_no_dirty
  val equal_generation_lemma_modea : generation_lemma_mode -> generation_lemma_mode -> bool
  val equal_generation_lemma_mode : generation_lemma_mode equal
  datatype 'a word = Word of inta
  datatype ('a, 'b) nsplit = Nsplit_text of 'a | Nsplit_sep of 'b
  datatype ('b, 'a) alist = Alist of ('b * 'a) list
  datatype ('a, 'b) sum = Inl of 'a | Inr of 'b
  datatype thyName = ThyName of abr_string
  datatype name = QName of thyName * abr_string | Name of abr_string
  datatype function_Kind = Definition | Primrec | Fun | Function_Sorry
  datatype typea = Typea of name * typea list | Func of typea * typea | TVar of name | NoType
  datatype typeSign = TypeSign of name * (name * name list) list * typea
  datatype literal = Int of Code_Numeral.natural | Stringa of abr_string
  datatype term = Literal of literal | Const of name | Abs of name * term | App of term * term | If of term * term * term | Let of (term * term) list * term | Case of term * (term * term) list |
    ListCompr of term * listComprFragment list | RecConstr of name * (name * term) list | RecUpdate of term * (name * term) list | DoBlock of abr_string * doBlockFragment list * abr_string | Parenthesized of term
  and doBlockFragment = DoGenerator of term * term | DoQualifier of term | DoLetStmt of (term * term) list
  and listComprFragment = Generator of (term * term) | Guard of term
  datatype function_Stmt = Function_Stmt of function_Kind * typeSign list * ((name * term list) * term) list
  datatype typeSpec = TypeSpec of name list * name
  datatype stmt = Datatype of (typeSpec * (name * typea list) list) list | Record of typeSpec * (name * typea) list | TypeSynonym of (typeSpec * typea) list | Functiona of function_Stmt | Class of name * name list * typeSign list |
    Instance of name * name * (name * name list) list * function_Stmt list | Comment of abr_string | SML of function_Stmt
  datatype typ = Typeb of abr_string * typ list | TFree of abr_string * abr_string list | TVara of (abr_string * Code_Numeral.natural) * abr_string list
  datatype fnspec = Fnspec of abr_string region_Wrap | Relspec of abr_string region_Wrap | Fn_modifies of abr_string list | Didnt_translate | Gcc_attribs of gcc_attribute list
  datatype semi_typ = Typ_apply of semi_typ * semi_typ list | Typ_apply_bin of abr_string * semi_typ * semi_typ | Typ_apply_paren of abr_string * abr_string * semi_typ | Typ_base of abr_string
  datatype terma = Consta of abr_string * typ | Free of abr_string * typ | Var of (abr_string * Code_Numeral.natural) * typ | Bound of Code_Numeral.natural | Absa of abr_string * typ * terma | Appa of terma * terma
  datatype semi_terma = Term_rewrite of semi_terma * abr_string * semi_terma | Term_basic of abr_string list | Term_annot of semi_terma * semi_typ | Term_bind of abr_string * semi_terma * semi_terma |
    Term_fun_case of semi_terma option * (semi_terma * semi_terma) list | Term_apply of semi_terma * semi_terma list | Term_paren of abr_string * abr_string * semi_terma | Term_if_then_else of semi_terma * semi_terma * semi_terma |
    Term_let of (semi_terma * semi_terma) list * semi_terma | Term_term of abr_string list * terma
  datatype 'a semi_locale_ext = Semi_locale_ext of abr_string * ((semi_terma * semi_typ) list * (abr_string * semi_terma) option) list * 'a
  datatype semi_thm_attribute = Thm_thm of abr_string | Thm_thms of abr_string | Thm_THEN of semi_thm_attribute * semi_thm_attribute | Thm_simplified of semi_thm_attribute * semi_thm_attribute | Thm_symmetric of semi_thm_attribute |
    Thm_where of semi_thm_attribute * (abr_string * semi_terma) list | Thm_of of semi_thm_attribute * semi_terma list | Thm_OF of semi_thm_attribute * semi_thm_attribute
  datatype semi_thm = Thms_single of semi_thm_attribute | Thms_mult of semi_thm_attribute
  datatype semi_method_simp = Method_simp_only of semi_thm list | Method_simp_add_del_split of semi_thm list * semi_thm list * semi_thm list
  datatype semi_method = Method_rule of semi_thm_attribute option | Method_drule of semi_thm_attribute | Method_erule of semi_thm_attribute | Method_intro of semi_thm_attribute list | Method_elim of semi_thm_attribute |
    Method_subst of bool * abr_string list * semi_thm_attribute | Method_insert of semi_thm list | Method_plus of semi_method list | Method_option of semi_method list | Method_or of semi_method list | Method_one of semi_method_simp |
    Method_all of semi_method_simp | Method_auto_simp_add_split of semi_thm list * abr_string list | Method_rename_tac of abr_string list | Method_case_tac of semi_terma | Method_blast of Code_Numeral.natural option | Method_clarify |
    Method_metis of abr_string list * semi_thm_attribute list
  datatype semi_command_final = Command_done | Command_by of semi_method list | Command_sorry
  datatype interpretation = Interpretation of abr_string * abr_string * semi_terma list * semi_command_final
  datatype axiomatization = Axiomatization of abr_string * semi_terma
  datatype type_notation = Type_notation of abr_string * abr_string
  datatype instantiation = Instantiation of abr_string * abr_string * semi_terma
  datatype code_reflect = Code_reflect of bool * abr_string * abr_string list
  datatype type_synonym = Type_synonym of (abr_string * abr_string list) * semi_typ
  datatype abbreviation = Abbreviation of semi_terma
  datatype overloading = Overloading of abr_string * semi_terma * abr_string * semi_terma
  datatype hide_const = Hide_const of bool * abr_string list
  datatype definition = Definitiona of semi_terma | Definition_where1 of abr_string * (semi_terma * Code_Numeral.natural) * semi_terma | Definition_where2 of abr_string * semi_terma * semi_terma
  datatype text_raw = Text_raw of abr_string
  datatype semi_datatype_version = Datatype_new | Datatype_old | Datatype_old_atomic | Datatype_old_atomic_sub
  datatype datatypea = Datatypea of semi_datatype_version * ((abr_string * abr_string list) * (abr_string * semi_typ list) list) list
  datatype section = Section of Code_Numeral.natural * abr_string
  datatype lemmas = Lemmas_simp_thm of bool * abr_string * semi_thm_attribute list | Lemmas_simp_thms of abr_string * abr_string list
  datatype consts = Consts of abr_string * semi_typ * abr_string
  datatype semi_val_fun = Sval | Sfun
  datatype semi_term = SML_top of semi_term_1 list
  and semi_term_0 = SML_string of abr_string | SML_rewrite of semi_term_0 * abr_string * semi_term_0 | SML_basic of abr_string list | SML_binop of semi_term_0 * abr_string * semi_term_0 | SML_annot of semi_term_0 * abr_string |
    SML_function of (semi_term_0 * semi_term_0) list | SML_apply of semi_term_0 * semi_term_0 list | SML_paren of abr_string * abr_string * semi_term_0 | SML_let of semi_term * semi_term_0
  and semi_term_1 = SML_open of abr_string | SML_val_fun of semi_val_fun option * semi_term_0
  datatype setup = Setup of semi_term
  datatype semi_command_state = Command_apply_end of semi_method list
  datatype semi_command_proof = Command_apply of semi_method list | Command_using of semi_thm list | Command_unfolding of semi_thm list | Command_let of semi_terma * semi_terma |
    Command_have of abr_string * bool * semi_terma * semi_command_final | Command_fix_let of abr_string list * (semi_terma * semi_terma) list * (semi_terma list * semi_terma list) option * semi_command_state list
  datatype lemma = Lemma of abr_string * semi_terma list * (semi_method list) list * semi_command_final | Lemma_assumes of abr_string * (abr_string * (bool * semi_terma)) list * semi_terma * semi_command_proof list * semi_command_final
  datatype text = Text of abr_string
  datatype thm = Thm of semi_thm_attribute list
  datatype ml = SMLa of semi_term
  datatype semi_theory = Theory_datatype of datatypea | Theory_type_synonym of type_synonym | Theory_type_notation of type_notation | Theory_instantiation of instantiation | Theory_overloading of overloading | Theory_consts of consts |
    Theory_definition of definition | Theory_lemmas of lemmas | Theory_lemma of lemma | Theory_axiomatization of axiomatization | Theory_section of section | Theory_text of text | Theory_text_raw of text_raw | Theory_ML of ml |
    Theory_setup of setup | Theory_thm of thm | Theory_interpretation of interpretation | Theory_hide_const of hide_const | Theory_abbreviation of abbreviation | Theory_code_reflect of code_reflect
  datatype generation_semantics_ocl = Gen_only_design | Gen_only_analysis | Gen_default
  datatype boot_generation_syntax = Boot_generation_syntax of generation_semantics_ocl
  datatype ocl_association_relation = OclAssRel of (ocl_ty_obj * unit ocl_multiplicity_ext) list
  datatype ocl_association_type = OclAssTy_native_attribute | OclAssTy_association | OclAssTy_composition | OclAssTy_aggregation
  datatype 'a ocl_association_ext = Ocl_association_ext of ocl_association_type * ocl_association_relation * 'a
  datatype ocl_ctxt_term = T_pure of terma * abr_string option | T_to_be_parsed of abr_string * abr_string | T_lambda of abr_string * ocl_ctxt_term
  datatype ocl_prop = OclProp_ctxt of abr_string option * ocl_ctxt_term
  datatype ocl_ctxt_term_inv = T_inv of bool * ocl_prop
  datatype ocl_ctxt_prefix = OclCtxtPre | OclCtxtPost
  datatype ocl_ctxt_term_pp = T_pp of ocl_ctxt_prefix * ocl_prop | T_invariant of ocl_ctxt_term_inv
  datatype 'a ocl_ctxt_pre_post_ext = Ocl_ctxt_pre_post_ext of abr_string * ocl_ty * ocl_ctxt_term_pp list * 'a
  datatype ocl_ctxt_clause = Ctxt_pp of unit ocl_ctxt_pre_post_ext | Ctxt_inv of ocl_ctxt_term_inv
  datatype 'a ocl_class_raw_ext = Ocl_class_raw_ext of ocl_ty_obj * (abr_string * ocl_ty) list * ocl_ctxt_clause list * bool * 'a
  datatype ocl_def_base = OclDefInteger of abr_string | OclDefReal of (abr_string * abr_string) | OclDefString of abr_string
  datatype ocl_data_shallow = ShallB_term of ocl_def_base | ShallB_str of abr_string | ShallB_self of internal_oid | ShallB_list of ocl_data_shallow list
  datatype 'a ocl_list_attr = OclAttrNoCast of 'a | OclAttrCast of abr_string * 'a ocl_list_attr * 'a
  datatype 'a ocl_instance_single_ext = Ocl_instance_single_ext of abr_string option * abr_string option * abr_string option * (((abr_string * abr_string) option * (abr_string * ocl_data_shallow)) list) ocl_list_attr * 'a
  datatype 'a ocl_def_state_core = OclDefCoreAdd of unit ocl_instance_single_ext | OclDefCoreBinding of 'a
  datatype ocl_def_pp_core = OclDefPPCoreAdd of abr_string ocl_def_state_core list | OclDefPPCoreBinding of abr_string
  datatype ocl_def_transition = OclDefPP of abr_string option * ocl_def_pp_core * ocl_def_pp_core option
  datatype ocl_def_base_l = OclDefBase of ocl_def_base list
  datatype ocl_class_tree = OclClassTree of Code_Numeral.natural * Code_Numeral.natural
  datatype ocl_def_state = OclDefSt of abr_string * abr_string ocl_def_state_core list
  datatype ocl_instance = OclInstance of unit ocl_instance_single_ext list
  datatype 'a ocl_ctxt_ext = Ocl_ctxt_ext of abr_string list * ocl_ty_obj * ocl_ctxt_clause list * 'a
  datatype ocl_class_synonym = OclClassSynonym of abr_string * ocl_ty
  datatype ocl_flush_all = OclFlushAll
  datatype ocl_ass_class = OclAssClass of unit ocl_association_ext * unit ocl_class_raw_ext
  datatype ocl_generic = OclGeneric of abr_string
  datatype ocl_enum = OclEnum of abr_string * abr_string list
  datatype gen_meta = Gen_apply_hol of abr_string | Gen_apply_sml of abr_string | Gen_apply_sml_cmd of abr_string * abr_string | Gen_no_apply
  datatype module = Module of thyName * thyName list * stmt list * bool
  datatype isaUnit = IsaUnit of (bool * Code_Numeral.natural) * (abr_string * abr_string option) list * gen_meta * abr_string * (module list * bool)
  datatype floor = Floor1 | Floor2 | Floor3
  datatype all_meta_embedding = META_enum of ocl_enum | META_class_raw of floor * unit ocl_class_raw_ext | META_association of unit ocl_association_ext | META_ass_class of floor * ocl_ass_class | META_ctxt of floor * unit ocl_ctxt_ext |
    META_haskell of isaUnit | META_class_synonym of ocl_class_synonym | META_instance of ocl_instance | META_def_base_l of ocl_def_base_l | META_def_state of floor * ocl_def_state | META_def_transition of floor * ocl_def_transition |
    META_class_tree of ocl_class_tree | META_flush_all of ocl_flush_all | META_generic of ocl_generic
  datatype semi_theories = Theories_one of semi_theory | Theories_locale of unit semi_locale_ext * (semi_theory list) list
  datatype internal_oids = Oids of Code_Numeral.natural * Code_Numeral.natural * Code_Numeral.natural
  datatype 'a compiler_env_config_ext =
    Compiler_env_config_ext of
      bool * (abr_string * (abr_string list * abr_string)) option * internal_oids * (Code_Numeral.natural * Code_Numeral.natural) * generation_semantics_ocl * ocl_class option * all_meta_embedding list *
        (string_b_a_s_e * (unit ocl_instance_single_ext * internal_oids)) list * (string_b_a_s_e * (internal_oids * (abr_string * unit ocl_instance_single_ext) ocl_def_state_core) list) list * bool * bool *
        (string_b_a_s_e list * string_b_a_s_e list) * string_b_a_s_e list * string_b_a_s_e list * (generation_lemma_mode option * bool) * 'a
  datatype boot_setup_env = Boot_setup_env of unit compiler_env_config_ext
  datatype all_meta = META_semi_theories of semi_theories | META_boot_generation_syntax of boot_generation_syntax | META_boot_setup_env of boot_setup_env | META_all_meta_embedding of all_meta_embedding
  datatype 'a embedding_fun = Embedding_fun_info of abr_string * 'a | Embedding_fun_simple of 'a
  datatype ('a, 'b) embedding = Embed_theories of ('a -> 'b -> all_meta list * 'b) embedding_fun list |
    Embed_locale of ('a -> 'b -> all_meta list * 'b) embedding_fun list * ('a -> 'b -> unit semi_locale_ext * 'b) * ('a -> 'b -> semi_theory list * 'b) list * ('a -> 'b -> all_meta list * 'b) embedding_fun list
  datatype 'a tree = Tree of 'a * 'a tree list
  datatype asmblock = Asmblock of abr_string * (abr_string option * (abr_string * expr)) list * (abr_string option * (abr_string * expr)) list * abr_string list
  datatype storage_class = SC_EXTERN | SC_STATIC | SC_AUTO | SC_REGISTER | SC_THRD_LOCAL
  datatype declaration = VarDecl of (expr ctype * (abr_string region_Wrap * (storage_class list * (initializer option * gcc_attribute list)))) | StructDecl of abr_string region_Wrap * (expr ctype * abr_string region_Wrap) list |
    TypeDecl of (expr ctype * abr_string region_Wrap) list | ExtFnDecl of expr ctype * abr_string region_Wrap * (expr ctype * abr_string option) list * fnspec list |
    EnumDecl of (abr_string option) region_Wrap * (abr_string region_Wrap * expr option) list
  datatype trappable = BreakT | ContinueT
  datatype block_item = BI_Stmt of statement | BI_Decl of declaration region_Wrap
  and statement_node = Assign of expr * expr | AssignFnCall of expr option * expr * expr list | Chaos of expr | EmbFnCall of expr * expr * expr list | Block of block_item list | While of expr * abr_string region_Wrap option * statement
    | Trap of trappable * statement | Return of expr option | ReturnFnCall of expr * expr list | Break | Continue | IfStmt of expr * statement * statement | Switch of expr * ((expr option) list * block_item list) list | EmptyStmt |
    Auxupd of abr_string | Ghostupd of abr_string | Spec of ((abr_string * abr_string) * (statement list * abr_string)) | AsmStmt of bool * asmblock | LocalInit of expr
  and statement = Stmt of statement_node region_Wrap
  datatype ext_decl = FnDefn of (expr ctype * abr_string region_Wrap) * (expr ctype * abr_string region_Wrap) list * fnspec list * (block_item list) region_Wrap | Decl of declaration region_Wrap
  datatype 'a tmp_inh = Tinh of 'a
  datatype 'a tmp_sub = Tsub of 'a
  datatype namea = Name0 of int
  datatype position = EQ | LT | GT | UN
  datatype 'a tmp_univ = Tuniv of 'a
  datatype cChar = CChar0 of char * bool | CChars0 of char list * bool
  datatype 'a flags = Flags0 of int
  datatype positiona = Position0 of int * abr_string * int * int | NoPosition0 | BuiltinPosition0 | InternalPosition0
  datatype nodeInfo = OnlyPos0 of positiona * (positiona * int) | NodeInfo0 of positiona * (positiona * int) * namea
  datatype ident = Ident0 of abr_string * int * nodeInfo
  datatype cFloat = CFloat0 of abr_string
  datatype sUERef = AnonymousRef0 of namea | NamedRef0 of ident
  datatype ('a, 'b) either = Left of 'a | Right of 'b
  datatype 'a optiona = None | Some of 'a
  datatype ('a, 'b, 'c, 'd) struct_flat = Struct_root of 'a * 'b * (('a * 'c), 'd) sum list | Struct_leaf of (('a * 'b), 'd) sum
  datatype ('a, 'b, 'c, 'd) struct_tree = Struct_tree of 'a option * 'b * ((('a, 'b, 'c, 'd) struct_tree * 'c), 'd) sum list
  datatype reporting = Warning | Error | Writeln
  datatype cString = CString0 of abr_string * bool
  datatype commentFormat = SingleLine | MultiLine
  datatype comment = Commenta of positiona * abr_string * commentFormat
  datatype ('a, 'b, 'c, 'd, 'e, 'f) declaration0 = VarDecl0 of 'a | StructDecl0_root of 'b | StructDecl0_child of 'c | TypeDecl0 of 'd | ExtFnDecl0 of 'e | EnumDecl0 of 'f
  datatype cIntFlag = FlagUnsigned0 | FlagLong0 | FlagLongLong0 | FlagImag0
  datatype cIntRepr = DecRepr0 | HexRepr0 | OctalRepr0
  datatype cInteger = CInteger0 of int * cIntRepr * cIntFlag flags
  datatype cUnaryOp = CPreIncOp0 | CPreDecOp0 | CPostIncOp0 | CPostDecOp0 | CAdrOp0 | CIndOp0 | CPlusOp0 | CMinOp0 | CCompOp0 | CNegOp0
  datatype parsing_style = Style_Haskell | Style_ML
  datatype cAssignOp = CAssignOp0 | CMulAssOp0 | CDivAssOp0 | CRmdAssOp0 | CAddAssOp0 | CSubAssOp0 | CShlAssOp0 | CShrAssOp0 | CAndAssOp0 | CXorAssOp0 | COrAssOp0
  datatype cBinaryOp = CMulOp0 | CDivOp0 | CRmdOp0 | CAddOp0 | CSubOp0 | CShlOp0 | CShrOp0 | CLeOp0 | CGrOp0 | CLeqOp0 | CGeqOp0 | CEqOp0 | CNeqOp0 | CAndOp0 | CXorOp0 | COrOp0 | CLndOp0 | CLorOp0
  datatype 'a cConstant = CIntConst0 of cInteger * 'a | CCharConst0 of cChar * 'a | CFloatConst0 of cFloat * 'a | CStrConst0 of cString * 'a
  datatype 'a class_output = C_out_OclAny | C_out_simple of 'a
  datatype 'a cFunctionSpecifier = CInlineQual0 of 'a | CNoreturnQual0 of 'a
  datatype 'a cStorageSpecifier = CAuto0 of 'a | CRegister0 of 'a | CStatic0 of 'a | CExtern0 of 'a | CTypedef0 of 'a | CThread0 of 'a
  datatype cStructTag = CStructTag0 | CUnionTag0
  datatype 'a cStringLiteral = CStrLit0 of cString * 'a
  datatype 'a cArraySize = CNoArrSize0 of bool | CArrSize0 of bool * 'a cExpression
  and 'a cDerivedDeclarator = CPtrDeclr0 of 'a cTypeQualifier list * 'a | CArrDeclr0 of 'a cTypeQualifier list * 'a cArraySize * 'a | CFunDeclr0 of ((ident list), ('a cDeclaration list * bool)) either * 'a cAttribute list * 'a
  and 'a cDeclarator = CDeclr0 of ident optiona * 'a cDerivedDeclarator list * 'a cStringLiteral optiona * 'a cAttribute list * 'a
  and 'a cFunctionDef = CFunDef0 of 'a cDeclarationSpecifier list * 'a cDeclarator * 'a cDeclaration list * 'a cStatement * 'a
  and 'a cCompoundBlockItem = CBlockStmt0 of 'a cStatement | CBlockDecl0 of 'a cDeclaration | CNestedFunDef0 of 'a cFunctionDef
  and 'a cStatement = CLabel0 of ident * 'a cStatement * 'a cAttribute list * 'a | CCase0 of 'a cExpression * 'a cStatement * 'a | CCases0 of 'a cExpression * 'a cExpression * 'a cStatement * 'a | CDefault0 of 'a cStatement * 'a |
    CExpr0 of 'a cExpression optiona * 'a | CCompound0 of ident list * 'a cCompoundBlockItem list * 'a | CIf0 of 'a cExpression * 'a cStatement * 'a cStatement optiona * 'a | CSwitch0 of 'a cExpression * 'a cStatement * 'a |
    CWhile0 of 'a cExpression * 'a cStatement * bool * 'a | CFor0 of ('a cExpression optiona, 'a cDeclaration) either * 'a cExpression optiona * 'a cExpression optiona * 'a cStatement * 'a | CGoto0 of ident * 'a |
    CGotoPtr0 of 'a cExpression * 'a | CCont0 of 'a | CBreak0 of 'a | CReturn0 of 'a cExpression optiona * 'a | CAsm0 of 'a cAssemblyStatement * 'a
  and 'a cExpression = CComma0 of 'a cExpression list * 'a | CAssign0 of cAssignOp * 'a cExpression * 'a cExpression * 'a | CCond0 of 'a cExpression * 'a cExpression optiona * 'a cExpression * 'a |
    CBinary0 of cBinaryOp * 'a cExpression * 'a cExpression * 'a | CCast0 of 'a cDeclaration * 'a cExpression * 'a | CUnary0 of cUnaryOp * 'a cExpression * 'a | CSizeofExpr0 of 'a cExpression * 'a | CSizeofType0 of 'a cDeclaration * 'a
    | CAlignofExpr0 of 'a cExpression * 'a | CAlignofType0 of 'a cDeclaration * 'a | CComplexReal0 of 'a cExpression * 'a | CComplexImag0 of 'a cExpression * 'a | CIndex0 of 'a cExpression * 'a cExpression * 'a |
    CCall0 of 'a cExpression * 'a cExpression list * 'a | CMember0 of 'a cExpression * ident * bool * 'a | CVar0 of ident * 'a | CConst0 of 'a cConstant |
    CCompoundLit0 of 'a cDeclaration * ('a cPartDesignator list * 'a cInitializer) list * 'a | CGenericSelection0 of 'a cExpression * ('a cDeclaration optiona * 'a cExpression) list * 'a | CStatExpr0 of 'a cStatement * 'a |
    CLabAddrExpr0 of ident * 'a | CBuiltinExpr0 of 'a cBuiltinThing
  and 'a cAttribute = CAttr0 of ident * 'a cExpression list * 'a
  and 'a cTypeQualifier = CConstQual0 of 'a | CVolatQual0 of 'a | CRestrQual0 of 'a | CAtomicQual0 of 'a | CAttrQual0 of 'a cAttribute | CNullableQual0 of 'a | CNonnullQual0 of 'a
  and 'a cEnumeration = CEnum0 of ident optiona * ((ident * 'a cExpression optiona) list) optiona * 'a cAttribute list * 'a
  and 'a cPartDesignator = CArrDesig0 of 'a cExpression * 'a | CMemberDesig0 of ident * 'a | CRangeDesig0 of 'a cExpression * 'a cExpression * 'a
  and 'a cInitializer = CInitExpr0 of 'a cExpression * 'a | CInitList0 of ('a cPartDesignator list * 'a cInitializer) list * 'a
  and 'a cAssemblyOperand = CAsmOperand0 of ident optiona * 'a cStringLiteral * 'a cExpression * 'a
  and 'a cAssemblyStatement = CAsmStmt0 of 'a cTypeQualifier optiona * 'a cStringLiteral * 'a cAssemblyOperand list * 'a cAssemblyOperand list * 'a cStringLiteral list * 'a
  and 'a cAlignmentSpecifier = CAlignAsType0 of 'a cDeclaration * 'a | CAlignAsExpr0 of 'a cExpression * 'a
  and 'a cDeclarationSpecifier = CStorageSpec0 of 'a cStorageSpecifier | CTypeSpec0 of 'a cTypeSpecifier | CTypeQual0 of 'a cTypeQualifier | CFunSpec0 of 'a cFunctionSpecifier | CAlignSpec0 of 'a cAlignmentSpecifier
  and 'a cDeclaration = CDecl0 of 'a cDeclarationSpecifier list * (('a cDeclarator optiona * 'a cInitializer optiona) * 'a cExpression optiona) list * 'a | CStaticAssert0 of 'a cExpression * 'a cStringLiteral * 'a
  and 'a cBuiltinThing = CBuiltinVaArg0 of 'a cExpression * 'a cDeclaration * 'a | CBuiltinOffsetOf0 of 'a cDeclaration * 'a cPartDesignator list * 'a | CBuiltinTypesCompatible0 of 'a cDeclaration * 'a cDeclaration * 'a
  and 'a cStructureUnion = CStruct0 of cStructTag * ident optiona * ('a cDeclaration list) optiona * 'a cAttribute list * 'a
  and 'a cTypeSpecifier = CVoidType0 of 'a | CCharType0 of 'a | CShortType0 of 'a | CIntType0 of 'a | CLongType0 of 'a | CFloatType0 of 'a | CDoubleType0 of 'a | CSignedType0 of 'a | CUnsigType0 of 'a | CBoolType0 of 'a |
    CComplexType0 of 'a | CInt128Type0 of 'a | CSUType0 of 'a cStructureUnion * 'a | CEnumType0 of 'a cEnumeration * 'a | CTypeDef0 of ident * 'a | CTypeOfExpr0 of 'a cExpression * 'a | CTypeOfType0 of 'a cDeclaration * 'a |
    CAtomicType0 of 'a cDeclaration * 'a
  datatype fold_all_input = Fold_meta of all_meta_embedding | Fold_custom of all_meta list
  datatype clangCVersion = ClangCVersion0 of abr_string
  datatype 'a cExternalDeclaration = CDeclExt0 of 'a cDeclaration | CFDefExt0 of 'a cFunctionDef | CAsmExt0 of 'a cStringLiteral * 'a
  datatype 'a cTranslationUnit = CTranslUnit0 of 'a cExternalDeclaration list * 'a
  datatype 'a comment_type = Invariant of char list | Fnspeca of (char list * char list) list | Relspeca of char list | Modifies of ((char list) option) list | Dont_translate | Auxupda of char list | Ghostupda of char list |
    Speca of (char list * char list) | End_spec of char list | Calls of ((char list) option) list | Owned_by of char list | OTHER of 'a
  datatype ('a, 'b) inheritance_ext = Inheritance_ext of 'a * ('a * 'a list) list * 'a list * 'b
  datatype 'a lexical_ext = Lexical_ext of abr_string * abr_string * (abr_string -> semi_terma) * 'a
  datatype print_examp_instance_draw_list_attr = Return_obj of unit ocl_ty_class_ext | Return_exp of semi_terma
  datatype print_examp_instance_draw_list_attr_err = Return_err_ty of (ocl_ty * ocl_data_shallow) | Return_err_ty_auto | Return_ocl_null | Return_ocl_invalid | Return_object_variable of abr_string |
    Return_err_l of print_examp_instance_draw_list_attr_err list
  datatype 'a print_examp_instance_draw_list_attra = Return_val of 'a | Return_err of print_examp_instance_draw_list_attr_err
  datatype ('a, 'b) print_iskindof_up_istypeof_output = M_simp_only of 'a | M_erule of 'b | M_simp_d_e_p_t_h_1 | M_simp_d_e_p_t_h_2 | M_simp_b_r_e_a_d_t_h
  val id : 'a -> 'a
  val plus_nat : nat -> nat -> nat
  val suc : nat -> nat
  val d_output_header_thy : 'a compiler_env_config_ext -> (abr_string * (abr_string list * abr_string)) option
  val d_ocl_semantics : 'a compiler_env_config_ext -> generation_semantics_ocl
  val flattena : abr_string list -> abr_string
  val flattenb : abr_string -> abr_string -> abr_string
  val foldl : ('a -> 'b -> 'a) -> 'a -> 'b list -> 'a
  val fold : ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b
  val rev : 'a list -> 'a list
  val map : ('a -> 'b) -> 'a list -> 'b list
  val replace_integers : (int -> abr_string) -> abr_string -> string option -> abr_string -> abr_string
  val map_gena : (abr_string -> string option -> abr_string -> abr_string) -> (int -> abr_string) -> string_b_a_s_e -> abr_string
  val mapa : ('a -> 'b) -> 'a list -> 'b list
  val map_gen : (abr_string -> string option -> abr_string -> abr_string) -> (int -> abr_string) -> abr_string -> abr_string
  val replace_integersa : (int -> abr_string) -> abr_string -> abr_string
  val mapM : ('a -> 'b -> 'c * 'b) -> 'a list -> 'b -> 'c list * 'b
  val start_map : ('a -> 'b) -> 'a list -> 'c -> 'b list * 'c
  val start_mapf : ('a -> 'b) -> ((abr_string -> abr_string) -> generation_semantics_ocl -> 'a list) -> 'c compiler_env_config_ext -> 'b list * 'c compiler_env_config_ext
  val i : ('a -> semi_theory) -> 'a -> all_meta
  val text : text -> all_meta
  val txt : ((abr_string -> abr_string) -> generation_semantics_ocl -> abr_string) -> ('a -> 'b compiler_env_config_ext -> all_meta list * 'b compiler_env_config_ext) embedding_fun
  val minus_nat : nat -> nat -> nat
  val nth : 'a list -> nat -> 'a
  val less_nat : nat -> nat -> bool
  val upt : nat -> nat -> nat list
  val zip : 'a list -> 'b list -> ('a * 'b) list
  val app_rev : 'a -> ('a -> 'b) -> 'b
  val current_parsing_style : parsing_style
  val function_definition_params0 : ('a cDeclaration -> 'b) -> 'a cDeclaration list -> 'b list
  val ident_struct_type0 : abr_string -> abr_string
  val less_eq_nat : nat -> nat -> bool
  val foldl_one : ('a -> int -> 'a) -> 'a -> string -> 'a
  val foldlb : ('a -> int -> 'a) -> 'a -> string_b_a_s_e -> 'a
  val foldla : ('a -> int -> 'a) -> 'a -> abr_string -> 'a
  val to_list : abr_string -> int list
  val length : abr_string -> nat
  val pref_ident : abr_string -> abr_string
  val ident_struct_type : ident -> abr_string
  val decl_spec_ty_tag : cStructTag -> abr_string -> 'a ctype
  val map_option : ('a -> 'b) -> 'a optiona -> 'b option
  val ident : ident -> abr_string
  val ident_option : ident optiona -> abr_string option
  val map_filter : ('a -> 'b option) -> 'a list -> 'b list
  val identb : ident -> 'a ctype
  val takeWhile : ('a -> bool) -> 'a list -> 'a list
  val dropWhile : ('a -> bool) -> 'a list -> 'a list
  val groupBy : ('a -> 'a -> bool) -> 'a list -> ('a list) list
  val tl : 'a list -> 'a list
  val hd : 'a list -> 'a
  val decl_spec_ty : 'a cDeclarationSpecifier list -> 'b ctype
  val ident_struct_const : ident -> abr_string
  val meta_of_logic : abr_string -> string
  val not_yet_supported : abr_string -> unit
  val map_prod : ('a -> 'b) -> ('c -> 'd) -> 'a * 'c -> 'b * 'd
  val bogus : sourcePos
  val comp2 : ('a -> 'b) -> ('c -> 'd -> 'a) -> 'c -> 'd -> 'b
  val wrap : 'a -> sourcePos -> sourcePos -> 'a region_Wrap
  val bogwrap : 'a -> 'a region_Wrap
  val ebogwrap : expr_node -> expr
  val of_boola : 'a zero_neq_one -> bool -> 'a
  val integer_of_char : char -> int
  val show_intFlag : cIntFlag -> abr_string
  val apsnd : ('a -> 'b) -> 'c * 'a -> 'c * 'b
  val divmod_integer : int -> int -> int * int
  val snd : 'a * 'b -> 'b
  val modulo_integer : int -> int -> int
  val modulo_int : inta -> inta -> inta
  val power : 'a power -> 'a -> nat -> 'a
  val word_of_int : 'a len0 -> inta -> 'a word
  val foldr : ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b
  val concat : ('a list) list -> 'a list
  val fst : 'a * 'b -> 'a
  val divide_integer : int -> int -> int
  val divide_int : inta -> inta -> inta
  val bin_rest : inta -> inta
  val equal_int : inta -> inta -> bool
  val bin_last : inta -> bool
  val bin_to_bl_aux : nat -> inta -> bool list -> bool list
  val bin_to_bl : nat -> inta -> bool list
  val uint : 'a len0 -> 'a word -> inta
  val to_bl : 'a len0 -> 'a word -> bool list
  val constant : 'a cConstant -> literalconstant_node region_Wrap
  val binaryOp : cBinaryOp -> binoptype
  val unaryOp : cUnaryOp -> unoptype
  val deriv_decl_spec : 'a cDerivedDeclarator list -> 'a cDeclarationSpecifier list -> expr ctype
  val expression0 : 'a cExpression -> expr_node
  val expression : 'a cExpression -> expr
  val partDesignator : 'a cPartDesignator -> designator
  val initializerList : ('a cPartDesignator list * 'a cInitializer) list -> (designator list * initializer) list
  val initializer0 : ('a cExpression -> 'a cExpression) -> 'a cInitializer -> initializer
  val initializer : 'a cInitializer -> initializer
  val deriv_decl_spec0 : 'a cDerivedDeclarator list -> expr ctype -> expr ctype
  val function_definition_params : (abr_string -> 'a) -> 'b cDeclaration list -> (expr ctype * 'a) list
  val p_first_of_NodeInfo : nodeInfo -> positiona * int
  val p_last_of_NodeInfo : nodeInfo -> positiona * int
  val pos_of_CFunDef : 'a cFunctionDef -> 'a
  val pos_of_CStat : 'a cStatement -> 'a
  val pos_of_CDecl : 'a cDeclaration -> 'a
  val pos_of_CBlockItem : 'a cCompoundBlockItem -> 'a
  val map_comment_type : ('a -> 'b) -> 'a comment_type -> 'b comment_type
  val catch_error : ('a, 'b) sum -> ('a -> ('c, 'b) sum) -> ('c, 'b) sum
  val or : ('a -> ('b, 'c) sum) -> ('a -> ('d, 'c) sum) -> 'a -> ('d, 'c) sum
  val returna : 'a -> 'b list -> ((char list), ('a * 'b list)) sum
  val bindc : ('a, 'b) sum -> ('b -> ('a, 'c) sum) -> ('a, 'c) sum
  val bindd : ('a list -> ((char list), ('b * 'a list)) sum) -> ('b -> 'a list -> ((char list), ('c * 'a list)) sum) -> 'a list -> ((char list), ('c * 'a list)) sum
  val many_c_a_t_c_h_a_l_l_aux : 'a list -> ('b list -> ((char list), ('a * 'b list)) sum) -> 'b list -> ((char list), ('a list * 'b list)) sum
  val many_c_a_t_c_h_a_l_l : ('a list -> ((char list), ('b * 'a list)) sum) -> 'a list -> ((char list), ('b list * 'a list)) sum
  val map_sum : ('a -> 'b) -> ('c -> 'd) -> ('a, 'c) sum -> ('b, 'd) sum
  val bind2 : ('a, ('b * 'c)) sum -> ('b -> 'd) -> ('a, ('d * 'c)) sum
  val bind3 : ('a -> ('b, ('c * 'd)) sum) -> ('c -> 'e) -> 'a -> ('b, ('e * 'd)) sum
  val bit_cut_integer : int -> int * bool
  val char_of_integer : int -> char
  val explode : string -> char list
  val scan_upto_b_i_n_d : ('a list -> ('b, ('c * 'a list)) sum) -> 'a list -> ((char list), (('a list * 'c) * 'a list)) sum
  val errorb : char list -> 'a list -> ((char list), ('b * 'a list)) sum
  val oneof_b_i_n_d : ('a list -> ((char list), ('b * 'a list)) sum) list -> 'a list -> ((char list), ('b * 'a list)) sum
  val bind_k : ('a -> ('b, ('c * 'd)) sum) -> 'e -> 'a -> ('b, ('e * 'd)) sum
  val shows_prec_list : 'a show -> nat -> 'a list -> char list -> char list
  val shows_quote : (char list -> char list) -> char list -> char list
  val take : nat -> 'a list -> 'a list
  val err_expecting : 'a show -> char list -> 'a list -> ((char list), ('b * 'a list)) sum
  val exactly_aux : 'a equal * 'a show -> char list -> 'a list -> 'a list -> 'a list -> ((char list), (char list * 'a list)) sum
  val exactly : char list -> char list -> ((char list), (char list * char list)) sum
  val many : (char -> bool) -> char list -> ((char list), (char list * char list)) sum
  val many1 : (char -> bool) -> char list -> ((char list), (char list * char list)) sum
  val member : 'a equal -> 'a list -> 'a -> bool
  val manyof1 : char list -> char list -> ((char list), (char list * char list)) sum
  val stars1 : char list -> ((char list), (char list * char list)) sum
  val end_comment : char list -> ((char list), (char list * char list)) sum
  val parse_id_m_a_y_b_e : (char list) list -> char list -> ((char list), ((char list * (char list) option) * char list)) sum
  val parse_id_o_n_e : (char list) list -> char list -> ((char list), (char list * char list)) sum
  val many_m_a_x_aux : 'a list -> ('b list -> ((char list), ('a * 'b list)) sum) -> 'b list -> ((char list), ('a list * 'b list)) sum
  val many_m_a_x : ('a list -> ((char list), ('b * 'a list)) sum) -> 'a list -> ((char list), ('b list * 'a list)) sum
  val parse_id_list : (char list) list -> char list -> ((char list), (((char list) option) list * char list)) sum
  val in_safe_monad : ('a -> ('b, 'c) sum) -> 'a -> 'c
  val parse_str_aux : (char list) list -> char list -> ((char list), (char list * char list)) sum
  val parse_str : char list -> ((char list), (char list * char list)) sum
  val shows_sep : ('a -> char list -> char list) -> (char list -> char list) -> 'a list -> char list -> char list
  val null : 'a list -> bool
  val shows_list_gen : ('a -> char list -> char list) -> char list -> char list -> char list -> char list -> 'a list -> char list -> char list
  val showsp_list : (nat -> 'a -> char list -> char list) -> nat -> 'a list -> char list -> char list
  val shows_list_list : 'a show -> ('a list) list -> char list -> char list
  val gen_length : nat -> 'a list -> nat
  val size_list : 'a list -> nat
  val trim : char list -> char list
  val drop : nat -> 'a list -> 'a list
  val oneof_aux : (char list) list -> (char list) list -> char list -> ((char list), (char list * char list)) sum
  val oneof : (char list) list -> char list -> ((char list), (char list * char list)) sum
  val eoi : 'a show -> 'a list -> ((char list), (unit * 'a list)) sum
  val parse_commenta : char list -> ((char list), ((char list) comment_type list * char list)) sum
  val string_implode : char list -> abr_string
  val errora : abr_string -> 'a
  val parse_comment : comment -> abr_string comment_type list
  val sbogwrap : statement_node -> statement
  val filter_statement : comment list -> (block_item, ((abr_string * abr_string), abr_string) sum) sum list
  val impl_of : ('b, 'a) alist -> ('b * 'a) list
  val map_of : 'a equal -> ('a * 'b) list -> 'a -> 'b option
  val lookup : 'a equal -> ('a, 'b) alist -> 'a -> 'b option
  val lookupa : 'a equal -> ('a, 'b) alist -> 'a -> 'b option
  val get_column : 'a equal -> 'b plus * 'b ord -> ('a, (('b * 'b) list)) alist -> 'a -> 'b -> 'b
  val pos_in_interval_haskell : ((abr_string * int), ((int * int) list)) alist -> (positiona * int) * (positiona * int) -> positiona -> bool
  val pos_in_interval_ml : 'a -> (positiona * int) * (positiona * int) -> positiona -> bool
  val pos_in_interval : ((abr_string * int), ((int * int) list)) alist -> (positiona * int) * (positiona * int) -> positiona -> bool
  val partition : ('a -> bool) -> 'a list -> 'a list * 'a list
  val comment_interval : comment list * ((abr_string * int), ((int * int) list)) alist -> (positiona * int) * (positiona * int) -> comment list
  val return : 'a -> 'b -> 'b * 'a
  val bindb : ('a -> 'b * 'c) -> ('c -> 'b -> 'd) -> 'a -> 'd
  val foldM_o : ('a -> 'b -> 'b * 'c) -> 'a optiona -> 'b -> 'b * 'c optiona
  val unsupported : abr_string -> 'a -> 'a * nodeInfo cExpression
  val foldM : ('a -> 'b -> 'b * 'c) -> 'a list -> 'b -> 'b * 'c list
  val stmt_out_of_expr : nodeInfo cExpression -> 'a -> 'a * nodeInfo cExpression
  val stmt_out_of_expra : nodeInfo cExpression -> nodeInfo cExpression
  val map_optiona : ('a -> 'b) -> 'a option -> 'b option
  val maps : ('a -> 'b list) -> 'a list -> 'b list
  val filter_gen : (abr_string comment_type -> (char list) option) -> (abr_string -> 'a) -> comment list -> 'a option
  val filter_owned_by : comment list -> gcc_attribute option
  val tree_of_decl_spec :
    'a cStructureUnion ->
      (abr_string, (cStructTag * ('a cDeclaration list * ('a cAttribute list * 'a))), (cStructTag * (('a cDeclarator optiona * 'a cInitializer optiona) * 'a cExpression optiona) list),
        ('a cDeclarationSpecifier list * (('a cDeclarator optiona * 'a cInitializer optiona) * 'a cExpression optiona) list))
        struct_tree
  val fresh_ident : unit -> abr_string
  val concat_map : ('a -> 'b list) -> 'a list -> 'b list
  val struct_conv : (abr_string, 'a, 'b, 'c) struct_tree -> abr_string * (abr_string, 'a, 'b, 'c) struct_flat list
  val list_ex : ('a -> bool) -> 'a list -> bool
  val extract : ('a -> bool) -> 'a list -> ('a list * ('a * 'a list)) option
  val decl_spec0 :
    'a cDeclarationSpecifier list ->
      ((nodeInfo cDeclarator optiona * 'b) * 'c) list * (positiona * int) ->
        ((ident optiona * ('d ctype option * (nodeInfo cDerivedDeclarator list * ('b * ((positiona * int) * ((positiona * int) * nodeInfo cAttribute list)))))),
          (abr_string *
            ((cStructTag * ('a cDeclaration list * ('a cAttribute list * 'a))) *
              ((abr_string * (cStructTag * (('a cDeclarator optiona * 'a cInitializer optiona) * 'a cExpression optiona) list)),
                ('a cDeclarationSpecifier list * (('a cDeclarator optiona * 'a cInitializer optiona) * 'a cExpression optiona) list))
                sum list)),
          (abr_string * (cStructTag * ('a cDeclaration list * ('a cAttribute list * 'a)))), (ident optiona * ('d ctype option * nodeInfo cDerivedDeclarator list)),
          (ident optiona * (nodeInfo cDerivedDeclarator list * ((((ident list), (nodeInfo cDeclaration list * bool)) either * (nodeInfo cAttribute list * nodeInfo)) * (nodeInfo cDerivedDeclarator list * nodeInfo cAttribute list)))),
          ((abr_string option) region_Wrap * (abr_string * expr option) list))
          declaration0 list
  val identa : ident -> abr_string
  val attrs0 : nodeInfo cAttribute -> gcc_attribute
  val empty : ('a, 'b) alist
  val emptya : ('a, 'b) alist
  val update : 'a equal -> 'a -> 'b -> ('a * 'b) list -> ('a * 'b) list
  val updatea : 'a equal -> 'a -> 'b -> ('a, 'b) alist -> ('a, 'b) alist
  val insert : 'a equal -> 'a -> 'b -> ('a, 'b) alist -> ('a, 'b) alist
  val union_loada : 'a equal -> 'a list -> bool * ('a list * ('a, unit) alist) -> bool * ('a list * ('a, unit) alist)
  val entries : ('a, 'b) alist -> ('a * 'b) list
  val is_emptya : ('a, 'b) alist -> bool
  val keys_emptya : ('a list -> 'b) -> bool * ('a list * ('c, 'd) alist) -> 'b list
  val bulkload : 'a equal -> ('a * 'b) list -> ('a, 'b) alist
  val folda : ('a -> 'b -> 'c -> 'c) -> ('a, 'b) alist -> 'c -> 'c
  val union : 'a equal -> ('a, 'b) alist -> ('a, 'b) alist -> ('a, 'b) alist
  val union_load : 'a equal -> 'a list -> 'b * ('a, unit) alist -> bool * ('a, unit) alist
  val keys : ('a, 'b) alist -> 'a list
  val keys_empty : ('a list -> 'b) -> bool * ('a, 'c) alist -> 'b list
  val collapse_mod_attribs : fnspec list -> fnspec list
  val filter_fnspec : comment list -> fnspec list
  val attrs : nodeInfo cDeclarationSpecifier list ->
                nodeInfo cDerivedDeclarator list -> nodeInfo cAttribute list -> ((comment list * ((abr_string * int), ((int * int) list)) alist) * (positiona * int) option) * (positiona * int) -> fnspec list
  val decl_spec :
    nodeInfo cDeclarationSpecifier list ->
      ((nodeInfo cDeclarator optiona * nodeInfo cInitializer optiona) * 'a) list * (positiona * int) -> ((comment list * ((abr_string * int), ((int * int) list)) alist) * (positiona * int) option) * (positiona * int) -> declaration list
  val declaration : (comment list * ((abr_string * int), ((int * int) list)) alist) * (positiona * int) option -> (declaration region_Wrap -> 'a) -> nodeInfo cDeclaration -> 'a list
  val equal_CAssignOp : cAssignOp -> cAssignOp -> bool
  val statement_of_expression_CAssign_fun : 'a cExpression -> bool
  val binoptype_of_CAssignOp : cAssignOp -> binoptype option
  val statement_of_expression_CAssign : cAssignOp -> nodeInfo cExpression -> nodeInfo cExpression -> statement_node
  val list_all : ('a -> bool) -> 'a list -> bool
  val expr_int : int -> expr
  val statement_node_of_expression : nodeInfo cExpression -> statement_node
  val filter_auxupd : comment list -> statement_node option
  val pos_of_CBuiltin : 'a cBuiltinThing -> 'a
  val pos_of_CConst : 'a cConstant -> 'a
  val pos_of_CExpr : 'a cExpression -> 'a
  val statement_node_of_expressiona : nodeInfo cExpression optiona -> (nodeInfo * (comment list * ((abr_string * int), ((int * int) list)) alist)) option -> statement_node
  val remove_last_break : 'a cStatement -> 'a cStatement option
  val statement0_case : 'a cExpression list -> 'a cStatement -> bool * ('a cExpression list * 'a cStatement)
  val statement_Switch : 'a -> (nodeInfo cCompoundBlockItem list -> (positiona * int) * (positiona * int) -> block_item list) -> 'b cExpression -> nodeInfo cCompoundBlockItem list -> nodeInfo -> statement_node
  val filter_invariant : comment list -> abr_string region_Wrap option
  val statement_While : nodeInfo cExpression -> statement * nodeInfo -> bool -> nodeInfo * (comment list * ((abr_string * int), ((int * int) list)) alist) -> statement_node
  val stringLiteral : 'a cStringLiteral -> abr_string
  val assemblyOperand : 'a cAssemblyOperand list -> (abr_string option * (abr_string * expr)) list
  val statement_For :
    (nodeInfo cExpression optiona, nodeInfo cDeclaration) either ->
      nodeInfo cExpression optiona -> nodeInfo cExpression optiona -> statement * nodeInfo -> nodeInfo * (comment list * ((abr_string * int), ((int * int) list)) alist) -> statement_node
  val statement_If : ('a -> statement) -> 'b cExpression -> 'a -> 'a optiona -> statement_node
  val group_spec_aux1 : (block_item list) list -> ((block_item list), (((abr_string * abr_string), abr_string) sum list)) sum list -> block_item list
  val group_spec_aux2 : (block_item list) list -> abr_string * abr_string -> block_item list -> abr_string -> ((block_item list), (((abr_string * abr_string), abr_string) sum list)) sum list -> block_item list
  val group_spec : (block_item, ((abr_string * abr_string), abr_string) sum) sum list -> block_item list
  val block_item_list0a : comment list * ((abr_string * int), ((int * int) list)) alist -> nodeInfo cCompoundBlockItem list -> nodeInfo -> block_item list
  val statement0 : comment list * ((abr_string * int), ((int * int) list)) alist -> nodeInfo cStatement -> statement
  val block_item_list0 : comment list * ((abr_string * int), ((int * int) list)) alist -> nodeInfo cCompoundBlockItem list -> (positiona * int) * (positiona * int) -> block_item list
  val comp3 : ('a -> 'b) -> ('c -> 'd -> 'e -> 'a) -> 'c -> 'd -> 'e -> 'b
  val block_item_list : comment list * ((abr_string * int), ((int * int) list)) alist -> nodeInfo cCompoundBlockItem list -> nodeInfo -> (block_item list) region_Wrap
  val function_definition : (comment list * ((abr_string * int), ((int * int) list)) alist) * (positiona * int) option -> nodeInfo cFunctionDef -> ext_decl
  val external_declaration : (comment list * ((abr_string * int), ((int * int) list)) alist) * (positiona * int) option -> nodeInfo cExternalDeclaration -> ext_decl list
  val pos_of_CExtDecl : 'a cExternalDeclaration -> 'a
  val mapc : 'a equal -> ('a -> 'b -> 'c) -> ('a, 'b) alist -> ('a, 'c) alist
  val translation_unit : nodeInfo cTranslationUnit * (comment list * int list) -> ext_decl list
  val main : nodeInfo cTranslationUnit * (comment list * int list) -> ext_decl list
  val txta : abr_string -> ('a -> 'b compiler_env_config_ext -> all_meta list * 'b compiler_env_config_ext) embedding_fun
  val succ : 'a one * 'a plus -> 'a -> 'a
  val flip : 'a * 'b -> 'b * 'a
  val find : ('a -> bool) -> 'a list -> 'a option
  val last : 'a list -> 'a
  val minus_int : inta -> inta -> inta
  val less_int : inta -> inta -> bool
  val upto_aux : inta -> inta -> inta list -> inta list
  val uptoa : inta -> inta -> inta list
  val txtb : abr_string list -> ('a -> 'b compiler_env_config_ext -> all_meta list * 'b compiler_env_config_ext) embedding_fun
  val modulo_nat : nat -> nat -> nat
  val divide_nat : nat -> nat -> nat
  val nat_to_digit10_aux : nat list -> nat -> nat list
  val nat_to_digit10 : nat -> abr_string
  val add_0 : int -> abr_string
  val l_fold : (('a -> 'b -> all_meta list * 'b) embedding_fun -> 'c -> 'c) -> ('a, 'b) embedding -> 'c -> 'c
  val txt_a : abr_string list -> ('a -> 'b compiler_env_config_ext -> all_meta list * 'b compiler_env_config_ext) embedding_fun
  val fun_upd : 'a equal -> ('a -> 'b) -> 'a -> 'b -> 'a -> 'b
  val bind : ('a -> 'b option) -> ('b list -> 'c) -> 'a list -> 'c option
  val mapi : (Code_Numeral.natural -> 'a -> 'b) -> 'a list -> 'b list
  val flatten : ('a list) list -> 'a list
  val mapsa : ('a -> 'b list) -> 'a list -> 'b list
  val enumerate : nat -> 'a list -> (nat * 'a) list
  val split : ('a * 'b) list -> 'a list * 'b list
  val takea : ('a list -> 'a list) -> nat -> 'a list -> 'a list
  val uptob : Code_Numeral.natural -> Code_Numeral.natural -> Code_Numeral.natural list
  val mk_dot : abr_string -> abr_string -> abr_string
  val filter : ('a -> bool) -> 'a list -> 'a list
  val binda : 'a option -> ('a -> 'b option) -> 'b option
  val start_mapa : ('a -> 'b) -> 'a -> 'c -> 'b * 'c
  val sectionb : section -> all_meta
  val section_aux : Code_Numeral.natural -> abr_string -> 'a -> 'b -> all_meta list * 'b
  val section : abr_string -> 'a -> 'b -> all_meta list * 'b
  val txt_aa : ((abr_string -> abr_string) -> abr_string list) -> ('a -> 'b compiler_env_config_ext -> all_meta list * 'b compiler_env_config_ext) embedding_fun
  val txt_d : ((abr_string -> abr_string) -> abr_string list) -> ('a -> 'b compiler_env_config_ext -> all_meta list * 'b compiler_env_config_ext) embedding_fun
  val text_raw : text_raw -> all_meta
  val txt_raw : ((abr_string -> abr_string) -> generation_semantics_ocl -> abr_string) -> ('a -> 'b compiler_env_config_ext -> all_meta list * 'b compiler_env_config_ext) embedding_fun
  val assoc : 'a equal -> 'a -> ('a * 'b) list -> 'b option
  val n_lists : nat -> 'a list -> ('a list) list
  val sectiona : abr_string -> ('a -> 'b -> all_meta list * 'b) embedding_fun
  val equal_ocl_ctxt_prefix : ocl_ctxt_prefix -> ocl_ctxt_prefix -> bool
  val d_output_sorry_dirty : 'a compiler_env_config_ext -> generation_lemma_mode option * bool
  val d_input_class : 'a compiler_env_config_ext -> ocl_class option
  val ctxt_fun_name : 'a ocl_ctxt_pre_post_ext -> abr_string
  val split_at : ('a -> bool) -> 'a list -> 'a list * ('a option * 'a list)
  val print_ctxt_to_ocl_gen_split : abr_string -> (int list) option
  val term_parenthesis : semi_terma -> semi_terma
  val term_warning_parenthesis : semi_terma -> semi_terma
  val ctxt_fun_ty : 'a ocl_ctxt_pre_post_ext -> ocl_ty
  val fold_pair_var : (abr_string * ocl_ty -> 'a -> 'a) -> ocl_ty -> 'a -> 'a option
  val ctxt_fun_ty_arg : 'a ocl_ctxt_pre_post_ext -> (abr_string * ocl_ty) list
  val var_result : abr_string
  val var_self : abr_string
  val make_ctxt_free_var : ocl_ctxt_prefix -> 'a ocl_ctxt_pre_post_ext -> abr_string list
  val interpretation : interpretation -> all_meta
  val term_lambdas : abr_string list -> semi_terma -> semi_terma
  val term_lambda : abr_string -> semi_terma -> semi_terma
  val term_applys0 : semi_terma -> semi_terma list -> semi_terma
  val term_app : abr_string -> semi_terma list -> semi_terma
  val sorry : semi_command_final
  val is_none : 'a option -> bool
  val print_ctxt_pre_post_interp : generation_lemma_mode option * bool -> abr_string -> 'a ocl_ctxt_pre_post_ext -> semi_terma -> ocl_ctxt_prefix * semi_terma -> ocl_ctxt_prefix * semi_terma -> all_meta option
  val isup : abr_string -> abr_string
  val print_ctxt_const_name : abr_string -> abr_string -> abr_string option -> abr_string
  val hol_definition : abr_string -> abr_string
  val print_ctxt_pre_post_name : abr_string -> abr_string -> abr_string option -> abr_string
  val d_ocl_accessor : 'a compiler_env_config_ext -> string_b_a_s_e list * string_b_a_s_e list
  val take_first : nat -> 'a list -> 'a list
  val take_last : nat -> 'a list -> 'a list
  val print_ctxt_is_name_at_gen : abr_string -> abr_string -> abr_string option
  val var_at_when_hol_pre : abr_string
  val print_ctxt_is_name_at_pre : abr_string -> abr_string option
  val var_at_when_hol_post : abr_string
  val print_ctxt_is_name_at_post : abr_string -> abr_string option
  val to_lista : string_b_a_s_e -> int list
  val fold_Const : ('a -> abr_string -> 'a) -> 'a -> terma -> 'a
  val map_Const : (abr_string -> typ -> abr_string) -> terma -> terma
  val print_ctxt_to_ocl_gen : string_b_a_s_e list -> (abr_string -> abr_string option) -> abr_string -> ocl_ctxt_term -> ocl_ctxt_term
  val print_ctxt_to_ocl_pre : 'a compiler_env_config_ext -> ocl_ctxt_term -> ocl_ctxt_term
  val nat_of_natural : Code_Numeral.natural -> nat
  val natural_to_digit10 : Code_Numeral.natural -> abr_string
  val var_at_when_ocl_post : abr_string
  val term_postunary : semi_terma -> semi_terma -> semi_terma
  val fold_Free : ('a -> abr_string -> 'a) -> 'a -> terma -> 'a
  val stringa : abr_string -> semi_term_0
  val binop : semi_term_0 -> abr_string -> semi_term_0 -> semi_term_0
  val binop_l : abr_string -> semi_term_0 list -> semi_term_0
  val paren : abr_string -> abr_string -> semi_term_0 -> semi_term_0
  val basic : abr_string list -> semi_term_0
  val lista : semi_term_0 list -> semi_term_0
  val listb : ('a -> semi_term_0) -> 'a list -> semi_term_0
  val parenthesis : semi_term_0 -> semi_term_0
  val pair : semi_term_0 -> semi_term_0 -> semi_term_0
  val apply : semi_term_0 -> semi_term_0 list -> semi_term_0
  val app : abr_string -> semi_term_0 list -> semi_term_0
  val app0 : abr_string -> semi_term_0 list -> semi_term
  val raise_ml : (reporting * abr_string) list -> abr_string -> ml
  val ml : ml -> all_meta
  val raise_ml_unbound : (Code_Numeral.natural -> 'a -> abr_string) -> ('a * ocl_ctxt_term) list -> ('b -> all_meta list) list
  val term_lambdas0 : semi_terma -> semi_terma -> semi_terma
  val axiomatization : axiomatization -> all_meta
  val overloadinga : abr_string -> semi_typ -> abr_string -> semi_terma -> overloading
  val ty_obj_to_string : ocl_ty_obj -> abr_string
  val ctxt_ty : 'a ocl_ctxt_ext -> ocl_ty_obj
  val term_binop : semi_terma -> abr_string -> semi_terma -> semi_terma
  val term_binopa : abr_string -> semi_terma list -> semi_terma
  val term_annot : semi_terma -> abr_string -> semi_terma
  val wrap_oclty : abr_string -> abr_string
  val term_annot_ocl : semi_terma -> abr_string -> semi_terma
  val overloading : overloading -> all_meta
  val cross_abs_aux : (abr_string -> semi_terma -> semi_terma) -> abr_string list -> nat * terma -> semi_terma
  val cross_abs : (abr_string -> semi_terma -> semi_terma) -> nat -> terma -> semi_terma
  val ty_arrow : semi_typ -> semi_typ -> semi_typ
  val ty_arrowb : semi_typ -> semi_typ
  val ctxt_expr : 'a ocl_ctxt_pre_post_ext -> ocl_ctxt_term_pp list
  val ctxt_clause : 'a ocl_ctxt_ext -> ocl_ctxt_clause list
  val fold_pre_post : ((ocl_ctxt_prefix * (abr_string option * ocl_ctxt_term)) list -> unit ocl_ctxt_pre_post_ext -> 'a -> 'a) -> 'b ocl_ctxt_ext -> 'a -> 'a
  val ty_paren : semi_typ -> semi_typ
  val dot_oclastype : abr_string
  val mk_dot_par_gen : abr_string -> abr_string list -> abr_string
  val mk_dot_par : abr_string -> abr_string -> abr_string
  val dot_astype : abr_string -> abr_string
  val get_class_hierarchy_strict_aux : ocl_class list -> ocl_class list -> ocl_class list
  val get_class_hierarchy_strict : ocl_class list -> ocl_class list
  val get_class_hierarchy_aux : ocl_class list -> ocl_class -> ocl_class list
  val get_class_hierarchya : ocl_class -> ocl_class list
  val ascii_of_literal : string -> int
  val is_letter : int -> bool
  val is_digit : int -> bool
  val isub : abr_string -> abr_string
  val fold_class_gen_aux :
    (ocl_class, unit) inheritance_ext list ->
      ((abr_string -> abr_string) -> abr_string -> (abr_string * ocl_ty) list -> ((ocl_class, unit) inheritance_ext list) tmp_inh -> (ocl_class list) tmp_sub -> ocl_class list -> 'a -> 'a) -> 'a -> ocl_class -> 'a
  val fold_class_gen :
    ((abr_string -> abr_string) -> abr_string -> (abr_string * ocl_ty) list -> ((ocl_class, unit) inheritance_ext list) tmp_inh -> (ocl_class list) tmp_sub -> ocl_class list -> 'a -> 'b list * 'a) -> 'a -> ocl_class -> 'b list * 'a
  val inh : ('a, 'b) inheritance_ext -> 'a
  val of_linh : ('a, 'b) inheritance_ext list -> 'a list
  val map_inh : ('a -> 'b) -> 'a tmp_inh -> 'b tmp_inh
  val of_sub : 'a tmp_sub -> 'a
  val fold_class : ((abr_string -> abr_string) -> abr_string -> (abr_string * ocl_ty) list -> (ocl_class list) tmp_inh -> (abr_string list) tmp_sub -> ocl_class list -> 'a -> 'b * 'a) -> 'a -> ocl_class -> 'b list * 'a
  val thma : abr_string -> semi_thm_attribute
  val equal : abr_string -> abr_string -> bool
  val thm : thm -> all_meta
  val print_ctxt_pre_post : 'a ocl_ctxt_ext -> 'b compiler_env_config_ext -> all_meta list * 'b compiler_env_config_ext
  val floor2_PRINT_ctxt_pre_post : ('a ocl_ctxt_ext -> 'b compiler_env_config_ext -> all_meta list * 'b compiler_env_config_ext) embedding_fun
  val print_ctxt_inv_name : abr_string -> abr_string -> abr_string -> abr_string
  val fold_invariant : (ocl_ctxt_term_inv -> 'a -> 'a) -> 'b ocl_ctxt_ext -> 'a -> 'a
  val fold_invarianta : 'a ocl_ctxt_ext -> (abr_string * ocl_ctxt_term) list
  val print_ctxt_thm : 'a ocl_ctxt_ext -> 'b -> all_meta list * 'b
  val floor2_PRINT_ctxt_thm : ('a ocl_ctxt_ext -> 'b -> all_meta list * 'b) embedding_fun
  val print_ctxt_to_ocl_post : 'a compiler_env_config_ext -> ocl_ctxt_term -> ocl_ctxt_term
  val ctxt_param : 'a ocl_ctxt_ext -> abr_string list
  val var_OclForall_set : abr_string
  val definition : definition -> all_meta
  val term_lam : abr_string -> (abr_string -> semi_terma) -> semi_terma
  val append : 'a list -> 'a list -> 'a list
  val print_ctxt_inv : 'a ocl_ctxt_ext -> 'b compiler_env_config_ext -> all_meta list * 'b compiler_env_config_ext
  val floor2_PRINT_ctxt_inv : ('a ocl_ctxt_ext -> 'b compiler_env_config_ext -> all_meta list * 'b compiler_env_config_ext) embedding_fun
  val to_String_b_a_s_e : abr_string -> string_b_a_s_e
  val d_ocl_accessor_update : (string_b_a_s_e list * string_b_a_s_e list -> string_b_a_s_e list * string_b_a_s_e list) -> 'a compiler_env_config_ext -> 'a compiler_env_config_ext
  val d_ocl_HO_type_update : (string_b_a_s_e list -> string_b_a_s_e list) -> 'a compiler_env_config_ext -> 'a compiler_env_config_ext
  val var_Sequence_base : abr_string
  val var_Pair_base : abr_string
  val datatype_name : abr_string
  val var_Set_base : abr_string
  val tyCollect : 'a ocl_multiplicity_ext -> ocl_collection list
  val is_sequence : 'a ocl_multiplicity_ext -> bool
  val str_of_ty : ocl_ty -> abr_string
  val print_infra_type_synonym_class_rec_aux0 : ocl_ty -> abr_string * semi_typ
  val print_infra_type_synonym_class_rec_aux : ocl_ty -> abr_string * semi_typ
  val d_ocl_HO_type : 'a compiler_env_config_ext -> string_b_a_s_e list
  val d_input_meta : 'a compiler_env_config_ext -> all_meta_embedding list
  val update_D_ocl_accessor_post : ('a -> 'b) -> 'c * 'a -> 'c * 'b
  val print_infra_type_synonym_class_sequence_name : abr_string -> abr_string
  val print_infra_type_synonym_class_set_name : abr_string -> abr_string
  val tyObjN_role_multip : 'a ocl_ty_class_node_ext -> unit ocl_multiplicity_ext
  val tyObjN_role_ty : 'a ocl_ty_class_node_ext -> abr_string
  val tyObj_to : 'a ocl_ty_class_ext -> unit ocl_ty_class_node_ext
  val tyObj_name : 'a ocl_ty_class_ext -> abr_string
  val pref_ty_enum : abr_string -> abr_string
  val var_ty_prod : abr_string
  val var_ty_list : abr_string
  val pref_ty_syn : abr_string -> abr_string
  val const_oid : abr_string
  val str_hol_of_ty_all : ('a -> 'a list -> 'a) -> (abr_string -> 'a) -> ocl_ty -> 'a
  val less_eq_natural : Code_Numeral.natural -> Code_Numeral.natural -> bool
  val tyMult : 'a ocl_multiplicity_ext -> (ocl_multiplicity_single * ocl_multiplicity_single option) list
  val single_multip : 'a ocl_multiplicity_ext -> bool
  val raw : abr_string -> semi_typ
  val print_access_dot_consts_ty : ocl_ty -> semi_typ
  val update_D_ocl_accessor_pre : ('a -> 'b) -> 'a * 'c -> 'b * 'c
  val natural_of_nat : nat -> Code_Numeral.natural
  val var_at_when_ocl_pre : abr_string
  val type_synonyma : abr_string -> semi_typ -> type_synonym
  val consts_value : abr_string
  val consts_raw0 : abr_string -> semi_typ -> abr_string -> Code_Numeral.natural option -> consts
  val is_higher_order : ocl_ty -> bool
  val ctxt_fun_ty_out : 'a ocl_ctxt_pre_post_ext -> ocl_ty option
  val type_synonym : type_synonym -> all_meta
  val ty_arrowa : semi_typ list -> semi_typ
  val map_enum_syn : ocl_enum list -> ocl_class_synonym list -> ocl_ty -> ocl_ty
  val consts : consts -> all_meta
  val membera : string_b_a_s_e list -> abr_string -> bool
  val print_ctxt_const : 'a ocl_ctxt_ext -> 'b compiler_env_config_ext -> ('b compiler_env_config_ext * all_meta list) * all_meta list
  val d_output_auto_bootstrap_update : (bool -> bool) -> 'a compiler_env_config_ext -> 'a compiler_env_config_ext
  val d_output_disable_thy_update : (bool -> bool) -> 'a compiler_env_config_ext -> 'a compiler_env_config_ext
  val d_output_header_thy_update : ((abr_string * (abr_string list * abr_string)) option -> (abr_string * (abr_string list * abr_string)) option) -> 'a compiler_env_config_ext -> 'a compiler_env_config_ext
  val d_output_auto_bootstrap : 'a compiler_env_config_ext -> bool
  val d_input_meta_update : (all_meta_embedding list -> all_meta_embedding list) -> 'a compiler_env_config_ext -> 'a compiler_env_config_ext
  val d_output_disable_thy : 'a compiler_env_config_ext -> bool
  val d_ocl_oid_start : 'a compiler_env_config_ext -> internal_oids
  val co15 : ('a -> 'b) -> ('c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'i -> 'j -> 'k -> 'l -> 'm -> 'n -> 'o -> 'p -> 'q -> 'a) -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'i -> 'j -> 'k -> 'l -> 'm -> 'n -> 'o -> 'p -> 'q -> 'b
  val makea : bool -> (abr_string * (abr_string list * abr_string)) option ->
                        internal_oids ->
                          Code_Numeral.natural * Code_Numeral.natural ->
                            generation_semantics_ocl ->
                              ocl_class option ->
                                all_meta_embedding list ->
                                  (string_b_a_s_e * (unit ocl_instance_single_ext * internal_oids)) list ->
                                    (string_b_a_s_e * (internal_oids * (abr_string * unit ocl_instance_single_ext) ocl_def_state_core) list) list ->
                                      bool -> bool -> string_b_a_s_e list * string_b_a_s_e list -> string_b_a_s_e list -> string_b_a_s_e list -> generation_lemma_mode option * bool -> unit compiler_env_config_ext
  val compiler_env_config_empty : bool -> (abr_string * (abr_string list * abr_string)) option -> internal_oids -> generation_semantics_ocl -> generation_lemma_mode option * bool -> unit compiler_env_config_ext
  val oidReinitAll : internal_oids -> internal_oids
  val compiler_env_config_reset_no_env : 'a compiler_env_config_ext -> unit compiler_env_config_ext
  val ignore_meta_header : all_meta_embedding -> bool
  val prev_was_stop : all_meta_embedding list -> bool
  val collect_meta_embed : all_meta_embedding list -> bool * all_meta_embedding list -> all_meta_embedding list
  val bootstrap_floor : all_meta list -> unit compiler_env_config_ext -> all_meta list * unit compiler_env_config_ext
  val ctxt_expr_update : (ocl_ctxt_term_pp list -> ocl_ctxt_term_pp list) -> 'a ocl_ctxt_pre_post_ext -> 'a ocl_ctxt_pre_post_ext
  val ctxt_clause_update : (ocl_ctxt_clause list -> ocl_ctxt_clause list) -> 'a ocl_ctxt_ext -> 'a ocl_ctxt_ext
  val map_invariant : (ocl_ctxt_term_inv -> ocl_ctxt_term_inv) -> 'a ocl_ctxt_ext -> 'a ocl_ctxt_ext
  val map_pre_post : (ocl_ctxt_prefix -> unit ocl_ctxt_pre_post_ext -> ocl_ctxt_term -> ocl_ctxt_term) -> 'a ocl_ctxt_ext -> 'a ocl_ctxt_ext
  val t_lambdas : abr_string list -> ocl_ctxt_term -> ocl_ctxt_term
  val print_ctxt : unit ocl_ctxt_ext -> unit compiler_env_config_ext -> all_meta list * unit compiler_env_config_ext
  val floor1_PRINT_ctxt : (unit ocl_ctxt_ext -> unit compiler_env_config_ext -> all_meta list * unit compiler_env_config_ext) embedding_fun
  val thy_ctxt : floor -> (unit ocl_ctxt_ext, unit compiler_env_config_ext) embedding
  val type_synonymb : abr_string -> abr_string list -> (abr_string list -> semi_typ) -> type_synonym
  val pref_generic_enum : abr_string -> abr_string
  val pref_constr_enum : abr_string -> abr_string
  val term_applys : semi_terma -> semi_terma list -> semi_terma
  val term_some : semi_terma -> semi_terma
  val datatypeb : abr_string -> (abr_string * semi_typ list) list -> datatypea
  val datatypea : datatypea -> all_meta
  val print_enum : ocl_enum -> 'a -> all_meta list * 'a
  val pRINT_enum : (ocl_enum -> 'a -> all_meta list * 'a) embedding_fun
  val thy_enum : (ocl_enum, unit compiler_env_config_ext) embedding
  val filtera : ('a -> bool) -> 'a list -> 'a list
  val mk_quote : abr_string -> abr_string
  val wildcard : abr_string
  val k : 'a -> 'b -> 'a
  val print : ((abr_string -> string) -> (Code_Numeral.natural -> CodeType.mlInt) -> 'a) -> 'a
  val comp_env_input_class_bind : ('a -> 'b -> 'b) list -> 'a -> 'b -> 'b
  val d_input_class_update : (ocl_class option -> ocl_class option) -> 'a compiler_env_config_ext -> 'a compiler_env_config_ext
  val comp_env_input_class_rm : ('a -> 'b -> 'c compiler_env_config_ext * 'd) -> 'a -> 'b -> 'c compiler_env_config_ext * 'd
  val equal_generation_semantics_ocl : generation_semantics_ocl -> generation_semantics_ocl -> bool
  val classRaw_clause_update : (ocl_ctxt_clause list -> ocl_ctxt_clause list) -> 'a ocl_class_raw_ext -> 'a ocl_class_raw_ext
  val classRaw_clause : 'a ocl_class_raw_ext -> ocl_ctxt_clause list
  val classRaw_name : 'a ocl_class_raw_ext -> ocl_ty_obj
  val co4 : ('a -> 'b) -> ('c -> 'd -> 'e -> 'f -> 'a) -> 'c -> 'd -> 'e -> 'f -> 'b
  val make : ocl_ty_obj -> (abr_string * ocl_ty) list -> ocl_ctxt_clause list -> bool -> unit ocl_class_raw_ext
  val nat_to_digit26_aux : nat list -> nat -> nat list
  val mapb : (int -> int) -> abr_string -> abr_string
  val uppercase : abr_string -> abr_string
  val nat_to_digit26 : nat -> abr_string
  val ident_current : 'a * 'b -> 'b
  val ident_fresh : 'a equal -> 'a -> ('a, nat) alist * nat -> nat * (('a, nat) alist * nat)
  val ident_empty : 'c zero -> ('a, 'b) alist * 'c
  val make_tree : nat list -> nat -> nat -> (nat list) tree
  val make_treea : nat list -> nat -> nat -> nat -> (nat list) tree list -> (nat list) tree list
  val fold_tree : ('a -> 'a -> 'b -> 'b) -> 'a tree -> 'b -> 'b
  val mk_tree : nat -> nat -> nat -> (abr_string class_output * abr_string) list * nat
  val find_class_ass : 'a compiler_env_config_ext -> all_meta_embedding list * all_meta_embedding list
  val print_examp_def_st_locale_name : abr_string -> abr_string
  val definitiona : definition -> semi_theory
  val d_input_state : 'a compiler_env_config_ext -> (string_b_a_s_e * (internal_oids * (abr_string * unit ocl_instance_single_ext) ocl_def_state_core) list) list
  val assoca : abr_string -> (string_b_a_s_e * 'a) list -> 'a option
  val get_state :
    (abr_string * (internal_oids * (abr_string * unit ocl_instance_single_ext) ocl_def_state_core) list ->
      abr_string * (internal_oids * (abr_string * unit ocl_instance_single_ext) ocl_def_state_core) list ->
        (abr_string * (internal_oids * (abr_string * unit ocl_instance_single_ext) ocl_def_state_core) list) list -> 'a compiler_env_config_ext -> 'b) ->
      ocl_def_transition -> 'a compiler_env_config_ext -> 'b
  val print_transition_def_state : ocl_def_transition -> 'a compiler_env_config_ext -> semi_theory list * 'a compiler_env_config_ext
  val print_examp_instance_name : 'a -> 'a
  val oidGetInh : internal_oids -> internal_oid
  val lemmas_nosimp : abr_string -> semi_thm_attribute list -> lemmas
  val merge_unique_gen : 'b equal -> ('a -> ('b * 'c) option) -> ('a list) list -> ('b, 'c) alist
  val merge_unique : 'b equal -> ('a -> ('b * 'c) option) -> ('a list) list -> ('b * 'c) list
  val merge_uniquea : 'b equal -> ('a -> 'b) -> ((internal_oids * 'a) list) list -> ((internal_oids * 'a) list) list
  val merge_uniqueb : ((internal_oids * (abr_string * 'a) ocl_def_state_core) list) list -> ((internal_oids * 'a) list) list
  val inst_attr : 'a ocl_instance_single_ext -> (((abr_string * abr_string) option * (abr_string * ocl_data_shallow)) list) ocl_list_attr
  val inst_tya : 'a ocl_instance_single_ext -> abr_string option
  val inst_ty0 : 'a ocl_instance_single_ext -> abr_string option
  val inst_ty : 'a ocl_instance_single_ext -> abr_string
  val inst_namea : 'a ocl_instance_single_ext -> abr_string option
  val inst_name : 'a ocl_instance_single_ext -> abr_string
  val var_oid_uniq : abr_string
  val lemmas : lemmas -> all_meta
  val print_transition_lemmas_oid : ocl_def_transition -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val floor2_PRINT_transition_lemmas_oid : (ocl_def_transition -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_transition_locale_name : abr_string -> abr_string -> abr_string
  val term_oid : abr_string -> internal_oid -> semi_terma
  val map_tail : ('a -> 'b list) -> ((internal_oids * 'a) list) list -> (semi_terma * 'b list) list
  val filter_locale_interp : ((internal_oids * 'a ocl_instance_single_ext) list) list -> semi_terma list * (semi_terma list) list
  val print_transition_def_interp : ocl_def_transition -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val floor2_PRINT_transition_def_interp : (ocl_def_transition -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_examp_def_st_locale_distinct : abr_string
  val print_examp_def_st_locale_aux : ((internal_oids * 'a ocl_instance_single_ext) list) list -> semi_terma list * ((semi_terma * semi_typ) list * (abr_string * semi_terma) option) list
  val term_list : semi_terma list -> semi_terma
  val print_examp_def_st_locale_make : abr_string -> ((semi_terma * semi_typ) list * (abr_string * semi_terma) option) list -> ((internal_oids * 'a ocl_instance_single_ext) list) list -> unit semi_locale_ext
  val print_transition_locale_aux : (internal_oids * (abr_string * 'a ocl_instance_single_ext) ocl_def_state_core) list -> semi_terma list
  val print_transition_locale : ocl_def_transition -> 'a compiler_env_config_ext -> unit semi_locale_ext * 'a compiler_env_config_ext
  val interpretationa : interpretation -> semi_theory
  val rule : semi_thm_attribute -> semi_method
  val by : semi_method list -> semi_command_final
  val print_transition_interp : ocl_def_transition -> 'a compiler_env_config_ext -> semi_theory list * 'a compiler_env_config_ext
  val metis : semi_thm_attribute list -> semi_method
  val print_examp_def_st_locale_metis : semi_method
  val method_simp_add_del : semi_thm list -> semi_thm list -> semi_method_simp
  val meth_gen_simp_add2 : semi_thm_attribute list -> abr_string list -> semi_method_simp
  val simp_add2 : semi_thm_attribute list -> abr_string list -> semi_method
  val simp_add : abr_string list -> semi_method
  val term_pair : semi_terma -> semi_terma -> semi_terma
  val optiona : semi_method list -> semi_method
  val const_oid_of : abr_string -> abr_string
  val applya : semi_method list -> semi_command_proof
  val lemmaa : lemma -> semi_theory
  val print_transition_where : ocl_def_transition -> 'a compiler_env_config_ext -> semi_theory list * 'a compiler_env_config_ext
  val auto_simp_add2 : semi_thm_attribute list -> abr_string list -> semi_method
  val auto_simp_add : abr_string list -> semi_method
  val have0 : abr_string -> bool -> semi_terma -> semi_command_final -> semi_command_proof
  val datatype_in : abr_string
  val print_transition_wff : ocl_def_transition -> 'a compiler_env_config_ext -> semi_theory list * 'a compiler_env_config_ext
  val print_examp_instance_app_constr2_notmpa : 'a ocl_list_attr -> semi_terma -> semi_terma
  val to_bold_number : abr_string -> abr_string
  val var_OclInteger : abr_string
  val var_OclString : abr_string
  val var_OclReal : abr_string
  val is_emptyb : string_b_a_s_e -> bool
  val is_empty : abr_string -> bool
  val base255 : abr_string -> abr_string
  val text2_of_str : abr_string -> abr_string
  val text_of_str : abr_string -> abr_string
  val all : (int -> bool) -> abr_string -> bool
  val print_examp_oclbase_gen : ocl_def_base -> semi_terma * definition
  val filter_ocl_exn : abr_string -> 'a print_examp_instance_draw_list_attra -> 'a print_examp_instance_draw_list_attra
  val print_examp_instance_draw_list_attr_aux_base : ocl_ty * ocl_data_shallow -> semi_terma print_examp_instance_draw_list_attra
  val list_bind_e_r_r : ('a -> 'b print_examp_instance_draw_list_attra) -> ('b list -> 'c) -> 'a list -> 'c print_examp_instance_draw_list_attra
  val print_examp_instance_draw_list_attr_aux : (ocl_ty * ocl_data_shallow -> semi_terma print_examp_instance_draw_list_attra) -> ocl_ty * ocl_data_shallow -> semi_terma print_examp_instance_draw_list_attra
  val bind_e_r_r : 'a print_examp_instance_draw_list_attra -> ('a -> 'b print_examp_instance_draw_list_attra) -> 'b print_examp_instance_draw_list_attra
  val map_e_r_r : ('a -> 'b) -> 'a print_examp_instance_draw_list_attra -> 'b print_examp_instance_draw_list_attra
  val has_invalid : print_examp_instance_draw_list_attr_err -> bool
  val has_err_ty : print_examp_instance_draw_list_attr_err -> bool
  val print_examp_instance_draw_list_attr :
    (unit ocl_ty_class_ext -> semi_terma print_examp_instance_draw_list_attra) * (ocl_ty * ocl_data_shallow -> semi_terma print_examp_instance_draw_list_attra) ->
      (unit ocl_ty_class_ext option * (ocl_ty * ((abr_string * abr_string) option * ocl_data_shallow)) option) list -> (semi_terma list) print_examp_instance_draw_list_attra
  val datatype_constr_name : abr_string
  val print_examp_instance_app_constr_notmp :
    (unit ocl_ty_class_ext -> semi_terma print_examp_instance_draw_list_attra) * (ocl_ty * ocl_data_shallow -> semi_terma print_examp_instance_draw_list_attra) ->
      (abr_string -> abr_string) -> semi_terma -> (unit ocl_ty_class_ext option * (ocl_ty * ((abr_string * abr_string) option * ocl_data_shallow)) option) list -> semi_terma print_examp_instance_draw_list_attra
  val datatype_ext_constr_name : abr_string
  val print_examp_instance_app_constr2_notmp :
    ((opt_attr_type * (unit ocl_ty_class_ext option * (ocl_ty * ((abr_string * abr_string) option * ocl_data_shallow)) option) list) list) ocl_list_attr ->
      (abr_string -> abr_string) ->
        internal_oids ->
          ((abr_string -> abr_string) -> internal_oids -> (unit ocl_ty_class_ext -> semi_terma print_examp_instance_draw_list_attra) * (ocl_ty * ocl_data_shallow -> semi_terma print_examp_instance_draw_list_attra)) ->
            semi_terma print_examp_instance_draw_list_attra
  val tyObjN_ass_switch : 'a ocl_ty_class_node_ext -> Code_Numeral.natural
  val tyObj_ass_arity : 'a ocl_ty_class_ext -> Code_Numeral.natural
  val print_access_oid_uniq_namea : Code_Numeral.natural -> (abr_string -> abr_string) -> abr_string -> abr_string
  val print_access_oid_uniq_name : Code_Numeral.natural -> (abr_string -> abr_string) -> abr_string -> abr_string
  val var_switch : abr_string
  val print_access_choose_name : Code_Numeral.natural -> Code_Numeral.natural -> Code_Numeral.natural -> abr_string
  val tyObj_from : 'a ocl_ty_class_ext -> unit ocl_ty_class_node_ext
  val fill_blank : ('a -> (('b -> Code_Numeral.natural -> ('b * ('c * 'd) option) list -> ('b * ('c * 'd) option) list) -> 'e list -> 'f list) option) -> ('a * (('c * ('g * opt_ident)) * 'd) list) list -> ('a * 'f list) list
  val split_inh_own :
    (abr_string -> ('a -> ('b * (opt_attr_type * opt_ident)) option) * (opt_attr_type -> (('c -> Code_Numeral.natural -> ('c * ('b * ('d * 'e)) option) list -> ('c * ('b * ('d * 'e)) option) list) -> 'f list -> 'g list) option)) ->
      abr_string -> (('d * ('a * 'e)) list) ocl_list_attr -> ((opt_attr_type * 'g list) list) ocl_list_attr
  val tyRole : 'a ocl_multiplicity_ext -> abr_string option
  val tyObjN_role_name : 'a ocl_ty_class_node_ext -> abr_string option
  val print_examp_instance_app_constr2_notmp_norec :
    (abr_string ->
      (abr_string -> ('a * (opt_attr_type * opt_ident)) option) *
        (opt_attr_type ->
          (('b -> Code_Numeral.natural -> ('b * ('a * ((abr_string * abr_string) option * ocl_data_shallow)) option) list -> ('b * ('a * ((abr_string * abr_string) option * ocl_data_shallow)) option) list) ->
            'c list -> (unit ocl_ty_class_ext option * (ocl_ty * ((abr_string * abr_string) option * ocl_data_shallow)) option) list) option)) *
      ((internal_oid -> internal_oids option) * (abr_string -> internal_oids option)) ->
      semi_terma -> 'd ocl_instance_single_ext -> (abr_string -> abr_string) -> internal_oids -> semi_terma print_examp_instance_draw_list_attra * (semi_terma -> semi_terma)
  val d_input_instance_update :
    ((string_b_a_s_e * (unit ocl_instance_single_ext * internal_oids)) list -> (string_b_a_s_e * (unit ocl_instance_single_ext * internal_oids)) list) -> 'a compiler_env_config_ext -> 'a compiler_env_config_ext
  val d_ocl_oid_start_update : (internal_oids -> internal_oids) -> 'a compiler_env_config_ext -> 'a compiler_env_config_ext
  val d_input_instance : 'a compiler_env_config_ext -> (string_b_a_s_e * (unit ocl_instance_single_ext * internal_oids)) list
  val map_data_shallow_self : (internal_oid -> ocl_data_shallow) -> ocl_data_shallow -> ocl_data_shallow
  val inst_attr_update :
    ((((abr_string * abr_string) option * (abr_string * ocl_data_shallow)) list) ocl_list_attr -> (((abr_string * abr_string) option * (abr_string * ocl_data_shallow)) list) ocl_list_attr) ->
      'a ocl_instance_single_ext -> 'a ocl_instance_single_ext
  val map_list_attr : ('a -> 'b) -> 'a ocl_list_attr -> 'b ocl_list_attr
  val map_instance_single : ((abr_string * abr_string) option * (abr_string * ocl_data_shallow) -> (abr_string * abr_string) option * (abr_string * ocl_data_shallow)) -> 'a ocl_instance_single_ext -> 'a ocl_instance_single_ext
  val map_inst_single_self : (internal_oid -> ocl_data_shallow) -> 'a ocl_instance_single_ext -> 'a ocl_instance_single_ext
  val inst_attr_with : 'a ocl_instance_single_ext -> abr_string option
  val oidSucInh : internal_oids -> internal_oids
  val mk_instance_single_cpt0 : (abr_string -> internal_oids option) -> 'a ocl_instance_single_ext list -> 'b compiler_env_config_ext -> ('a ocl_instance_single_ext * internal_oids) list * internal_oids
  val map_entry : 'a equal -> 'a -> ('b -> 'b) -> ('a * 'b) list -> ('a * 'b) list
  val map_entrya : 'a equal -> 'a -> ('b -> 'b) -> ('a, 'b) alist -> ('a, 'b) alist
  val modify_def : 'b equal -> 'a -> 'b -> ('a -> 'a) -> ('b, 'a) alist -> ('b, 'a) alist
  val modify_defa : 'a -> abr_string -> ('a -> 'a) -> ((int list), 'a) alist -> ((int list), 'a) alist
  val of_inh : 'a tmp_inh -> 'a
  val map_class_inh : ((ocl_class, 'a) inheritance_ext list) tmp_inh -> ((abr_string * ocl_ty) list) list
  val lookupb : ((int list), 'a) alist -> abr_string -> 'a option
  val inserta : abr_string -> 'a -> ((int list), 'a) alist -> ((int list), 'a) alist
  val rbt_of_class :
    'b one * 'b plus * 'b zero ->
      'a compiler_env_config_ext -> abr_string -> bool * ((abr_string -> (ocl_ty * (opt_attr_type * opt_ident)) option) * (opt_attr_type -> ((unit ocl_ty_class_ext option -> 'b -> 'c -> 'c) -> 'c -> 'c) option))
  val init_map_class :
    'c one * 'c plus * 'c zero ->
      'a compiler_env_config_ext ->
        'b ocl_instance_single_ext list ->
          (abr_string -> bool * ((abr_string -> (ocl_ty * (opt_attr_type * opt_ident)) option) * (opt_attr_type -> ((unit ocl_ty_class_ext option -> 'c -> 'd -> 'd) -> 'd -> 'd) option))) *
            ((internal_oid -> internal_oids option) * (abr_string -> internal_oids option))
  val var_inst_assoc : abr_string
  val print_examp_instance : ocl_instance -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val print_examp_increase_oid : unit ocl_instance_single_ext list -> 'a compiler_env_config_ext -> 'a compiler_env_config_ext
  val inst_name_update : (abr_string option -> abr_string option) -> 'a ocl_instance_single_ext -> 'a ocl_instance_single_ext
  val print_examp_def_st0 : abr_string -> abr_string ocl_def_state_core list -> unit ocl_instance_single_ext list * abr_string ocl_def_state_core list
  val bootstrap_floora :
    ('a -> unit compiler_env_config_ext -> all_meta list * (unit compiler_env_config_ext -> 'b)) -> 'a -> unit compiler_env_config_ext -> (all_meta list * unit compiler_env_config_ext) * (unit compiler_env_config_ext -> 'b)
  val print_transition_gen : ocl_def_transition -> unit compiler_env_config_ext -> (all_meta list * unit compiler_env_config_ext) * (unit compiler_env_config_ext -> unit compiler_env_config_ext)
  val print_transition : ocl_def_transition -> unit compiler_env_config_ext -> all_meta list * unit compiler_env_config_ext
  val floor1_PRINT_transition : (ocl_def_transition -> unit compiler_env_config_ext -> all_meta list * unit compiler_env_config_ext) embedding_fun
  val thy_def_transition : floor -> (ocl_def_transition, unit compiler_env_config_ext) embedding
  val const_oclany : abr_string
  val classRaw_name_update : (ocl_ty_obj -> ocl_ty_obj) -> 'a ocl_class_raw_ext -> 'a ocl_class_raw_ext
  val classRaw_own_update : ((abr_string * ocl_ty) list -> (abr_string * ocl_ty) list) -> 'a ocl_class_raw_ext -> 'a ocl_class_raw_ext
  val classRaw_own : 'a ocl_class_raw_ext -> (abr_string * ocl_ty) list
  val cl_name_to_string : 'a ocl_class_raw_ext -> abr_string
  val class_unflat_aux : ((int list), ((abr_string * ocl_ty) list)) alist -> ((int list), (abr_string list)) alist -> ((int list), unit) alist -> abr_string -> ocl_class option
  val oclAss_relationa : 'a ocl_association_ext -> ocl_association_relation
  val oclAss_relation : 'a ocl_association_ext -> (ocl_ty_obj * unit ocl_multiplicity_ext) list
  val remove_binding : ocl_ty -> ocl_ty
  val map_entryb : 'a equal -> 'a -> ('b -> 'b) -> ('a, 'b) alist -> ('a, 'b) alist
  val map_entryc : abr_string -> ('a -> 'a) -> ((int list), 'a) alist -> ((int list), 'a) alist
  val entriesa : ((int list), 'a) alist -> (abr_string * 'a) list
  val oclTy_class : unit ocl_ty_class_ext -> ocl_ty
  val normalize0 : 'b equal -> ('a -> 'b) -> 'a list -> 'a list
  val fold_max_aux : ('a -> 'a list -> 'b -> 'b) -> 'a list -> 'a list -> 'b -> 'b
  val fold_max : (Code_Numeral.natural * 'a -> (Code_Numeral.natural * 'a) list -> 'b -> 'b) -> 'a list -> 'b -> 'b
  val class_unflat : unit ocl_class_raw_ext list * 'a ocl_association_ext list -> ocl_class option
  val class_unflata : unit ocl_class_raw_ext list * 'a ocl_association_ext list -> ocl_class
  val equal_ocl_association_type : ocl_association_type -> ocl_association_type -> bool
  val tyRole_update : (abr_string option -> abr_string option) -> 'a ocl_multiplicity_ext -> 'a ocl_multiplicity_ext
  val oclAss_type : 'a ocl_association_ext -> ocl_association_type
  val map_find_aux : 'a list -> ('a -> 'a option) -> 'a list -> 'a list
  val map_find : ('a -> 'a option) -> 'a list -> 'a list
  val arrange_ass : bool -> bool -> all_meta_embedding list -> ocl_enum list -> unit ocl_class_raw_ext list * unit ocl_association_ext list
  val print_examp_oclbase : ocl_def_base_l -> 'a -> all_meta list * 'a
  val pRINT_examp_oclbase : (ocl_def_base_l -> 'a -> all_meta list * 'a) embedding_fun
  val thy_def_base_l : (ocl_def_base_l, unit compiler_env_config_ext) embedding
  val thy_flush_all : ('a, 'b) embedding
  val d_output_header_force_update : (bool -> bool) -> 'a compiler_env_config_ext -> 'a compiler_env_config_ext
  val rev_map : ('a -> 'b) -> 'a list -> 'b list
  val print_examp_def_st_defassoc_typecheck_gen : abr_string ocl_def_state_core list -> 'a compiler_env_config_ext -> ml list
  val mla : ml -> semi_theory
  val print_examp_def_st_defassoc_typecheck : ocl_def_state -> 'a compiler_env_config_ext -> semi_theory list * 'a compiler_env_config_ext
  val fold_list_attr : abr_string option -> (abr_string option -> 'a -> 'b -> 'b) -> 'a ocl_list_attr -> 'b -> 'b
  val fold_instance_singlea : (abr_string option -> ((abr_string * abr_string) option * (abr_string * ocl_data_shallow)) list -> 'a -> 'a) -> 'b ocl_instance_single_ext -> 'a -> 'a
  val fold_data_shallow : (abr_string -> 'a) -> (internal_oid -> 'a) -> ('a -> 'b -> 'b) -> ocl_data_shallow -> 'b -> 'b
  val fold_instance_single_name : 'a ocl_instance_single_ext -> semi_terma list -> semi_terma list
  val term_paira : semi_terma list -> semi_terma
  val print_examp_def_st_typecheck_var : ocl_def_state -> 'a -> all_meta list * 'a
  val floor1_PRINT_examp_def_st_typecheck_var : (ocl_def_state -> 'a -> all_meta list * 'a) embedding_fun
  val to_String : string_b_a_s_e -> abr_string
  val print_examp_def_st_dom_name : abr_string -> abr_string
  val lemmas_simp : abr_string -> semi_thm_attribute list -> lemmas
  val lemmasa : lemmas -> semi_theory
  val print_examp_def_st_dom_lemmas : 'a -> 'b compiler_env_config_ext -> semi_theory list * 'b compiler_env_config_ext
  val print_examp_def_st_locale_sort : 'a compiler_env_config_ext -> abr_string ocl_def_state_core list -> ((internal_oids * unit ocl_instance_single_ext) list) list
  val print_examp_def_st_def_interp : ocl_def_state -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val floor2_PRINT_examp_def_st_def_interp : (ocl_def_state -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_examp_def_st_mapsto_gen :
    ('a * (abr_string * 'b ocl_instance_single_ext) ocl_def_state_core -> 'b ocl_instance_single_ext -> semi_terma option -> 'c) -> ('a * (abr_string * 'b ocl_instance_single_ext) ocl_def_state_core) list -> 'c list
  val print_examp_def_st_perm_name : abr_string -> abr_string
  val meth_gen_simp_onlya : semi_thm_attribute list -> semi_method_simp
  val simp_all_only : semi_thm_attribute list -> semi_method
  val add_hierarchyb : ('a -> 'b -> 'c -> 'd -> 'e -> 'f) -> 'a -> 'b -> 'c -> 'd tmp_inh -> 'e tmp_sub -> 'f
  val map_class_gen : ((abr_string -> abr_string) -> abr_string -> (abr_string * ocl_ty) list -> ((ocl_class, unit) inheritance_ext list) tmp_inh -> (ocl_class list) tmp_sub -> ocl_class list -> 'a list) -> ocl_class -> 'a list
  val map_class_gen_hb : ((abr_string -> abr_string) -> abr_string -> (abr_string * ocl_ty) list -> (ocl_class, unit) inheritance_ext list -> ocl_class list -> ocl_class list -> 'a list) -> ocl_class -> 'a list
  val map_class_gen_h_inh : ((abr_string -> abr_string) -> abr_string -> (abr_string -> position) -> 'a list) -> ocl_class -> 'a list
  val simp_all_add : abr_string list -> semi_method
  val meth_gen_simp_add_del : abr_string list -> abr_string list -> semi_method_simp
  val simp_add_del : abr_string list -> abr_string list -> semi_method
  val simp_onlya : semi_thm_attribute list -> semi_method
  val symmetric : semi_thm_attribute -> semi_thm_attribute
  val meth_gen_simp_only : semi_thm_attribute list -> semi_method_simp
  val simp_only : semi_thm_attribute list -> semi_method
  val const_oclastype : abr_string
  val meth_gen_simp : semi_method_simp
  val simp_all : semi_method
  val unfolding : semi_thm_attribute list -> semi_command_proof
  val gen_pre_post0 :
    (abr_string -> abr_string) ->
      (abr_string * (bool * semi_terma)) list ->
        ((semi_terma list -> semi_terma) -> (semi_terma -> semi_terma) -> abr_string -> semi_terma) ->
          (abr_string -> (abr_string * (bool * semi_terma)) list -> semi_terma -> abr_string -> abr_string -> abr_string -> lemma) -> semi_method list -> lemma list
  val term_And : abr_string -> (abr_string -> semi_terma) -> semi_terma
  val method_subst_l : abr_string list -> semi_thm_attribute -> semi_method
  val subst_l : abr_string list -> semi_thm_attribute -> semi_method
  val subst : semi_thm_attribute -> semi_method
  val blast : Code_Numeral.natural option -> semi_method
  val term_oclset : semi_terma list -> semi_terma
  val thms : abr_string -> semi_thm_attribute
  val simp : semi_method
  val print_examp_def_st_allinst : 'a -> 'b compiler_env_config_ext -> semi_theory list * 'b compiler_env_config_ext
  val print_examp_def_st_locale : ocl_def_state -> 'a compiler_env_config_ext -> unit semi_locale_ext * 'a compiler_env_config_ext
  val print_examp_def_st_mapsto : (internal_oids * (abr_string * 'a ocl_instance_single_ext) ocl_def_state_core) list -> (semi_terma list) option
  val var_assocs : abr_string
  val print_examp_def_st_perm : 'a -> 'b compiler_env_config_ext -> semi_theory list * 'b compiler_env_config_ext
  val term_set : semi_terma list -> semi_terma
  val print_examp_def_st_dom : 'a -> 'b compiler_env_config_ext -> semi_theory list * 'b compiler_env_config_ext
  val d_input_state_update :
    ((string_b_a_s_e * (internal_oids * (abr_string * unit ocl_instance_single_ext) ocl_def_state_core) list) list -> (string_b_a_s_e * (internal_oids * (abr_string * unit ocl_instance_single_ext) ocl_def_state_core) list) list) ->
      'a compiler_env_config_ext -> 'a compiler_env_config_ext
  val ocl_instance_single_empty : unit ocl_instance_single_ext
  val fold_instance_single : (abr_string -> ((abr_string * abr_string) option * (abr_string * ocl_data_shallow)) list -> 'a -> 'a) -> 'b ocl_instance_single_ext -> 'a -> 'a
  val print_examp_def_st_assoc_build_rbt_gen :
    (abr_string -> (((int list), (((internal_oid list) list) list * unit ocl_ty_class_ext)) alist -> ((int list), (((internal_oid list) list) list * unit ocl_ty_class_ext)) alist) -> ('a, 'b) alist -> ('a, 'b) alist) ->
      (abr_string -> (abr_string -> (ocl_ty * ('c * 'd)) option) * 'e) -> (internal_oid -> internal_oids option) -> (abr_string -> internal_oids option) -> ('f ocl_instance_single_ext * internal_oids) list -> ('a, 'b) alist
  val print_examp_def_st_assoc_build_rbt :
    (abr_string -> (abr_string -> (ocl_ty * ('a * 'b)) option) * 'c) ->
      (internal_oid -> internal_oids option) ->
        (abr_string -> internal_oids option) -> ('d ocl_instance_single_ext * internal_oids) list -> ((int list), ((int list), (((internal_oid list) list) list * unit ocl_ty_class_ext)) alist) alist
  val var_map_of_list : abr_string
  val term_lista : ('a -> semi_terma) -> 'a list -> semi_terma
  val foldb : (abr_string -> 'a -> 'b -> 'b) -> ((int list), 'a) alist -> 'b -> 'b
  val print_examp_def_st_assoc :
    (abr_string -> (abr_string -> (ocl_ty * ('a * 'b)) option) * 'c) -> (internal_oid -> internal_oids option) -> (abr_string -> internal_oids option) -> ('d ocl_instance_single_ext * internal_oids) list -> semi_terma
  val init_map_class2 :
    'c one * 'c plus * 'c zero ->
      'a compiler_env_config_ext ->
        'b ocl_instance_single_ext list ->
          (abr_string -> bool * ((abr_string -> (ocl_ty * (opt_attr_type * opt_ident)) option) * (opt_attr_type -> ((unit ocl_ty_class_ext option -> 'c -> 'd -> 'd) -> 'd -> 'd) option))) *
            ((internal_oid -> internal_oids option) * (abr_string -> internal_oids option))
  val unique : 'b equal -> ('a -> 'b) -> ('a * 'c) list -> ('a * 'c) list
  val print_examp_def_st2 : ocl_def_state -> 'a compiler_env_config_ext -> semi_theory list * 'a compiler_env_config_ext
  val print_examp_def_st1_gen : ocl_def_state -> unit compiler_env_config_ext -> (all_meta list * unit compiler_env_config_ext) * (unit compiler_env_config_ext -> unit compiler_env_config_ext)
  val print_examp_def_st1 : ocl_def_state -> unit compiler_env_config_ext -> all_meta list * unit compiler_env_config_ext
  val floor1_PRINT_examp_def_st1 : (ocl_def_state -> unit compiler_env_config_ext -> all_meta list * unit compiler_env_config_ext) embedding_fun
  val thy_def_state : floor -> (ocl_def_state, unit compiler_env_config_ext) embedding
  val comp_env_save : all_meta_embedding -> ('a -> 'b -> 'c compiler_env_config_ext * 'd) -> 'a -> 'b -> 'c compiler_env_config_ext * 'd
  val print_examp_instance_defassoc_typecheck_var : ocl_instance -> 'a -> all_meta list * 'a
  val pRINT_examp_instance_defassoc_typecheck_var : (ocl_instance -> 'a -> all_meta list * 'a) embedding_fun
  val fold_e_r_r : (print_examp_instance_draw_list_attr_err -> 'a -> 'a) -> print_examp_instance_draw_list_attr_err -> 'a -> 'a
  val str_of_def_base : ocl_def_base -> abr_string
  val str_of_data_shallow : ocl_data_shallow -> abr_string
  val print_examp_def_st_assoc_build_rbt_gen_typecheck :
    ('a ocl_instance_single_ext -> 'b -> 'c print_examp_instance_draw_list_attra) ->
      (abr_string -> bool) ->
        (abr_string -> abr_string -> 'd option) -> (internal_oid -> 'e option) -> (abr_string -> 'e option) -> ocl_enum list -> ('a ocl_instance_single_ext * 'b) list -> (reporting * abr_string) list -> (reporting * abr_string) list
  val print_examp_def_st_assoc_build_rbt2 :
    (abr_string -> (abr_string -> (ocl_ty * ('a * 'b)) option) * 'c) ->
      (internal_oid -> internal_oids option) -> (abr_string -> internal_oids option) -> ('d ocl_instance_single_ext * internal_oids) list -> ((int list), (((internal_oid list) list) list * unit ocl_ty_class_ext)) alist
  val less_natural : Code_Numeral.natural -> Code_Numeral.natural -> bool
  val mk_instance_single_cpt : (abr_string -> internal_oids option) -> 'a ocl_instance_single_ext list -> 'b compiler_env_config_ext -> ('a ocl_instance_single_ext * internal_oids) list
  val tyObj_ass_id : 'a ocl_ty_class_ext -> Code_Numeral.natural
  val check_single : abr_string option * (internal_oid * (internal_oid * abr_string) list) -> (ocl_multiplicity_single * ocl_multiplicity_single option) list -> internal_oid list -> (reporting * abr_string) list
  val choose_1 : 'a * 'b -> 'b
  val choose_0 : 'a * 'b -> 'a
  val deref_assocs_list : 'b equal -> ('a -> 'b list * 'c list) -> 'b -> 'a list -> 'c list
  val check_single_ty :
    ('a -> (abr_string -> (ocl_ty * ('b * 'c)) option) * 'd) ->
      ((int list), ('e * unit ocl_ty_class_ext)) alist ->
        (Code_Numeral.natural -> (((internal_oid list) list) list) option) ->
          (internal_oid * abr_string) list -> internal_oid -> 'a * unit ocl_multiplicity_ext -> 'a * unit ocl_multiplicity_ext -> (reporting * abr_string) list -> (reporting * abr_string) list
  val map_of_list : 'a equal -> ('a * 'b list) list -> 'a -> ('b list) option
  val nb_class : ocl_class -> nat
  val find_inh : abr_string -> ocl_class -> abr_string list
  val print_examp_instance_defassoc_typecheck_gen : (unit ocl_instance_single_ext option) list -> 'a compiler_env_config_ext -> ml list
  val print_examp_instance_defassoc_typecheck : ocl_instance -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_examp_instance_defassoc_typecheck : (ocl_instance -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val var_deref_assocs_list : abr_string
  val term_case : semi_terma -> (semi_terma * semi_terma) list -> semi_terma
  val ty_times : semi_typ -> semi_typ -> semi_typ
  val print_examp_instance_defassoc_gen :
    semi_terma ->
      ('a ocl_instance_single_ext * internal_oids) list ->
        'b compiler_env_config_ext -> (abr_string -> 'c * ((abr_string -> (ocl_ty * ('d * 'e)) option) * 'f)) * ((internal_oid -> internal_oids option) * (abr_string -> internal_oids option)) -> definition list
  val print_examp_instance_oid : (definition -> 'a) -> ('b ocl_instance_single_ext * internal_oids) list -> 'c compiler_env_config_ext -> 'a list
  val print_examp_instance_defassoc : ocl_instance -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_examp_instance_defassoc : (ocl_instance -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val pRINT_examp_instance : (ocl_instance -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val thy_instance : (ocl_instance, unit compiler_env_config_ext) embedding
  val d_hsk_constr_update : (string_b_a_s_e list -> string_b_a_s_e list) -> 'a compiler_env_config_ext -> 'a compiler_env_config_ext
  val hsk_name0 : (abr_string -> abr_string -> abr_string) -> (abr_string * abr_string option) list -> name -> abr_string
  val hsk_name : (abr_string * abr_string option) list -> name -> abr_string
  val hsk_namea : (abr_string * abr_string option) list -> name -> abr_string
  val hsk_typespec : (abr_string * abr_string option) list -> typeSpec -> abr_string * abr_string list
  val hsk_nameb : (abr_string * abr_string option) list -> name -> abr_string
  val term_stringa : abr_string -> semi_terma
  val term_stringb : semi_terma -> abr_string -> semi_terma
  val hsk_type : (abr_string * abr_string option) list -> typea -> semi_typ
  val lex_bool_false : 'a lexical_ext -> abr_string
  val lex_list_cons : 'a lexical_ext -> abr_string
  val lex_string : 'a lexical_ext -> abr_string -> semi_terma
  val hsk_literal : (abr_string -> semi_terma) -> literal -> semi_terma
  val hsk_term : 'a lexical_ext -> (abr_string * abr_string option) list -> term -> semi_terma
  val hsk_term_app : 'a lexical_ext -> (abr_string * abr_string option) list -> semi_terma list -> term -> semi_terma
  val gen_zero : abr_string -> abr_string
  val pair0 : semi_term_0 list -> semi_term_0
  val app_pair : semi_term_0 -> semi_term_0 list -> semi_term_0
  val rewrite : semi_term_0 -> abr_string -> semi_term_0 -> semi_term_0
  val hol_to_sml : semi_terma -> semi_term_0
  val hsk_stmt : semi_datatype_version -> (abr_string * abr_string option) list -> gen_meta -> stmt list -> all_meta list * abr_string list
  val print_haskell : isaUnit -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_haskell : (isaUnit -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val thy_haskell : (isaUnit, unit compiler_env_config_ext) embedding
  val map_class : ((abr_string -> abr_string) -> abr_string -> (abr_string * ocl_ty) list -> ((ocl_class, unit) inheritance_ext list) tmp_inh -> (abr_string list) tmp_sub -> ocl_class list -> 'a) -> ocl_class -> 'a list
  val print_infra_type_synonym_class_higher : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_infra_type_synonym_class_higher : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_instantia_def_strictrefeq_name : (abr_string list -> 'a) -> abr_string -> 'a
  val activate_simp_optimization : bool
  val print_instantia_lemmas_strictrefeq : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_instantia_lemmas_strictrefeq : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val oclTy_class_pre : abr_string -> ocl_ty
  val print_infra_type_synonym_class_rec : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_infra_type_synonym_class_rec : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val term_function : (semi_terma * semi_terma) list -> semi_terma
  val instantiation : instantiation -> all_meta
  val print_infra_instantiation_universe : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_infra_instantiation_universe : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val const_oclistypeof : abr_string
  val const_ocliskindof : abr_string
  val print_iskindof_up_istypeof_unfold_name : abr_string -> abr_string -> abr_string
  val print_iskindof_defined_namea : (abr_string -> abr_string) -> abr_string -> abr_string
  val print_istypeof_defined_namea : (abr_string -> abr_string) -> abr_string -> abr_string
  val erule : semi_thm_attribute -> semi_method
  val oF_l : semi_thm_attribute -> semi_thm_attribute list -> semi_thm_attribute
  val ofa : semi_thm_attribute -> semi_thm_attribute -> semi_thm_attribute
  val print_iskindof_up_istypeof_erule : abr_string -> ocl_class list -> abr_string -> abr_string -> semi_method
  val equal_position : position -> position -> bool
  val term_binopb : abr_string -> semi_terma list -> semi_terma
  val m_class_default : 'a -> 'b -> 'c -> 'd -> 'd
  val dot_oclistypeof : abr_string
  val dot_istypeof : abr_string -> abr_string
  val dot_ocliskindof : abr_string
  val dot_iskindof : abr_string -> abr_string
  val drule : semi_thm_attribute -> semi_method
  val using : semi_thm_attribute list -> semi_command_proof
  val inh_sib : ('a, 'b) inheritance_ext -> ('a * 'a list) list
  val of_linh_sib : ('a, 'b) inheritance_ext list -> 'a list
  val inh_sib_unflat : ('a, 'b) inheritance_ext -> 'a list
  val map_linh : ('a -> 'b) -> ('a, 'c) inheritance_ext -> ('b, unit) inheritance_ext
  val m_class_gen2 :
    ((abr_string * ocl_ty) list -> (abr_string * ocl_ty) list) ->
      (abr_string -> (ocl_class, unit) inheritance_ext list -> ocl_class list -> 'a list -> 'b list) ->
        ((ocl_class, unit) inheritance_ext list -> ocl_class list -> ocl_class list -> position -> (abr_string -> abr_string) * (abr_string * (abr_string * ocl_ty) list) -> ocl_class -> 'a list) -> ocl_class -> 'b list
  val start_mapc :
    ('a -> 'b) ->
      (generation_semantics_ocl ->
        (('c * ocl_ty) list -> ('c * ocl_ty) list) ->
          (('c * ocl_ty) list * (('c * ocl_ty) list) list -> ('c * ocl_ty) list * (('c * ocl_ty) list) list) -> (('c * ocl_ty) list * ('c * ocl_ty) list -> ('c * ocl_ty) list * ('c * ocl_ty) list) -> 'a list) ->
        'd compiler_env_config_ext -> 'b list * 'd compiler_env_config_ext
  val start_mapb :
    ('a -> 'b) ->
      ((('c * ocl_ty) list -> ('c * ocl_ty) list) ->
        (('c * ocl_ty) list * (('c * ocl_ty) list) list -> ('c * ocl_ty) list * (('c * ocl_ty) list) list) -> (('c * ocl_ty) list * ('c * ocl_ty) list -> ('c * ocl_ty) list * ('c * ocl_ty) list) -> 'a list) ->
        'd compiler_env_config_ext -> 'b list * 'd compiler_env_config_ext
  val start_m_gen :
    ('a -> 'b) ->
      (abr_string -> (ocl_class, unit) inheritance_ext list -> ocl_class list -> 'c list -> 'a list) ->
        ((ocl_class, unit) inheritance_ext list -> ocl_class list -> ocl_class list -> position -> (abr_string -> abr_string) * (abr_string * (abr_string * ocl_ty) list) -> ocl_class -> 'c list) ->
          ocl_class -> 'd compiler_env_config_ext -> 'b list * 'd compiler_env_config_ext
  val done : semi_command_final
  val lemma : lemma -> all_meta
  val print_iskindof_up_istypeof_unfold : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_iskindof_up_istypeof_unfold : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_instantia_def_strictrefeq : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_instantia_def_strictrefeq : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val get_class_hierarchy : ocl_class -> (abr_string * (abr_string * ocl_ty) list) list
  val add_hierarchya :
    ('a -> 'b -> ((abr_string * (abr_string * ocl_ty) list) list) tmp_univ -> 'c -> (((abr_string * ocl_ty) list) list) tmp_inh -> 'd -> 'e) ->
      ocl_class -> 'a -> 'b -> 'c -> ((ocl_class, 'f) inheritance_ext list) tmp_inh -> 'd -> 'g -> 'e
  val map_class_gen_ha :
    ((abr_string -> abr_string) -> abr_string -> ((abr_string * (abr_string * ocl_ty) list) list) tmp_univ -> (abr_string * ocl_ty) list -> (((abr_string * ocl_ty) list) list) tmp_inh -> (abr_string list) tmp_sub -> 'a list) ->
      ocl_class -> 'a list
  val mk_constr_name : abr_string -> abr_string -> abr_string
  val print_infra_instantiation_class : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_infra_instantiation_class : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_infra_datatype_equiv_2of1_name : abr_string
  val print_infra_datatype_equiv_2of1_name_aux : abr_string
  val datatype_ext_constr_namea : abr_string
  val datatype_constr_namea : abr_string
  val add_hierarchy :
    ('a -> 'b -> ((abr_string * (abr_string * ocl_ty) list) list) tmp_univ -> 'c -> (((abr_string * ocl_ty) list) list) tmp_inh -> 'd -> 'e) ->
      ocl_class -> 'a -> 'b -> 'c -> ((ocl_class, 'f) inheritance_ext list) tmp_inh -> 'g -> 'd -> 'e
  val map_class_gen_h :
    ((abr_string -> abr_string) -> abr_string -> ((abr_string * (abr_string * ocl_ty) list) list) tmp_univ -> (abr_string * ocl_ty) list -> (((abr_string * ocl_ty) list) list) tmp_inh -> ocl_class list -> 'a list) ->
      ocl_class -> 'a list
  val print_infra_datatype_equiv_2of1 : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_infra_datatype_equiv_2of1 : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_infra_datatype_equiv_1of2_name : abr_string
  val print_infra_datatype_equiv_1of2_name_get_oid_inh : abr_string
  val print_infra_datatype_equiv_1of2_name_aux : abr_string
  val term_pairs : ('a -> semi_terma) -> 'a list -> semi_terma
  val print_infra_datatype_equiv_1of2 : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_infra_datatype_equiv_1of2 : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val type_notation : type_notation -> all_meta
  val ty_integer : abr_string
  val ty_boolean : abr_string
  val ty_string : abr_string
  val var_val : abr_string
  val ty_void : abr_string
  val ty_real : abr_string
  val print_infra_type_synonym_class : 'a -> 'b -> all_meta list * 'b
  val pRINT_infra_type_synonym_class : ('a -> 'b -> all_meta list * 'b) embedding_fun
  val print_infra_datatype_universe : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_infra_datatype_universe : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_allinst_istypeof_pre_name2 : abr_string
  val print_allinst_istypeof_pre_name1 : abr_string
  val print_iskindof_up_eq_asty_name : abr_string -> abr_string
  val print_iskindof_up_larger_name : abr_string -> abr_string -> abr_string
  val var_Abs_Set : abr_string
  val var_Abs_Set_inverse : abr_string
  val simplified_l : semi_thm_attribute -> semi_thm_attribute list -> semi_thm_attribute
  val simplified : semi_thm_attribute -> semi_thm_attribute -> semi_thm_attribute
  val gen_pre_post :
    (abr_string -> abr_string) ->
      ((semi_terma list -> semi_terma) -> (semi_terma -> semi_terma) -> abr_string -> semi_terma) -> (abr_string -> semi_terma -> abr_string -> abr_string -> abr_string -> lemma) -> semi_method list -> lemma list
  val wherea : semi_thm_attribute -> (abr_string * semi_terma) list -> semi_thm_attribute
  val intro : semi_thm_attribute list -> semi_method
  val print_allinst_istypeof_single :
    (abr_string -> abr_string) -> abr_string -> ('a -> abr_string) -> abr_string -> 'a -> (abr_string -> abr_string) -> (abr_string list -> abr_string list) -> (abr_string list -> abr_string list) -> lemma list
  val m_class :
    ((abr_string * ocl_ty) list -> (abr_string * ocl_ty) list) ->
      (abr_string -> (ocl_class, unit) inheritance_ext list -> ocl_class list -> 'a list -> 'b list) -> (position -> (abr_string -> abr_string) * (abr_string * (abr_string * ocl_ty) list) -> ocl_class -> 'a list) -> ocl_class -> 'b list
  val m_classa : ((abr_string * ocl_ty) list -> (abr_string * ocl_ty) list) -> (position -> (abr_string -> abr_string) * (abr_string * (abr_string * ocl_ty) list) -> ocl_class -> 'a) -> ocl_class -> 'a list
  val map_class_nupl2_inh : (abr_string -> abr_string -> 'a) -> ocl_class -> 'a list
  val print_allinst_iskindof_larger : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_allinst_iskindof_larger : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val get_hierarchy_map : ('a -> 'b -> 'c -> 'd) -> (abr_string list -> 'a list * ('b list * 'c list)) -> ocl_class -> 'd list
  val print_istypeof_lemmas_strict_set : ocl_class -> (abr_string * (abr_string * abr_string)) list
  val print_istypeof_lemmas_strict : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_istypeof_lemmas_strict : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val term_basety : semi_terma
  val start_m :
    ('a -> 'b) ->
      (abr_string -> (ocl_class, unit) inheritance_ext list -> ocl_class list -> 'c list -> 'a list) ->
        (position -> (abr_string -> abr_string) * (abr_string * (abr_string * ocl_ty) list) -> ocl_class -> 'c list) -> ocl_class -> 'd compiler_env_config_ext -> 'b list * 'd compiler_env_config_ext
  val print_istypeof_from_universe : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_istypeof_from_universe : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_iskindof_lemmas_strict : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_iskindof_lemmas_strict : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_iskindof_from_universe : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_iskindof_from_universe : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val datatype_ext_namea : abr_string
  val datatype_ext_nameb : abr_string
  val datatype_namea : abr_string
  val opt : abr_string -> semi_typ
  val print_infra_datatype_class_2 : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_infra_datatype_class_2 : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val datatype_ext_name : abr_string
  val print_infra_datatype_class_1 : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_infra_datatype_class_1 : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_istypeof_lemma_cp_set : ocl_class -> (((abr_string -> abr_string) * abr_string) * abr_string) list
  val print_istypeof_lemma_strict : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_istypeof_lemma_strict : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_iskindof_lemma_strict : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_iskindof_lemma_strict : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val aux_d_e_p_t_h : ('a * ('b * bool) list) list -> ('a, ('a * 'b list)) print_iskindof_up_istypeof_output list
  val aux_b_r_e_a_d_t_h : 'a -> ('a, ('a * 'b list)) print_iskindof_up_istypeof_output list -> ('a * ('b * bool) list) list -> ('b * bool) list -> ('a, ('a * 'b list)) print_iskindof_up_istypeof_output list
  val print_iskindof_up_istypeof_name : abr_string -> abr_string -> abr_string
  val print_iskindof_class_name : (abr_string -> abr_string) -> abr_string -> abr_string
  val map_class_nupl2l_inh_gen : (ocl_class list -> abr_string -> ((ocl_class, unit) inheritance_ext * (ocl_class * bool) list) list -> 'a) -> ocl_class -> 'a list
  val map_class_nupl2l_inh : (abr_string -> ((ocl_class, unit) inheritance_ext * (ocl_class * bool) list) list -> 'a) -> ocl_class -> 'a list
  val term_preunary : semi_terma -> semi_terma -> semi_terma
  val print_iskindof_up_istypeof : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_iskindof_up_istypeof : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_astype_lemmas_strict : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_astype_lemmas_strict : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_astype_from_universe_name : abr_string -> abr_string
  val print_astype_from_universe : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_astype_from_universe : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_allinst_istypeof_pre : 'a -> 'b -> all_meta list * 'b
  val pRINT_allinst_istypeof_pre : ('a -> 'b -> all_meta list * 'b) embedding_fun
  val print_access_dot_lemmas_id_name : abr_string
  val print_access_dot_name : (abr_string -> abr_string) -> abr_string -> ocl_ty -> (abr_string -> abr_string) -> abr_string
  val apply_optim_ass_arity : 'a ocl_ty_class_ext -> 'b -> 'b option
  val var_in_post_state : abr_string
  val var_in_pre_state : abr_string
  val mk_dot_comment : abr_string -> abr_string -> abr_string -> abr_string
  val map_class_arg_only_var0 :
    ('a -> abr_string list -> 'b) -> ('c -> 'd -> abr_string * abr_string -> ocl_ty -> (abr_string -> abr_string) -> ('a -> 'b) -> 'e list) -> ('f -> ((abr_string * ocl_ty) list) list) -> 'c -> 'd -> 'f -> 'e list
  val map_class_arg_onlya : ((abr_string -> abr_string) -> abr_string -> (abr_string * ocl_ty) list * ((ocl_class list) tmp_inh * (ocl_class list) tmp_sub) -> 'a list) -> ocl_class -> 'a list
  val map_class_arg_only : ((abr_string -> abr_string) -> abr_string -> (abr_string * ocl_ty) list -> 'a list) -> ocl_class -> 'a list
  val map_class_arg_only0 :
    ((abr_string -> abr_string) -> abr_string -> (abr_string * ocl_ty) list -> 'a list) ->
      ((abr_string -> abr_string) -> abr_string -> (abr_string * ocl_ty) list * ((ocl_class list) tmp_inh * (ocl_class list) tmp_sub) -> 'a list) -> ocl_class -> 'a list
  val map_class_arg_only_var_gena : ('a -> abr_string list -> 'b) -> ((abr_string -> abr_string) -> abr_string -> abr_string * abr_string -> ocl_ty -> (abr_string -> abr_string) -> ('a -> 'b) -> 'c list) -> ocl_class -> 'c list
  val map_class_arg_only_vara : ((abr_string -> abr_string) -> abr_string -> abr_string * abr_string -> ocl_ty -> (abr_string -> abr_string) -> (semi_terma -> semi_terma) -> 'a list) -> ocl_class -> 'a list
  val print_access_dot_lemmas_id_set : ocl_class -> abr_string list
  val print_access_dot_lemmas_id : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_access_dot_lemmas_id : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_access_dot_lemma_cp_name : (abr_string -> abr_string) -> abr_string -> ocl_ty -> (abr_string -> abr_string) -> abr_string
  val print_access_dot_lemmas_cp : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_access_dot_lemmas_cp : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val var_eval_extract : abr_string
  val print_access_dot_cp_lemmas_set : abr_string list
  val print_access_dot_cp_lemmas : 'a -> 'b -> all_meta list * 'b
  val pRINT_access_dot_cp_lemmas : ('a -> 'b -> all_meta list * 'b) embedding_fun
  val auto_simp_add_split : semi_thm_attribute list -> abr_string list -> semi_method
  val insertb : semi_thm_attribute list -> semi_method
  val hol_split : abr_string -> abr_string
  val split_ty : abr_string -> abr_string list
  val print_iskindof_up_eq_asty : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_iskindof_up_eq_asty : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_astype_lemmas_const : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_astype_lemmas_const : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_astype_lemma_cp_set : ocl_class -> (((abr_string -> abr_string) * abr_string) * abr_string) list
  val print_astype_lemma_strict : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_astype_lemma_strict : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_allinst_iskindof_eq : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_allinst_iskindof_eq : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val start_mape : ('a -> 'b) -> (generation_lemma_mode option * bool -> generation_semantics_ocl -> 'a list) -> 'c compiler_env_config_ext -> 'b list * 'c compiler_env_config_ext
  val print_access_repr_allinst : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_access_repr_allinst : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_access_lemma_strict_name : (abr_string -> abr_string) -> abr_string -> ocl_ty -> (abr_string -> abr_string) -> abr_string -> abr_string
  val print_access_lemma_strict : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_access_lemma_strict : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val var_reconst_basetype_void : abr_string
  val var_reconst_basetype : abr_string
  val var_Abs_Void : abr_string
  val print_access_eval_extract : 'a -> 'b -> all_meta list * 'b
  val pRINT_access_eval_extract : ('a -> 'b -> all_meta list * 'b) embedding_fun
  val map_class_arg_only_var_gen :
    ('a -> abr_string list -> 'b) ->
      ((abr_string -> abr_string) -> abr_string -> abr_string * abr_string -> ocl_ty -> (abr_string -> abr_string) -> ('a -> 'b) -> 'c list) ->
        ((abr_string -> abr_string) -> abr_string -> abr_string * abr_string -> ocl_ty -> (abr_string -> abr_string) -> ('a -> 'b) -> 'c list) -> ocl_class -> 'c list
  val map_class_arg_only_var :
    ((abr_string -> abr_string) -> abr_string -> abr_string * abr_string -> ocl_ty -> (abr_string -> abr_string) -> (semi_terma -> semi_terma) -> 'a list) ->
      ((abr_string -> abr_string) -> abr_string -> abr_string * abr_string -> ocl_ty -> (abr_string -> abr_string) -> (semi_terma -> semi_terma) -> 'a list) -> ocl_class -> 'a list
  val print_access_dot_lemma_cp : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_access_dot_lemma_cp : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val var_deref : abr_string
  val print_access_deref_assocs_namea : Code_Numeral.natural -> (abr_string -> abr_string) -> (abr_string -> abr_string) -> abr_string
  val print_access_deref_assocs_name : Code_Numeral.natural -> (abr_string -> abr_string) -> abr_string -> abr_string
  val var_deref_assocs : abr_string
  val start_mapd : ('a -> 'b) -> (generation_semantics_ocl -> 'a list) -> 'c compiler_env_config_ext -> 'b list * 'c compiler_env_config_ext
  val print_access_deref_assocs : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_access_deref_assocs : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_istypeof_up_larger_name : abr_string -> abr_string -> abr_string
  val map_class_nupl2_inh_large : (abr_string -> abr_string -> 'a) -> ocl_class -> 'a list
  val print_istypeof_up_larger : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_istypeof_up_larger : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_istypeof_up_d_cast_name : abr_string -> abr_string -> abr_string -> abr_string
  val fold_less_gen : ('a -> 'b list -> 'c -> 'd) -> ('d -> 'c) -> ('b -> 'a) -> 'b list -> 'd -> 'd
  val fold_less2 : ('a -> 'a) -> ('b -> 'b -> 'a -> 'a) -> 'b list -> 'a -> 'a
  val f_less2 : 'a list -> ('a * 'a) list
  val m_class_gen3_GE :
    ((abr_string * ocl_ty) list -> (abr_string * ocl_ty) list) ->
      ('a list -> 'b list) -> ((ocl_class, unit) inheritance_ext list -> ocl_class list -> ocl_class list -> abr_string -> abr_string -> abr_string -> 'a) -> ocl_class -> 'b list
  val m_class3_GE : ((abr_string * ocl_ty) list -> (abr_string * ocl_ty) list) -> ('a list -> 'b list) -> (abr_string -> abr_string -> abr_string -> 'a) -> ocl_class -> 'b list
  val map_class_nupl3_GE_inh : (abr_string -> abr_string -> abr_string -> 'a) -> ocl_class -> 'a list
  val print_istypeof_up_d_cast : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_istypeof_up_d_cast : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_istypeof_lemmas_id : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_istypeof_lemmas_id : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_istypeof_lemmas_cp : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_istypeof_lemmas_cp : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val map_class_nupl2_inha : (abr_string -> abr_string -> (ocl_class * bool) list -> 'a) -> ocl_class -> 'a list
  val print_iskindof_up_larger : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_iskindof_up_larger : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val map_class_nupl3_LE_inh : (abr_string -> abr_string -> ((ocl_class, unit) inheritance_ext * (ocl_class * bool) list) list -> 'a) -> ocl_class -> 'a list
  val elim : semi_thm_attribute -> semi_method
  val print_iskindof_up_d_cast : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_iskindof_up_d_cast : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_iskindof_lemma_cp_set : ocl_class -> (((abr_string -> abr_string) * abr_string) * abr_string) list
  val print_iskindof_lemmas_id : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_iskindof_lemmas_id : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_iskindof_lemmas_cp : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_iskindof_lemmas_cp : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_infra_enum_synonym : 'a -> 'b compiler_env_config_ext -> all_meta list * 'b compiler_env_config_ext
  val pRINT_infra_enum_synonym : ('a -> 'b compiler_env_config_ext -> all_meta list * 'b compiler_env_config_ext) embedding_fun
  val metis0 : abr_string list -> semi_thm_attribute list -> semi_method
  val print_astype_lemma_const : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_astype_lemma_const : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val oidSucAssoc : internal_oids -> internal_oids
  val oidGetAssoc : internal_oids -> internal_oid
  val print_access_oid_uniq_gen :
    ('a -> 'b) -> ('c compiler_env_config_ext -> internal_oids -> 'd) -> (Code_Numeral.natural -> abr_string -> (abr_string -> abr_string) -> abr_string -> internal_oid -> 'a) -> ocl_class -> 'c compiler_env_config_ext -> 'b list * 'd
  val print_access_oid_uniq_mlname : Code_Numeral.natural -> abr_string -> abr_string -> abr_string
  val rewrite_val : semi_term_0 -> abr_string -> semi_term_0 -> semi_term
  val oid : abr_string -> internal_oid -> semi_term_0
  val print_access_oid_uniq_ml : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_access_oid_uniq_ml : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_istypeof_lemma_cp : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_istypeof_lemma_cp : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_istypeof_defined_name : (abr_string -> abr_string) -> abr_string -> abr_string
  val thena : semi_thm_attribute -> semi_thm_attribute -> semi_thm_attribute
  val print_istypeof_defineda : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_istypeof_defineda : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val m_class_gen3 :
    ((abr_string * ocl_ty) list -> (abr_string * ocl_ty) list) ->
      ('a list -> 'b list) -> ((ocl_class, unit) inheritance_ext list -> ocl_class list -> ocl_class list -> abr_string -> abr_string -> abr_string -> 'a) -> ocl_class -> 'b list
  val start_m_3_gen :
    ('a -> 'b) -> ((ocl_class, unit) inheritance_ext list -> ocl_class list -> ocl_class list -> abr_string -> abr_string -> abr_string -> 'a) -> ocl_class -> 'c compiler_env_config_ext -> 'b list * 'c compiler_env_config_ext
  val plus : semi_method list -> semi_method
  val print_iskindof_lemma_cp : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_iskindof_lemma_cp : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_iskindof_defined_name : (abr_string -> abr_string) -> abr_string -> abr_string
  val print_iskindof_defineda : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_iskindof_defineda : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_examp_def_st_defs : 'a -> 'b -> all_meta list * 'b
  val pRINT_examp_def_st_defs : ('a -> 'b -> all_meta list * 'b) embedding_fun
  val print_astype_up_d_cast0_name : abr_string -> abr_string -> abr_string
  val print_astype_up_d_cast0 : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_astype_up_d_cast0 : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_astype_lemma_cp_set2 : ocl_class -> ((abr_string * ocl_ty) list -> (abr_string * ocl_ty) list) -> (((abr_string -> abr_string) * abr_string) * ((abr_string -> abr_string) * abr_string)) list
  val print_astype_lemmas_id2 : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_astype_lemmas_id2 : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_allinst_lemmas_id : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_allinst_lemmas_id : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val var_select_object_sequence_any : abr_string
  val var_select_object_sequence : abr_string
  val var_select_object_set_any : abr_string
  val var_select_object_set : abr_string
  val lookup2 : 'a equal -> 'b equal -> ('a, ('b, 'c) alist) alist -> 'a * 'b -> 'c option
  val lookup2a : ((int list), ((int list), 'a) alist) alist -> abr_string * abr_string -> 'a option
  val insert2 : 'a equal -> 'b equal -> 'a * 'b -> 'c -> ('a, ('b, 'c) alist) alist -> ('a, ('b, 'c) alist) alist
  val insert2a : abr_string * abr_string -> 'a -> ((int list), ((int list), 'a) alist) alist -> ((int list), ((int list), 'a) alist) alist
  val var_select : abr_string
  val print_access_select_obj : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_access_select_obj : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_access_dot_consts : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_access_dot_consts : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_istypeof_defined : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_istypeof_defined : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_iskindof_defined : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_iskindof_defined : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val rename_tac : abr_string list -> semi_method
  val case_tac : semi_terma -> semi_method
  val print_astype_up_d_cast : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_astype_up_d_cast : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_astype_lemmas_id : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_astype_lemmas_id : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_astype_lemmas_cp : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_astype_lemmas_cp : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_astype_up_d_cast_name : abr_string -> abr_string -> abr_string
  val print_astype_d_up_cast : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_astype_d_up_cast : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val term_exists : abr_string -> (abr_string -> semi_terma) -> semi_terma
  val term_pat : abr_string -> semi_terma
  val letb : semi_terma -> semi_terma -> semi_command_proof
  val fix : abr_string list -> semi_command_proof
  val print_allinst_istypeof : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_allinst_istypeof : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val var_deref_oid : abr_string
  val print_access_deref_oid_name : (abr_string -> 'a) -> 'a
  val print_access_deref_oid : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_access_deref_oid : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val class_arity : ocl_class -> Code_Numeral.natural list
  val print_access_choose_switch :
    ('a -> 'b -> 'c) -> (Code_Numeral.natural -> 'd) -> ocl_class -> (Code_Numeral.natural -> Code_Numeral.natural -> Code_Numeral.natural -> 'a) -> ('d list -> 'e) -> (('e * 'f) list -> 'b) -> ('d -> 'd -> 'f) -> 'c list
  val print_access_choose_mlname : Code_Numeral.natural -> Code_Numeral.natural -> Code_Numeral.natural -> abr_string
  val function : (semi_term_0 * semi_term_0) list -> semi_term_0
  val print_access_choose_ml : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_access_choose_ml : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val const_mixfix : abr_string -> abr_string -> abr_string
  val constsa : abr_string -> semi_typ -> abr_string -> consts
  val print_istypeof_consts : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_istypeof_consts : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_iskindof_consts : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_iskindof_consts : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_astype_lemma_cp : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_astype_lemma_cp : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_access_oid_uniq : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_access_oid_uniq : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_access_def_mono_name : (abr_string -> abr_string) -> abr_string -> ocl_ty -> (abr_string -> abr_string) -> abr_string
  val print_access_def_mono : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_access_def_mono : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_istypeof_class : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_istypeof_class : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_iskindof_class : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_iskindof_class : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_infra_enum_syn : 'a -> 'b compiler_env_config_ext -> all_meta list * 'b compiler_env_config_ext
  val pRINT_infra_enum_syn : ('a -> 'b compiler_env_config_ext -> all_meta list * 'b compiler_env_config_ext) embedding_fun
  val print_astype_defined : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_astype_defined : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_allinst_def_id : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_allinst_def_id : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val print_allinst_astype_name : (abr_string -> abr_string) -> abr_string
  val map_class_one :
    (((abr_string -> abr_string) * (abr_string * ((abr_string * ocl_ty) list * ((ocl_class list) tmp_inh * ((abr_string list) tmp_sub * ocl_class list))))) list -> ('a * ('b * ('c * ('d * ('e * 'f))))) list) ->
      ('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g) -> ocl_class -> 'g
  val map_class_top : ((abr_string -> abr_string) -> abr_string -> (abr_string * ocl_ty) list -> (ocl_class list) tmp_inh -> (abr_string list) tmp_sub -> ocl_class list -> 'a) -> ocl_class -> 'a
  val print_allinst_astype : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_allinst_astype : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val var_select_object_sequence_any_exec : abr_string
  val print_access_select_obj_name : (abr_string -> abr_string) -> abr_string -> abr_string
  val var_select_object_set_any_exec : abr_string
  val print_access_is_repr_name : (abr_string -> abr_string) -> abr_string -> ocl_ty -> (abr_string -> abr_string) -> abr_string
  val print_access_select_name : ('a -> 'b) -> (abr_string -> 'a) -> 'b
  val map_class_arg_only_var_genb : ('a -> abr_string list -> 'b) -> ((abr_string -> abr_string) -> abr_string -> abr_string * abr_string -> ocl_ty -> (abr_string -> abr_string) -> ('a -> 'b) -> 'c list) -> ocl_class -> 'c list
  val map_class_arg_only_varb : ((abr_string -> abr_string) -> abr_string -> abr_string * abr_string -> ocl_ty -> (abr_string -> abr_string) -> (semi_terma -> semi_terma) -> 'a list) -> ocl_class -> 'a list
  val meth_gen_simp_add_split : semi_thm_attribute list -> semi_thm_attribute list -> semi_method_simp
  val simp_add_split : semi_thm_attribute list -> semi_thm_attribute list -> semi_method
  val apply_end : semi_method list -> semi_command_state
  val clarify : semi_method
  val fix_let : abr_string list -> (semi_terma * semi_terma) list -> (semi_terma list * semi_terma list) option -> semi_command_state list -> semi_command_proof
  val rulea : semi_method
  val print_access_is_repr : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_access_is_repr : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_astype_consts : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_astype_consts : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val lowercase : abr_string -> abr_string
  val print_access_select : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_access_select : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val print_access_choose : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_access_choose : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val start_ma : ('a -> 'b) -> (position -> (abr_string -> abr_string) * (abr_string * (abr_string * ocl_ty) list) -> ocl_class -> 'a) -> ocl_class -> 'c compiler_env_config_ext -> 'b list * 'c compiler_env_config_ext
  val print_astype_class : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_astype_class : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val auto : semi_method
  val have : abr_string -> semi_terma -> semi_command_final -> semi_command_proof
  val print_allinst_exec : ocl_class -> 'a -> all_meta list * 'a
  val pRINT_allinst_exec : (ocl_class -> 'a -> all_meta list * 'a) embedding_fun
  val var_select_object_pair : abr_string
  val print_access_dot_aux : (abr_string option -> semi_terma list -> semi_terma) -> ocl_ty -> semi_terma
  val print_access_dot : ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext
  val pRINT_access_dot : (ocl_class -> 'a compiler_env_config_ext -> all_meta list * 'a compiler_env_config_ext) embedding_fun
  val txt_raw_d : ((abr_string -> abr_string) -> abr_string list) -> ('a -> 'b compiler_env_config_ext -> all_meta list * 'b compiler_env_config_ext) embedding_fun
  val txt_raw_a : ((abr_string -> abr_string) -> abr_string list) -> ('a -> 'b compiler_env_config_ext -> all_meta list * 'b compiler_env_config_ext) embedding_fun
  val subsection : abr_string -> 'a -> 'b -> all_meta list * 'b
  val subsectiona : abr_string -> ('a -> 'b -> all_meta list * 'b) embedding_fun
  val thy_class : (ocl_class, unit compiler_env_config_ext) embedding
  val map_semi_theory : (semi_theory -> semi_theory) -> all_meta -> all_meta
  val map_lemma : (lemma -> lemma) -> semi_theory -> semi_theory
  val fold_thy0 :
    'a -> ('a, 'b compiler_env_config_ext) embedding -> (abr_string option -> all_meta list -> 'b compiler_env_config_ext -> 'c -> 'b compiler_env_config_ext * 'c) -> 'b compiler_env_config_ext * 'c -> 'b compiler_env_config_ext * 'c
  val comp_env_input_class_mk :
    ((unit -> unit compiler_env_config_ext * 'a) -> 'b compiler_env_config_ext * 'c) ->
      (unit compiler_env_config_ext -> 'c -> 'a) ->
        ((abr_string option -> all_meta list -> unit compiler_env_config_ext -> 'a -> unit compiler_env_config_ext * 'a) -> 'b compiler_env_config_ext * 'c -> 'd) ->
          (abr_string option -> all_meta list -> unit compiler_env_config_ext -> 'a -> unit compiler_env_config_ext * 'a) -> 'b compiler_env_config_ext * 'c -> 'd
  val thy_class_synonym : ('a, 'b) embedding
  val thy_association : ('a, 'b) embedding
  val thy_class_tree : ('a, 'b) embedding
  val thy_class_flat : ('a, 'b) embedding
  val thy_enum_flat : ('a, 'b) embedding
  val thy_generic : ('a, 'b) embedding
  val fold_thy :
    (all_meta_embedding ->
      ((abr_string option -> all_meta list -> unit compiler_env_config_ext -> 'a -> unit compiler_env_config_ext * 'a) -> unit compiler_env_config_ext * 'a -> unit compiler_env_config_ext * 'a) ->
        (abr_string option -> all_meta list -> 'b compiler_env_config_ext -> 'c -> 'b compiler_env_config_ext * 'c) -> 'b compiler_env_config_ext * 'c -> 'b compiler_env_config_ext * 'c) ->
      ((unit -> unit compiler_env_config_ext * 'a) -> unit compiler_env_config_ext * 'a) ->
        (unit compiler_env_config_ext -> 'a -> 'a) ->
          (abr_string option -> all_meta list -> 'b compiler_env_config_ext -> 'c -> 'b compiler_env_config_ext * 'c) -> fold_all_input -> 'b compiler_env_config_ext * 'c -> 'b compiler_env_config_ext * 'c
  val fold_thya :
    (all_meta_embedding ->
      ((abr_string option -> all_meta list -> unit compiler_env_config_ext -> 'a -> unit compiler_env_config_ext * 'a) -> unit compiler_env_config_ext * 'a -> unit compiler_env_config_ext * 'a) ->
        (abr_string option -> all_meta list -> 'b compiler_env_config_ext -> 'c -> 'b compiler_env_config_ext * 'c) -> 'b compiler_env_config_ext * 'c -> 'b compiler_env_config_ext * 'c) ->
      ((unit -> unit compiler_env_config_ext * 'a) -> unit compiler_env_config_ext * 'a) ->
        (unit compiler_env_config_ext -> 'a -> 'a) ->
          (abr_string option -> all_meta list -> 'b compiler_env_config_ext -> 'c -> 'b compiler_env_config_ext * 'c) -> all_meta_embedding list -> 'b compiler_env_config_ext * 'c -> 'b compiler_env_config_ext * 'c
  val replace_gen : ((('a list), 'a) nsplit list -> 'b) -> 'a list -> ('a -> bool) -> 'a list -> 'b
  val nsplit_f : 'a list -> ('a -> bool) -> (('a list), 'a) nsplit list
  val escape_sml : abr_string -> abr_string
  val is_special : int -> bool
  val ap1 : ('a -> 'b list -> 'c) -> 'a -> ('d -> 'b) -> 'd -> 'c
  val ap2 : ('a -> 'b list -> 'c) -> 'a -> ('d -> 'b) -> ('e -> 'b) -> 'd -> 'e -> 'c
  val ap3 : ('a -> 'b list -> 'c) -> 'a -> ('d -> 'b) -> ('e -> 'b) -> ('f -> 'b) -> 'd -> 'e -> 'f -> 'c
  val ap4 : ('a -> 'b list -> 'c) -> 'a -> ('d -> 'b) -> ('e -> 'b) -> ('f -> 'b) -> ('g -> 'b) -> 'd -> 'e -> 'f -> 'g -> 'c
  val ap5 : ('a -> 'b list -> 'c) -> 'a -> ('d -> 'b) -> ('e -> 'b) -> ('f -> 'b) -> ('g -> 'b) -> ('h -> 'b) -> 'd -> 'e -> 'f -> 'g -> 'h -> 'c
  val ap6 : ('a -> 'b list -> 'c) -> 'a -> ('d -> 'b) -> ('e -> 'b) -> ('f -> 'b) -> ('g -> 'b) -> ('h -> 'b) -> ('i -> 'b) -> 'd -> 'e -> 'f -> 'g -> 'h -> 'i -> 'c
  val ar1 : ('a -> 'b list -> 'c) -> 'a -> 'b -> 'c
  val ar2 : ('a -> 'b list -> 'c) -> 'a -> ('d -> 'b) -> 'd -> 'b -> 'c
  val ar3 : ('a -> 'b list -> 'c) -> 'a -> ('d -> 'b) -> ('e -> 'b) -> 'd -> 'e -> 'b -> 'c
  val co1 : ('a -> 'b) -> ('c -> 'a) -> 'c -> 'b
  val co2 : ('a -> 'b) -> ('c -> 'd -> 'a) -> 'c -> 'd -> 'b
  val cIf : 'a cExpression -> 'a cStatement -> 'a cStatement optiona -> 'a -> 'a cStatement
  val ap16 : ('a -> 'b list -> 'c) ->
               'a -> ('d -> 'b) ->
                       ('e -> 'b) ->
                         ('f -> 'b) ->
                           ('g -> 'b) ->
                             ('h -> 'b) ->
                               ('i -> 'b) ->
                                 ('j -> 'b) ->
                                   ('k -> 'b) ->
                                     ('l -> 'b) ->
                                       ('m -> 'b) -> ('n -> 'b) -> ('o -> 'b) -> ('p -> 'b) -> ('q -> 'b) -> ('r -> 'b) -> ('s -> 'b) -> 'd -> 'e -> 'f -> 'g -> 'h -> 'i -> 'j -> 'k -> 'l -> 'm -> 'n -> 'o -> 'p -> 'q -> 'r -> 's -> 'c
  val cAsm : 'a cAssemblyStatement -> 'a -> 'a cStatement
  val cFor : ('a cExpression optiona, 'a cDeclaration) either -> 'a cExpression optiona -> 'a cExpression optiona -> 'a cStatement -> 'a -> 'a cStatement
  val cVar : ident -> 'a -> 'a cExpression
  val name : int -> namea
  val cAttr : ident -> 'a cExpression list -> 'a -> 'a cAttribute
  val cAuto : 'a -> 'a cStorageSpecifier
  val cCall : 'a cExpression -> 'a cExpression list -> 'a -> 'a cExpression
  val cCase : 'a cExpression -> 'a cStatement -> 'a -> 'a cStatement
  val cCast : 'a cDeclaration -> 'a cExpression -> 'a -> 'a cExpression
  val cChar : char -> bool -> cChar
  val cCond : 'a cExpression -> 'a cExpression optiona -> 'a cExpression -> 'a -> 'a cExpression
  val cCont : 'a -> 'a cStatement
  val cDecl : 'a cDeclarationSpecifier list -> (('a cDeclarator optiona * 'a cInitializer optiona) * 'a cExpression optiona) list -> 'a -> 'a cDeclaration
  val cEnum : ident optiona -> ((ident * 'a cExpression optiona) list) optiona -> 'a cAttribute list -> 'a -> 'a cEnumeration
  val cEqOp : cBinaryOp
  val cExpr : 'a cExpression optiona -> 'a -> 'a cStatement
  val cGoto : ident -> 'a -> 'a cStatement
  val cGrOp : cBinaryOp
  val cLeOp : cBinaryOp
  val cOrOp : cBinaryOp
  val flags : int -> 'a flags
  val identc : abr_string -> int -> nodeInfo -> ident
  val d_output_position_update : (Code_Numeral.natural * Code_Numeral.natural -> Code_Numeral.natural * Code_Numeral.natural) -> 'a compiler_env_config_ext -> 'a compiler_env_config_ext
  val d_output_position : 'a compiler_env_config_ext -> Code_Numeral.natural * Code_Numeral.natural
  val print_meta_setup_def_transition : ocl_def_transition -> unit compiler_env_config_ext -> unit compiler_env_config_ext
  val print_meta_setup_def_state : ocl_def_state -> unit compiler_env_config_ext -> unit compiler_env_config_ext
  val comp_env_save_deep : all_meta_embedding -> ('a -> 'b -> unit compiler_env_config_ext * 'c) -> 'a -> 'b -> unit compiler_env_config_ext * 'c
  val fold_thy_deep : fold_all_input -> unit compiler_env_config_ext -> unit compiler_env_config_ext
  val rec_list : 'a -> ('b -> 'b list -> 'a -> 'a) -> 'b list -> 'a
  val list_iterM : ('a -> unit CodeType.mlMonad) -> 'a list -> unit CodeType.mlMonad
  val d_output_header_force : 'a compiler_env_config_ext -> bool
  val d_hsk_constr : 'a compiler_env_config_ext -> string_b_a_s_e list
  val compiler_env_config_rec0 :
    (bool -> (abr_string * (abr_string list * abr_string)) option ->
               internal_oids ->
                 Code_Numeral.natural * Code_Numeral.natural ->
                   generation_semantics_ocl ->
                     ocl_class option ->
                       all_meta_embedding list ->
                         (string_b_a_s_e * (unit ocl_instance_single_ext * internal_oids)) list ->
                           (string_b_a_s_e * (internal_oids * (abr_string * unit ocl_instance_single_ext) ocl_def_state_core) list) list ->
                             bool -> bool -> string_b_a_s_e list * string_b_a_s_e list -> string_b_a_s_e list -> string_b_a_s_e list -> generation_lemma_mode option * bool -> 'a) ->
      'b compiler_env_config_ext -> 'a
  val moreg : 'a compiler_env_config_ext -> 'a
  val compiler_env_config_rec :
    (bool -> (abr_string * (abr_string list * abr_string)) option ->
               internal_oids ->
                 Code_Numeral.natural * Code_Numeral.natural ->
                   generation_semantics_ocl ->
                     ocl_class option ->
                       all_meta_embedding list ->
                         (string_b_a_s_e * (unit ocl_instance_single_ext * internal_oids)) list ->
                           (string_b_a_s_e * (internal_oids * (abr_string * unit ocl_instance_single_ext) ocl_def_state_core) list) list ->
                             bool -> bool -> string_b_a_s_e list * string_b_a_s_e list -> string_b_a_s_e list -> string_b_a_s_e list -> generation_lemma_mode option * bool -> 'a -> 'b) ->
      'a compiler_env_config_ext -> 'b
  val truncate : 'a compiler_env_config_ext -> unit compiler_env_config_ext
  val extend : unit compiler_env_config_ext -> 'a -> 'a compiler_env_config_ext
  val compiler_env_config_more_map : ('a -> 'b) -> 'a compiler_env_config_ext -> 'b compiler_env_config_ext
  val of_semi_typ : (abr_string -> string) -> semi_typ -> string
  val of_pure_typa : (abr_string -> string) -> typ -> string
  val pure_typ0 : (abr_string -> string) -> bool -> abr_string -> typ -> string
  val of_pure_terma : (abr_string -> string) -> bool -> string list -> terma -> string
  val of_semi_terma : (abr_string -> string) -> semi_terma -> string
  val of_section : (abr_string -> string) -> 'a -> section -> string
  val of_e_n_v_section : (abr_string -> string) -> 'a compiler_env_config_ext -> section -> string
  val of_semi_thm_attribute_aux_gen_where : (abr_string -> string) -> (abr_string * semi_terma) list -> string * string
  val of_semi_thm_attribute_aux_gen_of : (abr_string -> string) -> semi_terma list -> string * string
  val of_semi_thm_attribute_aux_gen : (abr_string -> string) -> string * string -> (string * string) list -> abr_string -> string
  val of_semi_thm_attribute_aux : (abr_string -> string) -> (string * string) list -> semi_thm_attribute -> string
  val of_semi_thm_attribute : (abr_string -> string) -> semi_thm_attribute -> string
  val of_semi_thm_attribute_l1 : (abr_string -> string) -> semi_thm_attribute list -> string
  val of_semi_attrib_genA : (semi_thm list -> string) -> string -> semi_thm list -> string
  val of_semi_thm : (abr_string -> string) -> semi_thm -> string
  val of_semi_thm_l : (abr_string -> string) -> semi_thm list -> string
  val of_semi_attrib : (abr_string -> string) -> string -> semi_thm list -> string
  val of_semi_method_simp : (abr_string -> string) -> string -> semi_method_simp -> string
  val of_semi_attrib_genB : (abr_string list -> string) -> string -> abr_string list -> string
  val of_semi_attrib1 : (abr_string -> string) -> string -> abr_string list -> string
  val of_semi_method : (abr_string -> string) -> (Code_Numeral.natural -> CodeType.mlInt) -> semi_method -> string
  val of_semi_command_final : (abr_string -> string) -> (Code_Numeral.natural -> CodeType.mlInt) -> semi_command_final -> string
  val of_interpretation : (abr_string -> string) -> (Code_Numeral.natural -> CodeType.mlInt) -> 'a -> interpretation -> string
  val of_axiomatization : (abr_string -> string) -> 'a -> axiomatization -> string
  val of_type_notation : (abr_string -> string) -> 'a -> type_notation -> string
  val of_instantiation : (abr_string -> string) -> 'a -> instantiation -> string
  val of_code_reflect : (abr_string -> string) -> 'a -> code_reflect -> string
  val of_semi_typa : (abr_string -> string) -> abr_string * abr_string list -> string
  val of_type_synonym : (abr_string -> string) -> 'a -> type_synonym -> string
  val of_abbreviation : (abr_string -> string) -> 'a -> abbreviation -> string
  val of_overloading : (abr_string -> string) -> 'a -> overloading -> string
  val of_hide_const : (abr_string -> string) -> 'a -> hide_const -> string
  val of_definition : (abr_string -> string) -> (Code_Numeral.natural -> CodeType.mlInt) -> 'a -> definition -> string
  val of_text_raw : (abr_string -> string) -> 'a -> text_raw -> string
  val of_datatype : (abr_string -> string) -> 'a -> datatypea -> string
  val of_semi_thm_attribute_l : (abr_string -> string) -> semi_thm_attribute list -> string
  val of_lemmas : (abr_string -> string) -> 'a -> lemmas -> string
  val of_consts : (abr_string -> string) -> 'a -> consts -> string
  val of_semi_val_fun : semi_val_fun -> string
  val of_semi_term : (abr_string -> string) -> semi_term -> string
  val of_semi_term_0 : (abr_string -> string) -> semi_term_0 -> string
  val of_semi_term_1 : (abr_string -> string) -> semi_term_1 -> string
  val of_setup : (abr_string -> string) -> 'a -> setup -> string
  val of_semi_command_state : (abr_string -> string) -> (Code_Numeral.natural -> CodeType.mlInt) -> semi_command_state -> string
  val of_semi_command_proof : (abr_string -> string) -> (Code_Numeral.natural -> CodeType.mlInt) -> semi_command_proof -> string
  val of_lemma : (abr_string -> string) -> (Code_Numeral.natural -> CodeType.mlInt) -> 'a -> lemma -> string
  val of_text : (abr_string -> string) -> 'a -> text -> string
  val of_thm : (abr_string -> string) -> 'a -> thm -> string
  val of_ML : (abr_string -> string) -> 'a -> ml -> string
  val of_semi_theory : (abr_string -> string) -> (Code_Numeral.natural -> CodeType.mlInt) -> 'a -> semi_theory -> string
  val of_e_n_v_semi_theory : (abr_string -> string) -> (Code_Numeral.natural -> CodeType.mlInt) -> 'a compiler_env_config_ext -> semi_theory -> string
  val holThyLocale_header : 'a semi_locale_ext -> ((semi_terma * semi_typ) list * (abr_string * semi_terma) option) list
  val holThyLocale_name : 'a semi_locale_ext -> abr_string
  val string_concat_map : string -> ('a -> string) -> 'a list -> string
  val of_semi_theories0 : (abr_string -> string) -> ('a -> semi_theory -> string) -> 'a -> semi_theories -> string
  val of_e_n_v_semi_theories : (abr_string -> string) -> (Code_Numeral.natural -> CodeType.mlInt) -> 'a compiler_env_config_ext -> semi_theories -> string
  val of_boot_generation_syntax : 'a -> boot_generation_syntax -> string
  val of_ocl_def_basea : (abr_string -> string) -> ocl_def_base -> string
  val to_oid : (Code_Numeral.natural -> CodeType.mlInt) -> internal_oid -> CodeType.mlInt
  val of_ocl_data_shallowa : (abr_string -> string) -> (Code_Numeral.natural -> CodeType.mlInt) -> ocl_data_shallow -> string
  val of_ocl_list_attra : (abr_string -> string) -> ('a -> string) -> 'a ocl_list_attr -> string
  val of_ocl_instance_singlea : (abr_string -> string) -> (Code_Numeral.natural -> CodeType.mlInt) -> 'a ocl_instance_single_ext -> string
  val of_ocl_def_state_corea : (abr_string -> string) -> (Code_Numeral.natural -> CodeType.mlInt) -> abr_string ocl_def_state_core list -> string
  val of_ocl_def_pp_corea : (abr_string -> string) -> (Code_Numeral.natural -> CodeType.mlInt) -> ocl_def_pp_core -> string
  val of_ocl_def_transitiona : (abr_string -> string) -> (Code_Numeral.natural -> CodeType.mlInt) -> 'a -> string -> ocl_def_transition -> string
  val of_ocl_def_statea : (abr_string -> string) -> (Code_Numeral.natural -> CodeType.mlInt) -> 'a -> string -> ocl_def_state -> string
  val of_ocl_instancea : (abr_string -> string) -> (Code_Numeral.natural -> CodeType.mlInt) -> 'a -> ocl_instance -> string
  val of_ocl_generica : (abr_string -> string) -> 'a -> ocl_generic -> string
  val concatWith : (abr_string -> string) -> abr_string list -> string -> string
  val of_ctxt2_term_aux : (abr_string -> string) -> abr_string list -> ocl_ctxt_term -> string
  val of_ctxt2_term : (abr_string -> string) -> ocl_ctxt_term -> string
  val of_ocl_ctxta : (abr_string -> string) -> 'a -> string -> 'b ocl_ctxt_ext -> string
  val of_floora : floor -> string
  val of_all_meta_embeddinga : (abr_string -> string) -> (Code_Numeral.natural -> CodeType.mlInt) -> 'a -> all_meta_embedding -> string
  val sml_escape : abr_string -> abr_string
  val of_string_b_a_s_e : 'a -> (abr_string -> 'b) -> string_b_a_s_e -> 'b
  val rec_ocl_data_shallow : (ocl_def_base -> 'a) -> (abr_string -> 'a) -> (internal_oid -> 'a) -> ((ocl_data_shallow * 'a) list -> 'a) -> ocl_data_shallow -> 'a
  val rec_ocl_def_base : (abr_string -> 'a) -> (abr_string * abr_string -> 'a) -> (abr_string -> 'a) -> ocl_def_base -> 'a
  val of_pair : abr_string -> ('a -> 'b list -> 'c) -> (abr_string -> 'a) -> ('d -> 'b) -> ('e -> 'b) -> 'd * 'e -> 'c
  val of_ocl_def_base : (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> abr_string -> 'a) -> abr_string -> ('a -> 'a list -> 'a) -> (abr_string -> 'a) -> ocl_def_base -> 'a
  val rec_internal_oid : (Code_Numeral.natural -> 'a) -> internal_oid -> 'a
  val of_internal_oid : (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> Code_Numeral.natural -> 'a) -> ('a -> 'a list -> 'a) -> (abr_string -> 'a) -> internal_oid -> 'a
  val of_list : abr_string -> abr_string -> ('a -> 'a list -> 'a) -> (abr_string -> 'a) -> ('b -> 'a) -> 'b list -> 'a
  val of_ocl_data_shallow :
    (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> abr_string -> 'a) ->
      (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> Code_Numeral.natural -> 'a) -> abr_string -> abr_string -> abr_string -> ('a -> 'a list -> 'a) -> (abr_string -> 'a) -> ocl_data_shallow -> 'a
  val ocl_instance_single_rec0 : (abr_string option -> abr_string option -> abr_string option -> (((abr_string * abr_string) option * (abr_string * ocl_data_shallow)) list) ocl_list_attr -> 'a) -> 'b ocl_instance_single_ext -> 'a
  val moreh : 'a ocl_instance_single_ext -> 'a
  val ocl_instance_single_rec : (abr_string option -> abr_string option -> abr_string option -> (((abr_string * abr_string) option * (abr_string * ocl_data_shallow)) list) ocl_list_attr -> 'a -> 'b) -> 'a ocl_instance_single_ext -> 'b
  val rec_ocl_list_attr : ('a -> 'b) -> (abr_string -> 'a ocl_list_attr -> 'a -> 'b -> 'b) -> 'a ocl_list_attr -> 'b
  val of_ocl_list_attr : (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> abr_string -> 'a) -> ('a -> 'a list -> 'a) -> (abr_string -> 'a) -> ('b -> 'a) -> 'b ocl_list_attr -> 'a
  val rec_option : 'a -> ('b -> 'a) -> 'b option -> 'a
  val of_option : abr_string -> abr_string -> ('a -> 'b list -> 'a) -> (abr_string -> 'a) -> ('c -> 'b) -> 'c option -> 'a
  val of_ocl_instance_single :
    (abr_string -> abr_string) ->
      (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> abr_string -> 'a) ->
        (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> Code_Numeral.natural -> 'a) ->
          abr_string -> abr_string -> abr_string -> abr_string -> abr_string -> ('a -> 'a list -> 'a) -> (abr_string -> 'a) -> (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> 'b -> 'a) -> 'b ocl_instance_single_ext -> 'a
  val rec_ocl_def_state_core : (unit ocl_instance_single_ext -> 'a) -> ('b -> 'a) -> 'b ocl_def_state_core -> 'a
  val of_ocl_def_state_core :
    (abr_string -> abr_string) ->
      (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> abr_string -> 'a) ->
        (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> Code_Numeral.natural -> 'a) ->
          ((abr_string -> 'a) -> unit -> 'a) -> abr_string -> abr_string -> abr_string -> abr_string -> abr_string -> ('a -> 'a list -> 'a) -> (abr_string -> 'a) -> ('b -> 'a) -> 'b ocl_def_state_core -> 'a
  val rec_generation_semantics_ocl : 'a -> 'a -> 'a -> generation_semantics_ocl -> 'a
  val of_generation_semantics_ocl : 'a -> (abr_string -> 'b) -> generation_semantics_ocl -> 'b
  val rec_internal_oids : (Code_Numeral.natural -> Code_Numeral.natural -> Code_Numeral.natural -> 'a) -> internal_oids -> 'a
  val of_internal_oids : (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> Code_Numeral.natural -> 'a) -> ('a -> 'a list -> 'a) -> (abr_string -> 'a) -> internal_oids -> 'a
  val rec_generation_lemma_mode : 'a -> 'a -> generation_lemma_mode -> 'a
  val of_generation_lemma_mode : 'a -> (abr_string -> 'b) -> generation_lemma_mode -> 'b
  val rec_all_meta_embedding :
    (ocl_enum -> 'a) ->
      (floor -> unit ocl_class_raw_ext -> 'a) ->
        (unit ocl_association_ext -> 'a) ->
          (floor -> ocl_ass_class -> 'a) ->
            (floor -> unit ocl_ctxt_ext -> 'a) ->
              (isaUnit -> 'a) ->
                (ocl_class_synonym -> 'a) ->
                  (ocl_instance -> 'a) ->
                    (ocl_def_base_l -> 'a) -> (floor -> ocl_def_state -> 'a) -> (floor -> ocl_def_transition -> 'a) -> (ocl_class_tree -> 'a) -> (ocl_flush_all -> 'a) -> (ocl_generic -> 'a) -> all_meta_embedding -> 'a
  val rec_ocl_def_transition : (abr_string option -> ocl_def_pp_core -> ocl_def_pp_core option -> 'a) -> ocl_def_transition -> 'a
  val rec_ocl_def_pp_core : (abr_string ocl_def_state_core list -> 'a) -> (abr_string -> 'a) -> ocl_def_pp_core -> 'a
  val of_ocl_def_pp_core :
    (abr_string -> abr_string) ->
      (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> abr_string -> 'a) ->
        (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> Code_Numeral.natural -> 'a) ->
          ((abr_string -> 'a) -> unit -> 'a) -> abr_string -> abr_string -> abr_string -> abr_string -> abr_string -> ('a -> 'a list -> 'a) -> (abr_string -> 'a) -> ocl_def_pp_core -> 'a
  val of_ocl_def_transition :
    (abr_string -> abr_string) ->
      (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> abr_string -> 'a) ->
        (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> Code_Numeral.natural -> 'a) ->
          ((abr_string -> 'a) -> unit -> 'a) -> abr_string -> abr_string -> abr_string -> abr_string -> abr_string -> ('a -> 'a list -> 'a) -> (abr_string -> 'a) -> ocl_def_transition -> 'a
  val rec_ocl_def_base_l : (ocl_def_base list -> 'a) -> ocl_def_base_l -> 'a
  val of_ocl_def_base_l : (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> abr_string -> 'a) -> abr_string -> abr_string -> abr_string -> ('a -> 'a list -> 'a) -> (abr_string -> 'a) -> ocl_def_base_l -> 'a
  val rec_ocl_class_tree : (Code_Numeral.natural -> Code_Numeral.natural -> 'a) -> ocl_class_tree -> 'a
  val of_ocl_class_tree : (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> Code_Numeral.natural -> 'a) -> ('a -> 'a list -> 'a) -> (abr_string -> 'a) -> ocl_class_tree -> 'a
  val rec_ocl_def_state : (abr_string -> abr_string ocl_def_state_core list -> 'a) -> ocl_def_state -> 'a
  val of_ocl_def_state :
    (abr_string -> abr_string) ->
      (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> abr_string -> 'a) ->
        (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> Code_Numeral.natural -> 'a) ->
          ((abr_string -> 'a) -> unit -> 'a) -> abr_string -> abr_string -> abr_string -> abr_string -> abr_string -> ('a -> 'a list -> 'a) -> (abr_string -> 'a) -> ocl_def_state -> 'a
  val rec_ocl_instance : (unit ocl_instance_single_ext list -> 'a) -> ocl_instance -> 'a
  val of_ocl_instance :
    (abr_string -> abr_string) ->
      (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> abr_string -> 'a) ->
        (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> Code_Numeral.natural -> 'a) ->
          ((abr_string -> 'a) -> unit -> 'a) -> abr_string -> abr_string -> abr_string -> abr_string -> abr_string -> ('a -> 'a list -> 'a) -> (abr_string -> 'a) -> ocl_instance -> 'a
  val rec_ocl_class_synonym : (abr_string -> ocl_ty -> 'a) -> ocl_class_synonym -> 'a
  val rec_ocl_multiplicity_single : (Code_Numeral.natural -> 'a) -> 'a -> 'a -> ocl_multiplicity_single -> 'a
  val of_ocl_multiplicity_single : (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> Code_Numeral.natural -> 'a) -> ('a -> 'a list -> 'a) -> (abr_string -> 'a) -> ocl_multiplicity_single -> 'a
  val rec_ocl_collection : 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> ocl_collection -> 'a
  val of_ocl_collection : (abr_string -> 'a) -> ocl_collection -> 'a
  val ocl_multiplicity_rec0 : ((ocl_multiplicity_single * ocl_multiplicity_single option) list -> abr_string option -> ocl_collection list -> 'a) -> 'b ocl_multiplicity_ext -> 'a
  val mored : 'a ocl_multiplicity_ext -> 'a
  val ocl_multiplicity_rec : ((ocl_multiplicity_single * ocl_multiplicity_single option) list -> abr_string option -> ocl_collection list -> 'a -> 'b) -> 'a ocl_multiplicity_ext -> 'b
  val of_ocl_multiplicity :
    (abr_string -> abr_string) ->
      (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> abr_string -> 'a) ->
        (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> Code_Numeral.natural -> 'a) ->
          abr_string -> abr_string -> abr_string -> abr_string -> abr_string -> ('a -> 'a list -> 'a) -> (abr_string -> 'a) -> (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> 'b -> 'a) -> 'b ocl_multiplicity_ext -> 'a
  val rec_ocl_ty_obj_core : (abr_string -> 'a) -> (unit ocl_ty_class_ext -> 'a) -> ocl_ty_obj_core -> 'a
  val ocl_ty_class_node_rec0 : (Code_Numeral.natural -> unit ocl_multiplicity_ext -> abr_string -> 'a) -> 'b ocl_ty_class_node_ext -> 'a
  val moref : 'a ocl_ty_class_node_ext -> 'a
  val ocl_ty_class_node_rec : (Code_Numeral.natural -> unit ocl_multiplicity_ext -> abr_string -> 'a -> 'b) -> 'a ocl_ty_class_node_ext -> 'b
  val of_ocl_ty_class_node :
    (abr_string -> abr_string) ->
      (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> abr_string -> 'a) ->
        (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> Code_Numeral.natural -> 'a) ->
          ((abr_string -> 'a) -> unit -> 'a) ->
            abr_string -> abr_string -> abr_string -> abr_string -> abr_string -> ('a -> 'a list -> 'a) -> (abr_string -> 'a) -> (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> 'b -> 'a) -> 'b ocl_ty_class_node_ext -> 'a
  val ocl_ty_class_rec0 : (abr_string -> Code_Numeral.natural -> Code_Numeral.natural -> unit ocl_ty_class_node_ext -> unit ocl_ty_class_node_ext -> 'a) -> 'b ocl_ty_class_ext -> 'a
  val morea : 'a ocl_ty_class_ext -> 'a
  val ocl_ty_class_rec : (abr_string -> Code_Numeral.natural -> Code_Numeral.natural -> unit ocl_ty_class_node_ext -> unit ocl_ty_class_node_ext -> 'a -> 'b) -> 'a ocl_ty_class_ext -> 'b
  val of_ocl_ty_class :
    (abr_string -> abr_string) ->
      (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> abr_string -> 'a) ->
        (('a -> 'a list -> 'a) -> (abr_string -> 'a) -> Code_Numeral.natural -> 'a) ->
          ((abr_string -> 'a) -> unit -> 'a) ->
            abr_string -> abr_string -> abr_string -> abr_string -> abr_string -> ('a -> 'a list -> 'a) -> (