Get a rule search engine working with hardcoded rules
This commit is contained in:
@@ -9,15 +9,5 @@ import Control.Monad.Unify.Class
|
||||
import Data.List
|
||||
import Data.Maybe
|
||||
|
||||
runSomeComputation :: forall m. MonadLogic m => MonadUnify IntVar Expr m => m (Expr IntVar)
|
||||
runSomeComputation = do
|
||||
x1 <- fresh
|
||||
x2 <- fresh
|
||||
let binPred = Atom "hello" $ fromFoldable [variable x1, variable x2]
|
||||
let realBinPred = Atom "hello" $ fromFoldable [Atom "first" $ fromFoldable [], Atom "second" $ fromFoldable []]
|
||||
unify binPred realBinPred
|
||||
(unify (variable x1) (variable x2) >>= const (reify (variable x1))) `interleave` (unify (variable x1) (variable x1) >>= const (reify (variable x2)))
|
||||
|
||||
|
||||
main :: Maybe (Expr IntVar)
|
||||
main = runUnifier runSomeComputation
|
||||
main :: List String
|
||||
main = map toLatexProofTree $ runUnifier $ query $ tType (tSndExpr (tProdExpr tStringExpr (tPlusExpr tIntExpr tIntExpr))) (Var "T")
|
||||
|
||||
Reference in New Issue
Block a user