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 -
Constructor Summary
ConstructorsConstructorDescriptionPatMatcher(boolean inferMeta, @NotNull UnaryOperator<org.aya.syntax.core.term.Term> pre) Creates an instance of aPatMatcherrecord class. -
Method Summary
Modifier and TypeMethodDescription@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 booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theinferMetarecord component.@NotNull UnaryOperator<org.aya.syntax.core.term.Term> pre()Returns the value of theprerecord component.static @NotNull org.aya.syntax.core.term.TermrealSolution(@NotNull org.aya.syntax.core.term.MetaPatTerm term) final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PatMatcher
public PatMatcher(boolean inferMeta, @NotNull @NotNull UnaryOperator<org.aya.syntax.core.term.Term> pre) Creates an instance of aPatMatcherrecord class.- Parameters:
inferMeta- the value for theinferMetarecord componentpre- the value for theprerecord 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
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
inferMeta
public boolean inferMeta()Returns the value of theinferMetarecord component.- Returns:
- the value of the
inferMetarecord component
-
pre
Returns the value of theprerecord component.- Returns:
- the value of the
prerecord component
-