Logic
SymmetryGroup
find symmetries in a logical expression
Calling Sequence
Parameters
Options
Description
Definitions
Examples
References
Compatibility
SymmetryGroup(expr, opts)
expr
-
Boolean expression in conjunctive normal form
opts
(optional) zero or more options as specified below
output=list or one of expressions or group
a list of one or more of the symbols expressions or group, or one of the symbols expressions or group.
The symbol group corresponds to the symmetry group for expr. The group is a permutation group; its elements are those permutations which preserve the Boolean structure of expr. If there are no nontrivial symmetries the group will be the trivial group.
The symbol expressions is the list of subexpressions of expr on which the permutations act.
The SymmetryGroup command computes the group of symmetries of a given Boolean expression expr.
The result is a Group object and can be examined using the tools in the GroupTheory package.
The expression expr must be in conjunctive normal form (CNF). If not already in CNF, expr can be converted to CNF using Normalize; alternatively, Tseitin may be used to find an equisatifiable expression in CNF.
A symmetry of a Boolean expression expr is a mapping f of each variable to some other variable or negated variable, such that the image of expr after applying f to each of its variables is a Boolean formula which is equivalent to expr.
Find symmetries for a simple Boolean expression.
with⁡Logic:
expr≔aorbornotcandcordornote
G≔SymmetryGroup⁡expr
G≔1,102,43,85,67,911,12,1,26,7,4,105,9
We can see that the symmetry group is non-Abelian and is isomorphic to SmallGroup(8,3).
GroupTheory:-IsAbelian⁡G
false
GroupTheory:-IdentifySmallGroup⁡G
8,3
By invoking SymmetryGroup with the output option we can obtain the list L of subexpressions.
G,L≔SymmetryGroup⁡expr,output=group,expressions
G,L≔1,102,43,85,67,911,12,1,26,7,4,105,9,a,b,c,d,e,¬a,¬b,¬c,¬d,¬e,a∨b∨¬c,c∨d∨¬e
We can apply one of the generators of G to L to see an example of a symmetry in action. In this example, a is swapped with not e, b is swapped with d, and c is swapped with its negation.
gen≔Perm⁡1,10,2,4,3,8,5,6,7,9,11,12
gen≔1,102,43,85,67,911,12
GroupTheory:-ElementOrder⁡gen,G
2
zip⁡`=`,L,Lconvert⁡gen,permlist,nops⁡L
a=¬e,b=d,c=¬c,d=b,e=¬a,¬a=e,¬b=¬d,¬c=c,¬d=¬b,¬e=a,a∨b∨¬c=c∨d∨¬e,c∨d∨¬e=a∨b∨¬c
Find symmetries and expressions for another simple Boolean expression.
expr≔xoryorzandnotxornotyornotzandnotxornotyornotz
expr≔xoryorzandnotxandyandzandnotxandyandz
G,L≔2,35,6,8,9,1,24,5,x,y,z,¬x,¬y,¬z,x∨y∨z,¬x∨¬y∨¬z,¬x∨¬y∨¬z
GroupTheory:-GroupOrder⁡G
12
Attempt to compute symmetries on an expression which is not in conjunctive normal form (CNF).
expr≔aandnotbornotcordanddoraandnotaandc
SymmetryGroup⁡expr
Error, (in Logic:-SymmetryGroup) not in conjunctive normal form
Convert to CNF using Normalize. Note this may be costly for large expressions.
expr_cnf≔Normalize⁡expr,form=CNF
expr_cnf≔a∨d∧¬a∨¬c∧a∨d∨¬c∧d∨¬b∨¬c
Observe that the expression has no nontrivial symmetries.
G≔SymmetryGroup⁡expr_cnf
G≔
1
Fadi A. Aloul, Arathi Ramani, Igor L. Markov, Karem A. Sakallah. "Solving difficult instances of Boolean satisfiability in the presence of symmetry." IEEE Trans. CAD Integr. Circ. Syst. 22(9), 1117–1137 (2003). doi:10.1109/TCAD.2003.816218
The Logic[SymmetryGroup] command was introduced in Maple 2020.
For more information on Maple 2020 changes, see Updates in Maple 2020.
See Also
GraphTheory[AutomorphismGroup]
GroupTheory
Download Help Document