Enum Class ObligationKind

java.lang.Object
java.lang.Enum<ObligationKind>
org.ek9lang.compiler.phase5.ObligationKind
All Implemented Interfaces:
Serializable, Comparable<ObligationKind>, Constable

enum ObligationKind extends Enum<ObligationKind>
The taxonomy of contract/partiality obligations the census counts, from what already exists in the language and analysis (docs/tooling/EK9_SYMBOLIC_SCANNER_IMPLEMENTATION_SPEC.md §2.2). Each kind carries a distinct failure identity: silent-unset (arithmetic partiality), Exception (a normal catchable error path), Panic (an uncatchable contract violation — the worst) and silent-skip (a for range that runs zero iterations for some input).

An obligation is a point in the code that could fail for some input; the census marks whether an existing analysis already discharges it (proves it safe). Undischarged obligations are the Layer-2 bounded-model solver's candidates.

  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    A constrained-type constructor (Percentage(...)) fed a computed value that could fall outside the type's interval — an invariant Panic on construction.
    A container unwrap (Optional.get, Result.ok/error, Iterator.next) that throws today when the container is empty/absent.
    A partial arithmetic operator (/ mod rem) whose divisor could be zero — silently yields an unset result (matches Integer._divAss guarding != 0).
    A require pre/post/invariant that throws Panic (uncatchable in production) when false.
    A for range step-viability advisory (step == 0, or a step whose direction cannot reach the end) — the loop silently runs zero iterations rather than failing.
    An operation with a possibly-unset operand (tri-state) whose result silently propagates unset.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • DIV_BY_ZERO

      public static final ObligationKind DIV_BY_ZERO
      A partial arithmetic operator (/ mod rem) whose divisor could be zero — silently yields an unset result (matches Integer._divAss guarding != 0). Discharged when the divisor is provably non-zero from the narrowed flow state.
    • UNSET_PROPAGATION

      public static final ObligationKind UNSET_PROPAGATION
      An operation with a possibly-unset operand (tri-state) whose result silently propagates unset. Reserved for a later slice.
    • CONTAINER_UNWRAP

      public static final ObligationKind CONTAINER_UNWRAP
      A container unwrap (Optional.get, Result.ok/error, Iterator.next) that throws today when the container is empty/absent. Unguarded access already fails compilation (E08030); a compiling unwrap is therefore GUARD-discharged.
    • REQUIRE

      public static final ObligationKind REQUIRE
      A require pre/post/invariant that throws Panic (uncatchable in production) when false. The primary contract obligation. Discharged when the require expression is provably true from the narrowed flow state.
    • SILENT_SKIP

      public static final ObligationKind SILENT_SKIP
      A for range step-viability advisory (step == 0, or a step whose direction cannot reach the end) — the loop silently runs zero iterations rather than failing. Deliberately a distinct advisory class, never filed under Panic. Reserved for a later slice.
    • CONSTRAINED_CONSTRUCTION

      public static final ObligationKind CONSTRAINED_CONSTRUCTION
      A constrained-type constructor (Percentage(...)) fed a computed value that could fall outside the type's interval — an invariant Panic on construction. Reserved for a later slice.
  • Method Details

    • values

      public static ObligationKind[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ObligationKind valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null