package alt-ergo-lib

  1. Overview
  2. Docs

Errors module

This module aims to regroup all exception that can be raised by the Alt-Ergo-lib

Error types

type typing_error =
  1. | BitvExtract of int * int
  2. | BitvExtractRange of int * int
  3. | NonPositiveBitvType of int
  4. | ClashType of string
  5. | ClashLabel of string * string
  6. | ClashParam of string
  7. | TypeDuplicateVar of string
  8. | UnboundedVar of string
  9. | UnknownType of string
  10. | WrongArity of string * int
  11. | SymbAlreadyDefined of string
  12. | SymbUndefined of string
  13. | NotAPropVar of string
  14. | NotAPredicate of string
  15. | Unification of Ty.t * Ty.t
  16. | ShouldBeApply of string
  17. | WrongNumberofArgs of string
  18. | ShouldHaveType of Ty.t * Ty.t
  19. | ShouldHaveTypeIntorReal of Ty.t
  20. | ShouldHaveTypeInt of Ty.t
  21. | ShouldHaveTypeBitv of Ty.t
  22. | ArrayIndexShouldHaveTypeInt
  23. | ShouldHaveTypeArray
  24. | ShouldHaveTypeRecord of Ty.t
  25. | ShouldBeARecord
  26. | ShouldHaveLabel of string * string
  27. | NoLabelInType of Hstring.t * Ty.t
  28. | ShouldHaveTypeProp
  29. | NoRecordType of Hstring.t
  30. | DuplicateLabel of Hstring.t
  31. | DuplicatePattern of string
  32. | WrongLabel of Hstring.t * Ty.t
  33. | WrongNumberOfLabels
  34. | Notrigger
  35. | CannotGeneralize
  36. | SyntaxError
  37. | ThExtError of string
  38. | ThSemTriggerError
  39. | WrongDeclInTheory
  40. | ShouldBeADT of Ty.t
  41. | MatchNotExhaustive of Hstring.t list
  42. | MatchUnusedCases of Hstring.t list
  43. | NotAdtConstr of string * Ty.t
  44. | BadPopCommand of {
    1. pushed : int;
    2. to_pop : int;
    }
  45. | ShouldBePositive of int
  46. | PolymorphicEnum of string

Error that can be raised by the typechecker

type run_error =
  1. | Invalid_steps_count of int
  2. | Steps_limit of int
  3. | Failed_check_unsat_core
  4. | Unsupported_feature of string

Errors that can be raised at solving

type error =
  1. | Parser_error of string
    (*

    Error used at parser loading

    *)
  2. | Lexical_error of Loc.t * string
    (*

    Error used by the lexer

    *)
  3. | Syntax_error of Loc.t * string
    (*

    Error used by the parser

    *)
  4. | Typing_error of Loc.t * typing_error
    (*

    Error used at typing

    *)
  5. | Run_error of run_error
    (*

    Error used during solving

    *)
  6. | Warning_as_error

All types of error that can be raised

Exceptions

exception Error of error

Raising exceptions functions

val error : error -> 'a

Raise the input error as Error

val typing_error : typing_error -> Loc.t -> 'a

Raise the input typing_error as Typing_error

val run_error : run_error -> 'a

Raise the input run_error as Run_error

val warning_as_error : unit -> unit

Raise Warning_as_error as Error if the option warning-as-error is set This function can be use after warning

Printing

val report : Stdlib.Format.formatter -> error -> unit

Print a message on the formatter corresponding to the error