diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2016-09-27 16:14:00 +0200 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2016-09-27 16:14:00 +0200 |
commit | 28116fd8278bb3b8832f4f5b22c68bd7978c8efd (patch) | |
tree | 48c134e70d3e1d3502e1465c92ed80ba7a3315bb /server | |
parent | b88aac8b26de977f17e27645fd3d0412a6420f53 (diff) |
Incorporate some tweaks to the monkey methods
Diffstat (limited to 'server')
-rw-r--r-- | server/prolog_session.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/prolog_session.py b/server/prolog_session.py index 6cf6651..6cb1592 100644 --- a/server/prolog_session.py +++ b/server/prolog_session.py @@ -171,8 +171,12 @@ class PrologSession(server.LanguageSession): def _aux_code(self, user_id, problem, program): problem_module = load_problem(problem.language, problem.group, problem.identifier, 'common') used_predicate_identifiers = {make_identifier(name) for name in used_predicates(program)} + # FIXME this currently loads *all* solved predicates, since monkey.fix can + # add goals that require other predicates, which causes the modified + # program to fail if the predicate is not loaded (because it did not appear + # in the initial program). dependencies = {p for p in CodeqUser.solved_problems(user_id, problem.language) - if p[1] != problem.identifier and p[1] in used_predicate_identifiers} + if p[1] != problem.identifier} # TODO and p[1] in used_predicate_identifiers} return ('\n' + solutions_for_problems(problem.language, dependencies) + '\n' + get_facts(problem.language, problem_module)) |