diff --git a/logica.py b/logica.py index d1be7cc..2954339 100755 --- a/logica.py +++ b/logica.py @@ -187,7 +187,11 @@ def main(argv): return 0 if command == 'infer_types': - typing_engine = infer.TypesInferenceEngine(parsed_rules) + # This disallows getting types of program with type errors. + # logic_program = universe.LogicaProgram(parsed_rules) + # TODO: Find a way to get engine from program. But it should not matter + # for inference. It only patters for compiling. + typing_engine = infer.TypesInferenceEngine(parsed_rules, "psql") typing_engine.InferTypes() # print(parsed_rules) print(json.dumps(parsed_rules, sort_keys=True, indent=' ')) diff --git a/type_inference/research/infer.py b/type_inference/research/infer.py index 10566ef..47579fd 100644 --- a/type_inference/research/infer.py +++ b/type_inference/research/infer.py @@ -426,6 +426,9 @@ def ActMindingListLiterals(self, node): for e in node['literal']['the_list']['element']: reference_algebra.UnifyListElement( list_type, e['type']['the_type']) + else: + reference_algebra.UnifyListElement( + list_type, reference_algebra.TypeReference('Any')) def ActMindingInclusion(self, node): if 'inclusion' in node: