OCaml Client

ImandraX provides OCaml client libraries for programmatic access to the reasoning engine. Multiple HTTP backend implementations are available.

Client variants

The imandrax-api repository provides several OCaml client implementations under src/client/:

PackageBackendDescription
imandrax-client-coreNone (abstract)Core client types and interfaces
imandrax-client-cohttp-lwtCohttp + LwtLwt-based async client
imandrax-client-ezcurlEzcurlSynchronous client using curl

Core library

The imandrax-api core library (src/lib/) provides OCaml types for:

  • MIR (Mid-level IR) — Intermediate representation for IML programs
  • CIR (Core IR) — Core representation used by the reasoning engine
  • Tasks — Task management types
  • Eval — Evaluation result types
  • Proof — Proof representation and checking
  • Reports — Structured reporting
  • Artifacts — Serialized result objects with content-addressed storage
  • Common — Shared types and utilities

Protobuf types

All protobuf message types are available as OCaml modules generated from the .proto definitions. The API uses the same Twirp protocol as all other client libraries.

Additional language bindings

The imandrax-api repository also provides:

  • TypeScript bindings (src/ts/)
  • Rust bindings (src/rust/)

These are generated from the same protobuf definitions and provide the same API surface.

Source code

The OCaml client source is in the imandrax-api repository under src/client/ and src/lib/.