Skip to content

Commit

Permalink
Add some extra debug logging when transforming.
Browse files Browse the repository at this point in the history
  • Loading branch information
namcsi committed Sep 6, 2023
1 parent 489e364 commit 83dd2bd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/renopro/rast.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,17 +979,20 @@ def transform(
for meta_file in meta_files:
with meta_file.open() as f:
meta_prog += f.read()
logger.debug("Applying transformation defined in following meta-encoding:\n%s", meta_prog)
clingo_logger = get_clingo_logger_callback(logger)
clingo_options = [] if clingo_options is None else clingo_options
ctl = Control(clingo_options, logger=clingo_logger)
logger.debug(
"Reified facts before applying transformation:\n%s", self.reified_string
)
control_add_facts(ctl, self._reified)
ctl.add(meta_prog)
ctl.load("./src/renopro/asp/transform.lp")
ctl.ground()
with ctl.solve(yield_=True) as handle: # type: ignore
model_iterator = iter(handle)
model = next(model_iterator)
logger.debug("Stable model after applying transformation:\n%s", model)
ast_symbols = [final.arguments[0] for final in model.symbols(shown=True)]
unifier = Unifier(preds.AstPredicates)
with TryUnify():
Expand All @@ -1006,6 +1009,9 @@ def transform(
"ignoring additional ones."
)
)
logger.debug(
"Reified facts after applying transformation:\n%s", self.reified_string
)


if __name__ == "__main__": # nocoverage
Expand Down

0 comments on commit 83dd2bd

Please sign in to comment.