From dc3e009beb788d33ce883263e2e2a71fc995be3d Mon Sep 17 00:00:00 2001 From: ymh Date: Tue, 29 Aug 2023 14:39:03 +0800 Subject: [PATCH] temp hack to filter for hornlikes; to remove after implementing prevalidation --- .../src/LS/XPile/LogicalEnglish/LogicalEnglish.hs | 8 +++++--- .../src/LS/XPile/LogicalEnglish/ValidateL4Input.hs | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/haskell/natural4/src/LS/XPile/LogicalEnglish/LogicalEnglish.hs b/lib/haskell/natural4/src/LS/XPile/LogicalEnglish/LogicalEnglish.hs index b2c4d06b4..5508039e5 100644 --- a/lib/haskell/natural4/src/LS/XPile/LogicalEnglish/LogicalEnglish.hs +++ b/lib/haskell/natural4/src/LS/XPile/LogicalEnglish/LogicalEnglish.hs @@ -51,7 +51,7 @@ import LS.Rule qualified as L4 (Rule(..)) import LS.XPile.LogicalEnglish.Types import LS.XPile.LogicalEnglish.ValidateL4Input (L4Rules, ValidHornls, Unvalidated, - check, refine, loadRawL4AsUnvalid) + check, refine, loadRawL4AsUnvalid, isHornlike) import LS.XPile.LogicalEnglish.SimplifyL4 (SimpL4(..), SimL4Error(..), simplifyL4hc) -- TODO: Add import list import LS.XPile.LogicalEnglish.IdVars (idVarsInHC) import LS.XPile.LogicalEnglish.GenNLAs (nlasFromVarsHC) @@ -101,8 +101,10 @@ allNLAs = foldMap nlasFromVarsHC simplifyL4hcs :: [L4.Rule] -> SimpL4 [SimpleL4HC] -simplifyL4hcs = traverse simplifyL4hc - +simplifyL4hcs = traverse simplifyL4hc . filter isHornlike +{- ^ IMPT TODO: move `filter isHornlike` to prevalidation step when implementing that. + This is a temp hack to avoid crashes due to NatL4 app's poor architecture +-} xpileSimplifiedL4HCs :: [SimpleL4HC] -> String xpileSimplifiedL4HCs simpL4HCs = diff --git a/lib/haskell/natural4/src/LS/XPile/LogicalEnglish/ValidateL4Input.hs b/lib/haskell/natural4/src/LS/XPile/LogicalEnglish/ValidateL4Input.hs index d6d23ffd5..719dacfb8 100644 --- a/lib/haskell/natural4/src/LS/XPile/LogicalEnglish/ValidateL4Input.hs +++ b/lib/haskell/natural4/src/LS/XPile/LogicalEnglish/ValidateL4Input.hs @@ -9,6 +9,8 @@ module LS.XPile.LogicalEnglish.ValidateL4Input , check , refine , loadRawL4AsUnvalid + + , isHornlike -- TODO: TEMP export; will remove this after implementing the prevalidation ) where