Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/recog/examples/   (GAP Algebra Version 4.15.1©)  Datei vom 22.0.2025 mit Größe 1 kB image not shown  

Quelle  cyclic2.gi   Sprache: Shell

 

############################################################################
# Just an example, recognise a cyclic group of order 2:
############################################################################

FindHomMethodsPerm.Cyclic2 :=
   function(ri, H)
     local gens,i;
     # Test applicability (this would no longer be necessary, because we
     # are called only for permutation groups anyway. However, this is an
     # example.
     if not IsPermGroup(H) then
         return NeverApplicable;
     fi;
     # Now we work:
     if Size(H) = 2 then
         # First find the first nontrivial generator:
         gens := GeneratorsOfGroup(H);
         i := 1;
         while IsOne(gens[i]) do
             i := i + 1;
         od;
         ri!.firstnontrivialgen := i;
         SetNiceGens(ri,[GeneratorsOfGroup(H)[i]]);
         Setslptonice(StraightLineProgramNC([[[i,1]]],Length(gens)));
         Setslpforelement(ri,SLPforElementFuncsPerm.Cyclic2);
         SetFilterObj(ri,IsLeaf);
         SetIsRecogInfoForSimpleGroup(ri,true);
         return Success;     # this indicates success
     else
         return NeverApplicable;    # do not call us again
     fi;
   end;

SLPforElementFuncsPerm.Cyclic2 :=
   function(ri, g)
     if IsOne(g) then
         return StraightLineProgram([[1, 0]], 1);
     else
         return StraightLineProgram([[1, 1]], 1);
     fi;
   end;

# The following would install this method with a very low rank if we would
# like to:
#
# AddMethod(FindHomDbPerm,
#           rec(method := FindHomMethodsPerm.Cyclic2,
#               rank := 1,
#               stamp := "Cyclic2",
#               comment := "find a Cyclic2"));

Messung
CHZG
929910096

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet am  2026-11-04) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover


Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.