Skip to content

Commit

Permalink
Unfold topes with symmetry for TopeEQ, increase number of iterations …
Browse files Browse the repository at this point in the history
…for unfolding
  • Loading branch information
fizruk committed Mar 22, 2023
1 parent e650cae commit 342b1e4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions rzk/src/Rzk/Evaluator.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ module Rzk.Evaluator (
localConstraint,
enterPatternScope, enterPatternScope',
eval,
entailTope
entailTope,
unfoldTopesInCube2,
) where

import Control.Monad.Except
Expand Down Expand Up @@ -353,14 +354,15 @@ unfoldRepeatedlyN unfold n xs

unfoldTopesInCube2 :: Eq var => [Term var] -> [Term var]
unfoldTopesInCube2
= unfoldRepeatedlyN unfoldTopesInCube2Once 10
= unfoldRepeatedlyN unfoldTopesInCube2Once 50

unfoldTopesInCube2Once :: Eq var => [Term var] -> [Term var]
unfoldTopesInCube2Once
= antisymmetryTopesInCube2
<> distinctTopes
<> transitivityTopesInCube2
<> transitivityTopesEQ
<> symmetryTopesEQ
<> unfoldConjunction

unfoldConjunction :: [Term var] -> [Term var]
Expand Down Expand Up @@ -388,6 +390,13 @@ transitivityTopesEQ topes =
, x /= z
]

symmetryTopesEQ :: Eq var => [Term var] -> [Term var]
symmetryTopesEQ topes =
[ TopeEQ y x
| TopeEQ x y <- topes
, x /= y
]

antisymmetryTopesInCube2 :: Eq var => [Term var] -> [Term var]
antisymmetryTopesInCube2 topes =
[ TopeEQ x y
Expand Down

0 comments on commit 342b1e4

Please sign in to comment.