Record Class FunctionSummary

java.lang.Object
java.lang.Record
org.ek9lang.compiler.symbolic.FunctionSummary
Record Components:
requires - the parameter preconditions this callable asserts (empty when none are modellable)

public record FunctionSummary(List<FunctionSummary.RequirePredicate> requires) extends Record
The inter-procedural summary of a callable (docs/tooling/EK9_SYMBOLIC_SCANNER_IMPLEMENTATION_SPEC.md §3.4) — the facts about it a caller needs to reason across the call boundary without re-analysing its whole body. For M4 this is its require preconditions: a caller that passes an argument violating a callee's require triggers an uncatchable Panic on that path, and the same predicates, read on the function itself, discharge its own downstream obligations (a division guarded by require x <> 0 is safe).

Only the simple, decidable require shape is modelled: a single relational comparison of one parameter against an integer literal (x <> 0, n > 0, …). Compound / opaque requires are conservatively omitted. canReturnUnset/Empty/Error and resultRange (Example 5, producer cases) are a later extension.

  • Field Details

    • EMPTY

      public static final FunctionSummary EMPTY
      An empty summary — no modellable preconditions.
  • Constructor Details

  • Method Details

    • hasRequires

      public boolean hasRequires()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • requires

      Returns the value of the requires record component.
      Returns:
      the value of the requires record component