package libabsolute

  1. Overview
  2. Docs

This module defines several parsing utilities

exception Syntax_error of string

Exception raised by parse functions when the input is syntactically invalid.

exception Semantic_error of string

Exception raised by check functions when the input is semantically invalid

val semantic_check : Csp.t -> unit

Check that no unbound variables appear, that domains are valid and function calls respect the arity.

  • raises [Semantic_error]

    if one of the above conditions is violated

val expr : string -> Expr.t

Parses a string representation of a numeric expression.

  • raises [Syntax_error]

    when the input is syntactically invalid

val constr : string -> Constraint.t

Parses a string representation of a constraint.

  • raises [Syntax_error]

    when the input is syntactically invalid

val file : ?check:bool -> string -> Csp.t

parses a .abs file and builds the corresponding problem. Raises Syntax_error when the input is syntactically invalid and Semantic_error when the input makes no sense (e.g unbound variable). When check is set to false, no semantic check is performed

OCaml

Innovation. Community. Security.