Commit caec3b25 authored by Vincent Zweije's avatar Vincent Zweije
Browse files

Introduce type for generated function body

parent da1f0fe0
...@@ -9,6 +9,9 @@ from rule import Rgraph,Rule ...@@ -9,6 +9,9 @@ from rule import Rgraph,Rule
from general import Optional from general import Optional
from StdOverloaded import == from StdOverloaded import ==
:: FunBody sym var
:== [Rule sym var]
:: Etracer sym var pvar :== :: Etracer sym var pvar :==
(Trace sym var pvar) (Trace sym var pvar)
(Rgraph sym var) (Rgraph sym var)
...@@ -20,7 +23,7 @@ fullfold :: ...@@ -20,7 +23,7 @@ fullfold ::
((Rgraph sym var)->(sym,[var])) ((Rgraph sym var)->(sym,[var]))
sym sym
(Trace sym var pvar) (Trace sym var pvar)
-> ([Bool],[Rule sym var],[Rgraph sym var]) -> ([Bool],FunBody sym var,[Rgraph sym var])
| == sym | == sym
& == var & == var
& == pvar & == pvar
...@@ -66,7 +66,12 @@ Deprecated type ...@@ -66,7 +66,12 @@ Deprecated type
> * -> > * ->
> trace * ** *** -> > trace * ** *** ->
> (bool,([bool],[rule * **],[rgraph * **])) > (bool,([bool],[rule * **],[rgraph * **]))
*/
:: FunBody sym var
:== [Rule sym var]
/*
Implementation Implementation
-------------- --------------
...@@ -89,7 +94,7 @@ fullfold :: ...@@ -89,7 +94,7 @@ fullfold ::
((Rgraph sym var)->(sym,[var])) ((Rgraph sym var)->(sym,[var]))
sym sym
(Trace sym var pvar) (Trace sym var pvar)
-> ([Bool],[Rule sym var],[Rgraph sym var]) -> ([Bool],FunBody sym var,[Rgraph sym var])
| == sym | == sym
& == var & == var
& == pvar & == pvar
...@@ -114,7 +119,7 @@ recurse :: ...@@ -114,7 +119,7 @@ recurse ::
((Rgraph sym var)->(sym,[var])) ((Rgraph sym var)->(sym,[var]))
sym sym
-> (Trace sym var pvar) -> (Trace sym var pvar)
-> (Bool,([Bool],[Rule sym var],[Rgraph sym var])) -> (Bool,([Bool],FunBody sym var,[Rgraph sym var]))
| == sym | == sym
& == var & == var
& == pvar & == pvar
...@@ -154,7 +159,7 @@ foldtips :: ...@@ -154,7 +159,7 @@ foldtips ::
(sym,[var]) (sym,[var])
-> ([(var,Graph sym var)],[(var,Graph sym var)]) -> ([(var,Graph sym var)],[(var,Graph sym var)])
(Trace sym var pvar) (Trace sym var pvar)
-> (Bool,([Bool],[Rule sym var],[Rgraph sym var])) -> (Bool,([Bool],FunBody sym var,[Rgraph sym var]))
| == sym | == sym
& == var & == var
& == pvar & == pvar
...@@ -223,7 +228,7 @@ newextract :: ...@@ -223,7 +228,7 @@ newextract ::
(Etracer sym var pvar) (Etracer sym var pvar)
((Rgraph sym var)->(sym,[var])) ((Rgraph sym var)->(sym,[var]))
(Trace sym var pvar) (Trace sym var pvar)
-> ([Bool],[Rule sym var],[Rgraph sym var]) -> ([Bool],FunBody sym var,[Rgraph sym var])
| == sym | == sym
& == var & == var
& == pvar & == pvar
......
...@@ -4,6 +4,7 @@ definition module newtest ...@@ -4,6 +4,7 @@ definition module newtest
from cli import Cli from cli import Cli
from coreclean import SuclTypeSymbol,SuclTypeVariable,SuclSymbol,SuclVariable from coreclean import SuclTypeSymbol,SuclTypeVariable,SuclSymbol,SuclVariable
from newfold import FunBody
from trace import Trace,Transformation from trace import Trace,Transformation
from spine import Answer,Spine,Subspine from spine import Answer,Spine,Subspine
from history import History,HistoryAssociation,HistoryPattern from history import History,HistoryAssociation,HistoryPattern
...@@ -16,7 +17,7 @@ from general import Optional ...@@ -16,7 +17,7 @@ from general import Optional
, srr_strictness :: [Bool] // Strictness annotations , srr_strictness :: [Bool] // Strictness annotations
, srr_typerule :: Rule tsym tvar // Type rule , srr_typerule :: Rule tsym tvar // Type rule
, srr_trace :: Trace sym var var // Truncated and folded trace , srr_trace :: Trace sym var var // Truncated and folded trace
, srr_rules :: [Rule sym var] // Resulting rewrite rules , srr_function_body :: FunBody sym var // Resulting rewrite rules
, srr_areas :: [Rgraph sym var] // New areas for further symbolic reduction (not necessarily canonical) , srr_areas :: [Rgraph sym var] // New areas for further symbolic reduction (not necessarily canonical)
} }
......
...@@ -153,7 +153,7 @@ these tuples. ...@@ -153,7 +153,7 @@ these tuples.
, srr_strictness :: [Bool] // Strictness annotations , srr_strictness :: [Bool] // Strictness annotations
, srr_typerule :: Rule tsym tvar // Type rule , srr_typerule :: Rule tsym tvar // Type rule
, srr_trace :: Trace sym var var // Truncated and folded trace , srr_trace :: Trace sym var var // Truncated and folded trace
, srr_rules :: [Rule sym var] // Resulting rewrite rules , srr_function_body :: FunBody sym var // Resulting rewrite rules
, srr_areas :: [Rgraph sym var] // New areas for further symbolic reduction (not necessarily canonical) , srr_areas :: [Rgraph sym var] // New areas for further symbolic reduction (not necessarily canonical)
} }
...@@ -357,7 +357,7 @@ symredarea foldarea cli area ...@@ -357,7 +357,7 @@ symredarea foldarea cli area
, srr_strictness = stricts , srr_strictness = stricts
, srr_typerule = trule , srr_typerule = trule
, srr_trace = trace , srr_trace = trace
, srr_rules = rules , srr_function_body = rules
, srr_areas = areas , srr_areas = areas
} }
where agraph = rgraphgraph area; aroot = rgraphroot area where agraph = rgraphgraph area; aroot = rgraphroot area
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment