Module aya.base

Record Class PatMatcher

java.lang.Object
java.lang.Record
org.aya.normalize.PatMatcher
Record Components:
inferMeta - whether infer the PatMetaTerm

public record PatMatcher(boolean inferMeta, @NotNull UnaryOperator<org.aya.syntax.core.term.Term> pre) extends Record
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static enum 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    PatMatcher(boolean inferMeta, @NotNull UnaryOperator<org.aya.syntax.core.term.Term> pre)
    Creates an instance of a PatMatcher record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull kala.control.Result<kala.collection.immutable.ImmutableSeq<org.aya.syntax.core.term.Term>,PatMatcher.State>
    apply(@NotNull kala.collection.immutable.ImmutableSeq<org.aya.syntax.core.pat.Pat> pats, @NotNull kala.collection.immutable.ImmutableSeq<org.aya.syntax.core.term.Term> terms)
     
    @NotNull kala.control.Result<org.aya.syntax.core.term.Term,PatMatcher.State>
    apply(org.aya.syntax.core.term.Term.Matching matching, @NotNull kala.collection.immutable.ImmutableSeq<org.aya.syntax.core.term.Term> terms)
     
    static @NotNull kala.collection.immutable.ImmutableSeq<org.aya.syntax.core.term.Term>
    doSolveMeta(@NotNull org.aya.syntax.core.pat.Pat pat, org.aya.syntax.core.pat.Pat.Meta meta)
    Perform meta solving, make sure that is unsolved.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the inferMeta record component.
    @NotNull UnaryOperator<org.aya.syntax.core.term.Term>
    pre()
    Returns the value of the pre record component.
    static @NotNull org.aya.syntax.core.term.Term
    realSolution(@NotNull org.aya.syntax.core.term.MetaPatTerm term)
     
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PatMatcher

      public PatMatcher(boolean inferMeta, @NotNull @NotNull UnaryOperator<org.aya.syntax.core.term.Term> pre)
      Creates an instance of a PatMatcher record class.
      Parameters:
      inferMeta - the value for the inferMeta record component
      pre - the value for the pre record component
  • Method Details

    • apply

      @NotNull public @NotNull kala.control.Result<kala.collection.immutable.ImmutableSeq<org.aya.syntax.core.term.Term>,PatMatcher.State> apply(@NotNull @NotNull kala.collection.immutable.ImmutableSeq<org.aya.syntax.core.pat.Pat> pats, @NotNull @NotNull kala.collection.immutable.ImmutableSeq<org.aya.syntax.core.term.Term> terms)
      Returns:
      a substitution of corresponding bindings of if success.
      See Also:
      API Note:
      The binding order is the same as Pat.consumeBindings(java.util.function.BiConsumer)
    • apply

      @NotNull public @NotNull kala.control.Result<org.aya.syntax.core.term.Term,PatMatcher.State> apply(@NotNull org.aya.syntax.core.term.Term.Matching matching, @NotNull @NotNull kala.collection.immutable.ImmutableSeq<org.aya.syntax.core.term.Term> terms)
    • realSolution

      @NotNull public static @NotNull org.aya.syntax.core.term.Term realSolution(@NotNull @NotNull org.aya.syntax.core.term.MetaPatTerm term)
    • doSolveMeta

      @NotNull public static @NotNull kala.collection.immutable.ImmutableSeq<org.aya.syntax.core.term.Term> doSolveMeta(@NotNull @NotNull org.aya.syntax.core.pat.Pat pat, org.aya.syntax.core.pat.Pat.Meta meta)
      Perform meta solving, make sure that is unsolved.
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • inferMeta

      public boolean inferMeta()
      Returns the value of the inferMeta record component.
      Returns:
      the value of the inferMeta record component
    • pre

      @NotNull public @NotNull UnaryOperator<org.aya.syntax.core.term.Term> pre()
      Returns the value of the pre record component.
      Returns:
      the value of the pre record component