Skip to content

Commit

Permalink
Merge pull request #380 from EvgSkv/ti2023
Browse files Browse the repository at this point in the history
Fix missing typing of empty lists.
  • Loading branch information
EvgSkv authored Sep 27, 2024
2 parents 7df85d7 + b45ad2d commit 6198f0f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion logica.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=' '))
Expand Down
3 changes: 3 additions & 0 deletions type_inference/research/infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6198f0f

Please sign in to comment.