Skip to content

Commit

Permalink
Add 'largest_required_point'
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisJefferson committed Jun 17, 2021
1 parent b8c4e6b commit c05cc47
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 2 deletions.
4 changes: 4 additions & 0 deletions gap/BacktrackKit.gi
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ end;
InitialiseConstraints := function(state, tracer, rbase)
local c, filters;
for c in state!.conlist do
if c!.largest_required_point > PS_Points(state!.ps) then
ErrorNoReturn(StringFormatted("Refiner {} requires {} points, but the partition only has {}",
c!.name, c!.largest_required_point, PS_Points(state!.ps)));
fi;
if IsBound(c!.refine.initialise) then
filters := c!.refine.initialise(state!.ps, rbase);
if not ApplyFilters(state, tracer, filters) then
Expand Down
8 changes: 8 additions & 0 deletions gap/constraint.gd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
#!
#! * A member called <C>name</C>, which is a string giving the name of the
#! constraint;
#! * A member called <C>largest_required_point</C>, which is an integer
#! which gives the smallest size partition this refiner will work on.
#! For example, given a set we would expect this to be the largest element
#! of the set.
#! * An optional member called <C>largest_moved_point</C>, which is an integer
#! giving an upper bound on the largest point this refiner could ever move.
#! For many refiners this will not exist -- for example a 'set stabilizer'
#! refiner will always permute values outside the set.
#! * A member called <C>refine</C>, which is a record; more information is
#! given below.
#!
Expand Down
2 changes: 2 additions & 0 deletions gap/constraints/canonicalconstraints.g
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ BTKit_Con.InCosetSimple := function(n, group, perm)

r := rec(
name := "InGroupSimple",
largest_required_point := Maximum(LargestMovedPoint(group), LargestMovedPoint(perm)),
largest_moved_point := Maximum(LargestMovedPoint(group), LargestMovedPoint(perm)),
image := {p} -> RightCoset(group, p),
result := {} -> RightCoset(group, perm),
check := {p} -> p in RightCoset(group, perm),
Expand Down
3 changes: 3 additions & 0 deletions gap/constraints/conjugacyexample.g
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
BTKit_Con.MostBasicPermConjugacy := function(permL, permR)
return Objectify(BTKitRefinerType,rec(
name := "MostBasicPermConjugacy",
largest_required_point := Maximum(LargestMovedPoint(permL),LargestMovedPoint(permR)),
image := {p} -> permL^p,
result := {} -> permR,
refine := rec(
Expand Down Expand Up @@ -32,6 +33,7 @@ BTKit_Con.BasicPermConjugacy := function(permL, permR)

return Objectify(BTKitRefinerType,rec(
name := "BasicPermConjugacy",
largest_required_point := Maximum(LargestMovedPoint(permL),LargestMovedPoint(permR)),
image := {p} -> permL^p,
result := {} -> permR,
refine := rec(
Expand Down Expand Up @@ -85,6 +87,7 @@ BTKit_Con.PermTransporter := function(n, fixedeltL, fixedeltR)


r := rec( name := "PermTransporter",
largest_required_point := Maximum(LargestMovedPoint(fixedeltL),LargestMovedPoint(fixedeltR)),
image := {p} -> fixedeltL^p,
result := {} -> fixedeltR,
refine := rec( initialise := function(ps, buildingRBase)
Expand Down
1 change: 1 addition & 0 deletions gap/constraints/graphconstraints.g
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ BTKit_Con.GraphTrans := function(graphL, graphR)
end;
return Objectify(BTKitRefinerType, rec(
name := "GraphTrans",
largest_required_point := Maximum(Maximum(DigraphVertices(graphL), Maximum(DigraphVertices(graphR)))),
image := {p} -> OnDigraphs(graphL, p),
result := {} -> graphR,
refine := rec(
Expand Down
3 changes: 3 additions & 0 deletions gap/constraints/normaliserexample.g
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
BTKit_Con.MostBasicGroupConjugacy := function(grpL, grpR)
return Objectify(BTKitRefinerType,rec(
name := "MostBasicGroupPermConjugacy",
largest_required_point := Maximum(LargestMovedPoint(grpL), LargestMovedPoint(grpR)),
image := {p} -> grpL^p,
result := {} -> grpR,
refine := rec(
Expand Down Expand Up @@ -36,6 +37,7 @@ BTKit_Con.BasicGroupConjugacy := function(grpL, grpR)

return Objectify(BTKitRefinerType,rec(
name := "BasicGroupConjugacy",
largest_required_point := Maximum(LargestMovedPoint(grpL), LargestMovedPoint(grpR)),
image := {p} -> grpL^p,
result := {} -> grpR,
refine := rec(
Expand Down Expand Up @@ -67,6 +69,7 @@ BTKit_Con.SimpleGroupConjugacy := function(grpL, grpR)

return Objectify(BTKitRefinerType,rec(
name := "BasicGroupConjugacy",
largest_required_point := Maximum(LargestMovedPoint(grpL), LargestMovedPoint(grpR)),
image := {p} -> grpL^p,
result := {} -> grpR,
refine := rec(
Expand Down
11 changes: 10 additions & 1 deletion gap/constraints/simpleconstraints.g
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ BTKit_MakeFixlistStabilizer := function(name, fixlist, o, action)
filters := {i} -> fixlist[i];
return Objectify(BTKitRefinerType, rec(
name := name,
largest_required_point := Length(o),
image := {p} -> action(o,p),
result := {} -> o,
refine := rec(
Expand All @@ -37,6 +38,7 @@ BTKit_MakeFixlistTransporter := function(name, fixlistL, fixlistR, oL, oR, actio
filtersR := {i} -> fixlistR[i];
return Objectify(BTKitRefinerType, rec(
name := name,
largest_required_point := Length(oL),
image := {p} -> action(oL,p),
result := {} -> oR,
refine := rec(
Expand Down Expand Up @@ -176,6 +178,8 @@ BTKit_Con.InCoset := function(n, group, perm)

r := rec(
name := "InCoset",
largest_required_point := Maximum(LargestMovedPoint(group), LargestMovedPoint(perm)),
largest_moved_point := Maximum(LargestMovedPoint(group), LargestMovedPoint(perm)),
image := {p} -> RightCoset(group, p),
result := {} -> RightCoset(group, perm),
check := {p} -> p in RightCoset(group, perm),
Expand Down Expand Up @@ -292,7 +296,8 @@ BTKit_Con.InCosetWithOrbitals := function(n, group, perm)

r := rec(
name := "InGroupWithCoset-BTKit",

largest_required_point := Maximum(LargestMovedPoint(group), LargestMovedPoint(perm)),
largest_moved_point := Maximum(LargestMovedPoint(group), LargestMovedPoint(perm)),
image := {p} -> RightCoset(group, p),
result := {} -> RightCoset(group, perm),
check := {p} -> p in RightCoset(group, perm),
Expand Down Expand Up @@ -357,6 +362,8 @@ BTKit_Con.InGroupWithOrbitals := {n, group} -> BTKit_Con.InCosetWithOrbitals(n,

BTKit_Con.Nothing := {} -> Objectify(BTKitRefinerType, rec(
name := "Nothing",
largest_required_point := 1,
largest_moved_point := 1,
image := {p} -> true,
result := {} -> false,
refine := rec(
Expand All @@ -368,6 +375,8 @@ BTKit_Con.Nothing := {} -> Objectify(BTKitRefinerType, rec(

BTKit_Con.Nothing2 := {} -> Objectify(BTKitRefinerType, rec(
name := "Nothing2",
largest_required_point := 1,
largest_moved_point := 1,
image := {p} -> true,
result := {} -> false,
refine := rec(
Expand Down
2 changes: 1 addition & 1 deletion tst/basic.tst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ gap> G := BTKit_SimpleSearch(ps3, [BTKit_Con.InGroup(3, SymmetricGroup(3))]);;
gap> G = SymmetricGroup(3);
true
gap> G := BTKit_SimpleSearch(ps3, [BTKit_Con.InGroup(3, Group((1,2)(3,4)))]);
Group(())
Error, Refiner InCoset requires 4 points, but the partition only has 3
gap> G := BTKit_SimpleSearch(ps6, [BTKit_Con.InGroup(6, AlternatingGroup(6)),
> BTKit_Con.SetStab(6, [2,4,6]),
> BTKit_Con.TupleStab(6, [1,2])]);;
Expand Down

0 comments on commit c05cc47

Please sign in to comment.