mirror of
https://github.com/github/semantic.git
synced 2025-01-01 11:46:14 +03:00
Determine subequivalence using Equivalence & subalgorithmFor.
This commit is contained in:
parent
8c9be81e51
commit
cceed47743
@ -118,8 +118,8 @@ equivalentTerms :: (Diffable syntax, Eq1 syntax)
|
||||
-> Bool
|
||||
equivalentTerms term1@(Term (In _ syntax1)) term2@(Term (In _ syntax2))
|
||||
= fromMaybe False (equivalentTerms <$> equivalentBySubterm syntax1 <*> equivalentBySubterm syntax2)
|
||||
|| subequivalenceTo (flip equivalentTerms term2) syntax1
|
||||
|| subequivalenceTo ( equivalentTerms term1) syntax2
|
||||
|| runEquivalence (subalgorithmFor pure (Equivalence . flip equivalentTerms term2) syntax1)
|
||||
|| runEquivalence (subalgorithmFor pure (Equivalence . equivalentTerms term1) syntax2)
|
||||
|| liftEq equivalentTerms syntax1 syntax2
|
||||
|
||||
newtype Equivalence a = Equivalence { runEquivalence :: Bool }
|
||||
|
Loading…
Reference in New Issue
Block a user