|
2 | 2 |
|
3 | 3 | val exit_on_rte : bool ref |
4 | 4 |
|
| 5 | +module type S = sig |
| 6 | + type custom_float |
| 7 | + |
| 8 | + type ctx = custom_float Types.ctx |
| 9 | + |
| 10 | + exception InternalRuntimeError of Types.run_error * ctx |
| 11 | + |
| 12 | + (** {2 M Evaluation} *) |
| 13 | + |
| 14 | + val evaluate_expr : |
| 15 | + ctx -> M_ir.Mir.expression Pos.marked -> custom_float Types.value |
| 16 | + (** Evaluates an expression. *) |
| 17 | + |
| 18 | + val evaluate_program : ctx -> unit |
| 19 | + (** Evaluates a whole program. Proper initialisation of inputs and events |
| 20 | + is required before calling this function (through [update_ctx_with_inputs] |
| 21 | + and [update_ctx_with_events]. *) |
| 22 | + |
| 23 | + (** {2 Helpers} *) |
| 24 | + |
| 25 | + (** These helpers are here for compatibility with {!module: Context}. *) |
| 26 | + |
| 27 | + val literal_to_value : M_ir.Com.literal -> custom_float Types.value |
| 28 | + |
| 29 | + val value_to_literal : custom_float Types.value -> M_ir.Com.literal |
| 30 | + |
| 31 | + val literal_event_to_value_event : |
| 32 | + (M_ir.Com.literal, M_ir.Com.Var.t) M_ir.Com.event_value -> |
| 33 | + (custom_float Types.value, M_ir.Com.Var.t) M_ir.Com.event_value |
| 34 | +end |
| 35 | + |
5 | 36 | (** {2 Engine builder} *) |
6 | 37 |
|
7 | 38 | (** Builds an intepretation engine from a number interface |
8 | 39 | ({!module: M_ir.Mir_number}) and a rounding strategy |
9 | 40 | ({!module: M_ir.Mir_roundops}). *) |
10 | 41 | module Make |
11 | 42 | (N : M_ir.Mir_number.NumberInterface) |
12 | | - (RF : M_ir.Mir_roundops.RoundOpsFunctor) : |
13 | | - Types.S with type custom_float = N.t |
| 43 | + (RF : M_ir.Mir_roundops.RoundOpsFunctor) : S with type custom_float = N.t |
14 | 44 |
|
15 | 45 | (** {2 Engines} *) |
16 | 46 |
|
17 | 47 | (** These modules are instanes of Make with modules defined in |
18 | 48 | {!module: M_ir.Mir_number} and {!module: M_ir.Mir_roundops}. *) |
19 | 49 |
|
20 | | -module FloatDefInterp : Types.S |
| 50 | +module FloatDefInterp : S with type custom_float = float |
21 | 51 |
|
22 | | -module FloatMultInterp : Types.S |
| 52 | +module FloatMultInterp : S with type custom_float = float |
23 | 53 |
|
24 | | -module FloatMfInterp : Types.S |
| 54 | +module FloatMfInterp : S with type custom_float = float |
25 | 55 |
|
26 | | -module MPFRDefInterp : Types.S |
| 56 | +module MPFRDefInterp : S with type custom_float = Mpfrf.t |
27 | 57 |
|
28 | | -module MPFRMultInterp : Types.S |
| 58 | +module MPFRMultInterp : S with type custom_float = Mpfrf.t |
29 | 59 |
|
30 | | -module MPFRMfInterp : Types.S |
| 60 | +module MPFRMfInterp : S with type custom_float = Mpfrf.t |
31 | 61 |
|
32 | | -module BigIntDefInterp : Types.S |
| 62 | +module BigIntDefInterp : S with type custom_float = Mpzf.t |
33 | 63 |
|
34 | | -module BigIntMultInterp : Types.S |
| 64 | +module BigIntMultInterp : S with type custom_float = Mpzf.t |
35 | 65 |
|
36 | | -module BigIntMfInterp : Types.S |
| 66 | +module BigIntMfInterp : S with type custom_float = Mpzf.t |
37 | 67 |
|
38 | | -module IntvDefInterp : Types.S |
| 68 | +module IntvDefInterp : S |
39 | 69 |
|
40 | | -module IntvMultInterp : Types.S |
| 70 | +module IntvMultInterp : S |
41 | 71 |
|
42 | | -module IntvMfInterp : Types.S |
| 72 | +module IntvMfInterp : S |
43 | 73 |
|
44 | | -module RatDefInterp : Types.S |
| 74 | +module RatDefInterp : S with type custom_float = Mpqf.t |
45 | 75 |
|
46 | | -module RatMultInterp : Types.S |
| 76 | +module RatMultInterp : S with type custom_float = Mpqf.t |
47 | 77 |
|
48 | | -module RatMfInterp : Types.S |
| 78 | +module RatMfInterp : S with type custom_float = Mpqf.t |
49 | 79 |
|
50 | 80 | val evaluate_program : |
51 | 81 | p:M_ir.Mir.program -> |
|
0 commit comments