From eb67b6b665f5f3afefd39799fa6f579dc65d1565 Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Fri, 14 Oct 2022 21:36:08 +0200 Subject: backtracking --- app/Main.hs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'app/Main.hs') diff --git a/app/Main.hs b/app/Main.hs index 9d8fc29..be4febe 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -2,5 +2,26 @@ module Main where import Interpreter +import qualified Data.Map as M + main :: IO () -main = putStrLn "Hello, Prolog!" +main = + print $ + prove [Goal, U (Struct (1, 2)), U (Atom 1), U (Atom 2), LastCall] $ + M.fromList + [ ( (1, 2) + , [ [U (Atom 333), U (Atom 444), NoGoal] + , [ U (Atom 1) + , U (Atom 2) + , Goal + , U (Struct (2, 0)) + , Call + , Goal + , U (Struct (1, 2)) + , U (Atom 333) + , U (Atom 444) + , LastCall + ] + ]) + , ((2, 0), [[NoGoal]]) + ] -- cgit v1.2.3