2023-02-28 19:44:24 -08:00
|
|
|
module Test.Main where
|
|
|
|
|
|
|
|
import Prelude
|
2023-03-03 23:19:52 -08:00
|
|
|
import Language.Bergamot.Syntax
|
2023-03-05 18:44:56 -08:00
|
|
|
import Language.Bergamot.Rules
|
|
|
|
import Language.Bergamot.Unifier
|
2023-03-05 21:33:45 -08:00
|
|
|
import Language.Bergamot.Parser
|
2023-03-11 16:41:52 -08:00
|
|
|
import Language.Bergamot.Latex
|
2023-03-05 21:33:45 -08:00
|
|
|
import Control.Apply
|
2023-03-03 23:19:52 -08:00
|
|
|
import Control.Monad.Logic.Trans
|
|
|
|
import Control.Monad.Logic.Class
|
|
|
|
import Control.Monad.Unify.Trans
|
|
|
|
import Control.Monad.Unify.Class
|
2023-03-05 21:33:45 -08:00
|
|
|
import Data.List (List(..), (:))
|
|
|
|
import Data.Array (fromFoldable)
|
|
|
|
import Data.Foldable
|
2023-03-03 23:19:52 -08:00
|
|
|
import Data.Maybe
|
2023-02-28 19:44:24 -08:00
|
|
|
|
2023-03-05 21:33:45 -08:00
|
|
|
main :: String -> String -> Maybe String
|
2023-03-11 16:41:52 -08:00
|
|
|
main rs q = map (toLatex <<< map (const "?")) $ join $ lift2 runUnifier (fromFoldable <$> parseRules rs) (query <$> parseQuery q)
|
2023-03-04 22:15:37 -08:00
|
|
|
-- main = map toLatexProofTree $ runUnifier rules $ query $ tType (tSndExpr (tProdExpr tStringExpr (tPlusExpr tIntExpr tIntExpr))) (Var "T")
|