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)) ]
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 = ''
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
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 = ''
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 = ''
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 = ''
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 = ''
def validate(self): return forall(self.types,lambda x: isinstance(x,Type))
def validate(self): return forall(self.comps.types, lambda T: isinstance(T,Type))
def CheckPathList(Paths, RecT): return forall(Paths, lambda x: CheckPath(x,RecT))
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
def validate(self): return forall(self.comps.types, lambda T: isinstance(T, Type))
def CheckPathList(Paths, RecT): return forall(Paths, lambda x: CheckPath(x, RecT))
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
def validate(self): return forall(self.types, lambda x: isinstance(x, Type))