type check preparation: add types to oracle

This commit is contained in:
ProgramSnail 2025-11-05 01:58:03 +03:00
parent b7963e87a6
commit edc6c373b0
8 changed files with 179 additions and 803 deletions

View file

@ -42,6 +42,16 @@ data Value = BoolV Bool
| TreeV (Tree Value)
deriving (Read, Show, Eq, Ord)
data Type = BoolT
| IntT
| ListT Type
| TreeT Type
| AnyT
deriving (Read, Show, Eq, Ord)
data TypeConf = TypeConf { typeConfInput :: [Type],
typeConfOutput :: Type }
data Result a = Result a
| NewExamples [([Value], Value)]
| RecError String
@ -98,5 +108,3 @@ isFatalError _ = False
treeHeight :: Tree a -> Int
treeHeight (TLeaf {}) = 1
treeHeight TNode { treeLeft, treeRoot, treeRight } = 1 + (max (treeHeight treeLeft) (treeHeight treeRight) :: Int)