Package hydra.typing

Class InferenceResult

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<InferenceResult>

    public class InferenceResult
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Comparable<InferenceResult>
    The result of applying inference rules to a term.
    See Also:
    Serialized Form
    • Field Detail

      • TYPE_

        public static final Name TYPE_
        Name of the hydra.typing.InferenceResult type.
      • TERM

        public static final Name TERM
        Name of the hydra.typing.InferenceResult.term field.
      • TYPE

        public static final Name TYPE
        Name of the hydra.typing.InferenceResult.type field.
      • SUBST

        public static final Name SUBST
        Name of the hydra.typing.InferenceResult.subst field.
      • CLASS_CONSTRAINTS

        public static final Name CLASS_CONSTRAINTS
        Name of the hydra.typing.InferenceResult.classConstraints field.
      • CONTEXT

        public static final Name CONTEXT
        Name of the hydra.typing.InferenceResult.context field.
      • term

        public final Term term
        The term which was inferred
      • type

        public final Type type
        The inferred type of the term
      • subst

        public final TypeSubst subst
        The type substitution resulting from unification
      • classConstraints

        public final java.util.Map<Name,​TypeVariableConstraints> classConstraints
        Class constraints discovered during inference (e.g., Ord constraints from Map.lookup)
      • context

        public final InferenceContext context
        The updated InferenceContext after inference (carries fresh-variable counter and trace)
    • Constructor Detail

      • InferenceResult

        public InferenceResult​(Term term,
                               Type type,
                               TypeSubst subst,
                               java.util.Map<Name,​TypeVariableConstraints> classConstraints,
                               InferenceContext context)
        Constructs an immutable InferenceResult.
        Parameters:
        term - The term which was inferred
        type - The inferred type of the term
        subst - The type substitution resulting from unification
        classConstraints - Class constraints discovered during inference (e.g., Ord constraints from Map.lookup)
        context - The updated InferenceContext after inference (carries fresh-variable counter and trace)