mirror of
https://codeberg.org/ProgramSnail/prog_synthesis.git
synced 2025-12-25 22:38:44 +00:00
type check preparation: add types to oracle
This commit is contained in:
parent
b7963e87a6
commit
edc6c373b0
8 changed files with 179 additions and 803 deletions
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue