Skip to content

Commit

Permalink
Update search to use the constraint object of a refiner
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfwilson committed Dec 3, 2021
1 parent efe9b66 commit bf8fa18
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
11 changes: 1 addition & 10 deletions gap/BacktrackKit.gi
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,7 @@ BTKit_GetCandidateSolution := function(ps, rbase)
end;


BTKit_CheckPermutation := function(perm, con)
local check;
if IsBound(con!.check) then
check := con!.check(perm);
Assert(2, check = (con!.result() = con!.image(perm)));
else
return con!.result() = con!.image(perm);
fi;
return check;
end;
BTKit_CheckPermutation := {perm, con} -> Check(con!.constraint)(perm);

BTKit_CheckSolution := function(perm, conlist)
local check;
Expand Down
2 changes: 1 addition & 1 deletion gap/canonical.gi
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ BTKit_GetCandidateCanonicalSolution := function(state, group)
Assert(2, group = false or perm in group);

Info(InfoBTKit, 2, "Considering mapping: ", preimage, postimage, perm);
return rec(perm := perm, image := List(state!.conlist, {x} -> x!.image(perm)));
return rec(perm := perm, image := List(state!.conlist, {x} -> ImageFunc(x!.constraint)(perm)));
# TODO: Huh? I don't get why we are taking the image w.r.t. the GROUP!
end;

Expand Down
4 changes: 2 additions & 2 deletions gap/constraints/tree/tree.g
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# name := Concatenation("List(", List(conlist, {c} -> c.name), ")");
# r := rec(
# name := name,
# check := {p} -> ForAll(conlist, {c} -> c!.check(p)),
# check := {p} -> ForAll(conlist, {c} -> Check(c!.constraint)(p)),
# refine := rec(
# initialise := function(ps, rbase)
# local refines, gather;
Expand All @@ -33,7 +33,7 @@
# name := Concatenation("Set(", List(conlist, {c} -> c.name), ")");
# r := rec(
# name := name,
# check := {p} -> ForAll(conlist, {c} -> c!.check(p)),
# check := {p} -> ForAll(conlist, {c} -> Check(c!.constraint)(p)),
# refine := rec(
# initialise := function(ps, rbase)
# local refines, gather;
Expand Down

0 comments on commit bf8fa18

Please sign in to comment.