'''
Created on 20-Jan-2022

@author: bthakur

pip install matplotlib-venn
'''

import codecs
import inspect
import traceback
import random
import numpy as np
import sympy as sp
import pandas as pd
from sympy import (latex, Symbol, symbols,
                   Matrix,
                    Rational,
                    sin, cos, tan,
                    asin, acos, atan,
                    sinh, cosh, tanh,
                    log, exp, sqrt,
                   diff, factor, 
                   Function, Eq,
                   Add, 
                   simplify, solve, factorial,
                   UnevaluatedExpr as ueval
                   )

from sympy.core.numbers import One, Integer
from sympy.series import series

from xv.km.util import latex_fraction

from xv.util import strip_source_code_tabs, get_function_source_code


from xv.km.ui import SvgHelper
from xv.util.data import CacheUtil

from xv.util import UtilClass, list_to_str

# _set_algebra
# SetAlgebra

class SetAlgebra(UtilClass):
    
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        pass

    def get_set_props(self):
        A, B, C, U, phi = symbols(f"A, B, C, \\mathbb{{U}}, \\emptyset")
        
        
        setA = np.arange(1, 6)
        setB = set(setA * random.choice([2, 3, 5]))
        setC = set(setA * random.choice([4, 6, 10]))
        setA = set(setA)
        
        AplusB = setA.union(setB)
        AB = setA.intersection(setB)
        
        
        result = {
            'A': A,
            'B': B,
            'C': C,
            'U': U,
            'phi': phi,
            'setA': setA,
            'setB': setB,
            'setC': setC,

            }
        
        return result
        pass    
        
    pass 
#class SetAlgebra:
