summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorMartin Možina <martin.mozina@fri.uni-lj.si>2016-09-27 16:36:15 +0200
committerMartin Možina <martin.mozina@fri.uni-lj.si>2016-09-27 16:36:15 +0200
commit3f7538d784b24aa5305a228491efa4b68537a80f (patch)
treeabbe0968308d48857570f74718d839f003fc402b /server
parent2013b5b59f2400ac3d4bf218a7ec5b1174f812d7 (diff)
parent28116fd8278bb3b8832f4f5b22c68bd7978c8efd (diff)
Merge branch 'master' of ssh://212.235.189.51:22122/codeq-server
Diffstat (limited to 'server')
-rw-r--r--server/prolog_session.py6
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))