# Package org.apache.groovy.contracts.ast

## Package org.apache.groovy.contracts.ast Description

AST transformations for implementing Design by Contract semantics, including precondition, postcondition, and invariant validation transformations.

- Class Summary
  Class | Description
  --- | ---
  BaseASTTransformation | Base AST transformation encapsulating all common helper methods and implementing ASTTransformation.
  ClosureExpressionEvaluationASTTransformation | Evaluates ClosureExpression instances in annotation parameters and generates special contract closure classes from them.
  GContractsASTTransformation |
  LoopInvariantASTTransformation | Handles Invariant annotations placed on loop statements (`for`, `while`, `do-while`).
  LoopVariantASTTransformation | Handles Decreases annotations placed on loop statements (`for`, `while`, `do-while`).
  MethodVariantASTTransformation | Handles a Decreases annotation placed on a method (the loop case is handled by LoopVariantASTTransformation).
  MethodVariantInheritanceASTTransformation | Inherits a method-level Decreases termination measure onto an override that does not redeclare it — mirroring how groovy-contracts inherits `@Requires`/`@Ensures` (Liskov substitution).
  ModifiesASTTransformation | Handles Modifies annotations placed on methods.
  ModifiesEnsuresValidationTransformation | Validates that `@Ensures` postconditions on a method only reference fields via `old.xxx` that are declared as modifiable by `@Modifies`.