from itertools import repeat
from sympy import *
#from type_system import *

%run ../../src/commons.py

%run ./type-system.py

"""
Explanation: <p>
<img src="http://www.cerm.unifi.it/chianti/images/logo%20unifi_positivo.jpg" 
        alt="UniFI logo" style="float: left; width: 20%; height: 20%;">
<div align="right">
Massimo Nocentini<br>
</div>
</p>
<br>
<div align="center">
<b>Abstract</b><br>
In this document we collect a naive <i>type system</i> based on sets.
</div>
End of explanation
"""


init_printing()

x,y,m,n,t,z = symbols('x y m n t z', commutative=True)
alpha, beta, gamma, eta = symbols(r'\alpha \beta \gamma \eta', commutative=True)
f,g = Function('f'), Function('g')

"""
Explanation: 
End of explanation
"""


bin_tree_gfs = bin_tree(tyvar(alpha)[z]).gf()
bin_tree_gfs

bin_tree_gf = bin_tree_gfs[0]

bin_tree_gf.series(z, n=10, kernel='ordinary')

bin_tree_gf.series(z, n=10, kernel='catalan')

occupancy(bin_tree_gf, syms=[alpha], objects='unlike', boxes='unlike').series(z)

"""
Explanation: 
End of explanation
"""


bin_tree_of_boolean_gfs = bin_tree(maybe(tyvar(alpha))[z]).gf()
bin_tree_of_boolean_gfs

bin_tree_of_boolean_gf = bin_tree_of_boolean_gfs[0]

occupancy(bin_tree_of_boolean_gf, syms=[alpha], objects='unlike', boxes='unlike').series(z,n=6, kernel='ordinary')

"""
Explanation: 
End of explanation
"""


