Esempio n. 1
0
 def __init__(self, T):
     self.comps = Rec({'base_type': T})
     self.witness_cache = []
     self.supertype_cache = []
     self.witness_conditions = [
         lambda l: isinstance(l, list) and forall(l, lambda x: T.query(x))
     ]
Esempio n. 2
0
 def __init__(self,T):
     self.comps = Rec({'base_type':T})
     self.witness_cache = []
     self.supertype_cache = []
     self.witness_conditions = [lambda l: isinstance(l,list) and forall(l, lambda x: T.in_poss(self.poss).query(x))]
     self.witness_types = []
     self.poss = ''
Esempio n. 3
0
def RecOfRecType(r,T,M):
    TypeLabels = [l for l in T.comps.__dict__]
    RecordLabels = [l for l in r.__dict__]
    if forsome(TypeLabels, lambda l: l not in RecordLabels):
        return False
    elif forall(TypeLabels, lambda l: l in RecordLabels and QueryField(l,r,T,M)):
        return True
    else:
        return False
Esempio n. 4
0
def RecOfRecType(r,T,M):
    TypeLabels = [l for l in T.comps.__dict__]
    RecordLabels = [l for l in r.__dict__]
    if forsome(TypeLabels, lambda l: l not in RecordLabels):
        return False
    elif forall(TypeLabels, lambda l: l in RecordLabels and QueryField(l,r,T,M)):
        return True
    else:
        return False
Esempio n. 5
0
 def __init__(self, T):
     self.comps = Rec({'base_type': T})
     self.witness_cache = []
     self.supertype_cache = []
     self.witness_conditions = \
       [lambda s: isinstance(s,TTRString) \
        and len(s.items)>0 \
        and forall(s.items,
                   lambda a: self.comps.base_type.in_poss(self.poss).query(a))]
     self.poss = ''
Esempio n. 6
0
 def __init__(self, list):
     self.comps = Rec({'types': list})
     self.witness_cache = []
     self.supertype_cache = []
     self.witness_conditions = \
       [lambda s: isinstance(s,TTRString) \
        and len(s.items) == len(self.comps.types) \
        and forall([x for x in range(len(self.comps.types))], \
                   lambda i: self.comps.types[i].in_poss(self.poss).query(s.items[i]))]
     self.poss = ''
Esempio n. 7
0
 def __init__(self,T):
     self.comps = Rec({'base_type' : T})
     self.witness_cache = []
     self.supertype_cache = []
     self.witness_conditions = \
       [lambda s: isinstance(s,TTRString) \
        and len(s.items)>0 \
        and forall(s.items,
                   lambda a: self.comps.base_type.in_poss(self.poss).query(a))]
     self.witness_types = []
     self.poss = ''
Esempio n. 8
0
 def __init__(self,list_of_types):
     self.comps = Rec({'types' : list_of_types})
     self.witness_cache = []
     self.supertype_cache = []
     self.witness_conditions = \
       [lambda s: isinstance(s,TTRString) \
        and len(s.items) == len(self.comps.types) \
        and forall([x for x in range(len(self.comps.types))], \
                   lambda i: self.comps.types[i].in_poss(self.poss).query(s.items[i]))]
     self.witness_types = []
     self.poss = ''
Esempio n. 9
0
 def validate(self):
     return forall(self.types,lambda x: isinstance(x,Type))
Esempio n. 10
0
 def validate(self):
     return forall(self.comps.types, lambda T: isinstance(T,Type))
Esempio n. 11
0
def CheckPathList(Paths, RecT):
    return forall(Paths, lambda x: CheckPath(x,RecT))
Esempio n. 12
0
 def validate(self):
     if forall(list(self.comps.__dict__.items()),lambda x: CheckField(x,self)) and not self.create_hypobj() == None:
         return True
     else:
         return False
Esempio n. 13
0
 def validate(self):
     return forall(self.comps.types, lambda T: isinstance(T, Type))
Esempio n. 14
0
def CheckPathList(Paths, RecT):
    return forall(Paths, lambda x: CheckPath(x, RecT))
Esempio n. 15
0
 def validate(self):
     if forall(list(self.comps.__dict__.items()), lambda x: CheckField(
             x, self)) and not self.create_hypobj() == None:
         return True
     else:
         return False
Esempio n. 16
0
 def validate(self):
     return forall(self.types, lambda x: isinstance(x, Type))