def from_json(cls, json_item): context = list(map(Binding.from_json, json_item['context'])) # FIXME that is weird! if json_item['arity']['type'] == "template": arity = Term.from_json(json_item['arity']['arity']) else: arity = Term.from_json(json_item['arity']['arity']) ind = cls( json_item['name'], context, arity, list( map(MutInductive.Constructor.from_json, json_item['constructors']))) ind.raw_arity = Term.from_json(json_item['arity']['arity']) return ind
def from_json(cls, json_item): return RenderCommand( None if 'term' not in json_item else Term.from_json( json_item['term']), json_item['path'])
def from_json(cls, json_item): return cls(json_item['name'], Term.from_json(json_item['type']))
def from_json(cls, json_item): return Variable(json_item['name'], Term.from_json(json_item['type']))
def from_json(cls, json_item): return Constant(json_item['name'], Term.from_json(json_item['type']), None if 'body' not in json_item else json_item['body'], json_item['is_builtin'])
def body(self): if self.json_body is None: return None return Term.from_json(self.json_body)