Skip to content
This repository was archived by the owner on Jan 30, 2026. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions irj_checker.opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "%%VERSION%%"
version: "186-15-ga4a1d1ff"
synopsis: "IRJ test validation tool"
description:
"This standalone module performs a syntactic validation of the DGFiP IRJ test format"
Expand All @@ -11,12 +11,12 @@ homepage: "https://github.com/MLanguage/mlang"
bug-reports: "https://github.com/MLanguage/mlang/issues"
depends: [
"ocaml" {>= "4.11.2"}
"dune" {>= "2.7" & build}
"dune" {build}
"odoc" {>= "1.5.3"}
"ocamlformat" {= "0.24.1"}
]
build: [
["dune" "subst"] {dev}
["dune" "subst"] {pinned}
[
"dune"
"build"
Expand Down
6 changes: 3 additions & 3 deletions mlang.opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "%%VERSION%%"
version: "186-15-ga4a1d1ff"
synopsis: "Compiler for DGFiP's M language"
description: """
The Direction Générale des Finances Publiques (DGFiP)
Expand All @@ -16,7 +16,7 @@ homepage: "https://github.com/MLanguage/mlang"
bug-reports: "https://github.com/MLanguage/mlang/issues"
depends: [
"ocaml" {>= "4.13.0"}
"dune" {>= "2.7" & build}
"dune" {build}
"ANSITerminal" {= "0.8.2"}
"cmdliner" {= "1.3.0"}
"re" {= "1.11.0"}
Expand All @@ -29,7 +29,7 @@ depends: [
"parmap" {= "1.2.3"}
]
build: [
["dune" "subst"] {dev}
["dune" "subst"] {pinned}
[
"dune"
"build"
Expand Down
5 changes: 1 addition & 4 deletions src/mlang/backend_compilers/decoupledExpr.ml
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,7 @@ let comp op (e1 : constr) (e2 : constr) (stacks : local_stacks)
let comp (o : Com.comp_op) =
match (e1, e2) with
| Dlit f1, Dlit f2 ->
if
Mir_interpreter.FloatDefInterp.compare_numbers o
(Mir_number.RegularFloatNumber.of_float f1)
(Mir_number.RegularFloatNumber.of_float f2)
if Mir_number.RegularFloatNumber.(compare o (of_float f1) (of_float f2))
then Dtrue
else Dfalse
| Dvar v1, Dvar v2 ->
Expand Down
1 change: 0 additions & 1 deletion src/mlang/driver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ let parse () =
m_program

let run_single_test m_program test =
Mir_interpreter.repl_debug := true;
Test_interpreter.check_one_test m_program test !Config.value_sort
!Config.round_ops;
Cli.result_print "Test passed!"
Expand Down
2 changes: 1 addition & 1 deletion src/mlang/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(flags
(:standard -open Utils))
(libraries re ANSITerminal parmap cmdliner threads dune-build-info num gmp
menhirLib m_frontend m_ir irj_utils backend_compilers))
menhirLib m_frontend m_ir irj_utils backend_compilers m_interpreter))

(documentation
(package mlang)
Expand Down
17 changes: 16 additions & 1 deletion src/mlang/index.mld
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,25 @@ and basically all programs typecheck ; however {!module: Mlang.M_frontend.Valida
Mlang.M_ir.Com
Mlang.M_ir.Format_mir
Mlang.M_ir.Mir
Mlang.M_ir.Mir_interpreter
Mlang.M_ir.Mir_number
Mlang.M_ir.Mir_roundops }

{1 Interpreter}

The intepreter is the reference for the M semantics. The C code Mlang generates must
follow it.
The main interpreter module is {!module: Mlang.Mir_interpreter.Eval} which defines two
functions: {!Mlang.Mir_interpreter.Eval.evaluate_program} and {!Mlang.Mir_interpreter.Eval.evaluate_expr}. It also defines several modules that evaluates programs and expression
with different float precisions.

{!modules:
Mlang.Mir_interpreter.Anomalies
Mlang.Mir_interpreter.Context
Mlang.Mir_interpreter.Eval
Mlang.Mir_interpreter.Functions
Mlang.Mir_interpreter.Print
Mlang.Mir_interpreter.Types }

{1 Testing}

Mlang comes with a testing framework for M programs that is based on
Expand Down
16 changes: 7 additions & 9 deletions src/mlang/m_ir/mir.mli
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@
- Constants have been inlined.
- Loops (FunCallLoop, Loop) have been unrolled.
- Chaining, domain and verification calculations have been unified into
Target calculations.
This filtering is performed by {!M_frontend.Expander}, {!M_frontend.Validator} and
{!M_frontend.Mast_to_mir}.
Target calculations. This filtering is performed by
{!M_frontend.Expander}, {!M_frontend.Validator} and
{!M_frontend.Mast_to_mir}.

The structural difference between {!M_frontend.Mast} and Mir common types are
the replacement of {!Mir.Com.m_var_name} by {!M_ir.Com.Var.t} and
{!M_frontend.Mast.error_name} by {!M_ir.Com.Error.t}.
*)
The structural difference between {!M_frontend.Mast} and Mir common types
are the replacement of {!Mir.Com.m_var_name} by {!M_ir.Com.Var.t} and
{!M_frontend.Mast.error_name} by {!M_ir.Com.Error.t}. *)

type set_value = Com.Var.t Com.set_value

Expand Down Expand Up @@ -64,8 +63,7 @@ type stats = {
max_nb_args : int;
table_map : Com.Var.t IntMap.t;
}
(** A set of constants relative to the program and its selected
applications. *)
(** A set of constants relative to the program and its selected applications. *)

type program = {
program_safe_prefix : string;
Expand Down
Loading
Loading