diff options
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)) |