---
spec: JLS
title: "The Java Language Specification"
edition: "Java SE 24 Edition"
java_version: 24
chapter: "Chapter 18. Type Inference"
section: "18.2"
heading: "18.2. Reduction"
parent: "Chapter 18. Type Inference"
source: https://docs.oracle.com/javase/specs/jls/se24/html/jls-18.html#jls-18.2
id: "18.2"
url: https://jvm.obfuscated.software/jls/se24/18.2.html
raw: https://jvm.obfuscated.software/jls/se24/18.2.md
---

# 18.2. Reduction

*Reduction* is the process by which a set of constraint formulas ([§18.1.2](18.1.2.md)) is simplified to produce a bound set ([§18.1.3](18.1.3.md)).

Each constraint formula is considered in turn. The rules in this section specify how the formula is reduced to one or both of:

- A bound or bound set, which is to be incorporated with the "current" bound set. Initially, the current bound set is empty.
- Further constraint formulas, which are to be reduced recursively.

Reduction completes when no further constraint formulas remain to be reduced.

The results of a reduction step are always *soundness-preserving*: if an inference variable instantiation satisfies the reduced constraints and bounds, it will also satisfy the original constraint. On the other hand, reduction is not *completeness-preserving*: there may exist inference variable instantiations that satisfy the original constraint but *do not* satisfy a reduced constraint or bound. This is due to inherent limitations of the algorithm, along with a desire to avoid undue complexity. One effect is that there are expressions for which type argument inference fails to find a solution, but that can be well-typed if the programmer explicitly inserts appropriate types.

**Sections:**

- [18.2.1. Expression Compatibility Constraints](18.2.1.md)
- [18.2.2. Type Compatibility Constraints](18.2.2.md)
- [18.2.3. Subtyping Constraints](18.2.3.md)
- [18.2.4. Type Equality Constraints](18.2.4.md)
- [18.2.5. Checked Exception Constraints](18.2.5.md)
