package libabsolute

  1. Overview
  2. Docs

Module Libabsolute.ParserSource

This module defines several parsing utilities

Sourceexception Syntax_error of string

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

Sourceexception Semantic_error of string

Exception raised by check functions when the input is semantically invalid

Sourceval 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

Sourceval expr : string -> Expr.t

Parses a string representation of a numeric expression.

  • raises [Syntax_error]

    when the input is syntactically invalid

Sourceval constr : string -> Constraint.t

Parses a string representation of a constraint.

  • raises [Syntax_error]

    when the input is syntactically invalid

Sourceval 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