From 4a8d83df6b102112da614f677f5e0e215fd023b3 Mon Sep 17 00:00:00 2001 From: Wilf Wilson Date: Wed, 9 Jun 2021 18:34:18 +0100 Subject: [PATCH] =?UTF-8?q?prop.gd:=20add=20"condition=20true=20=E2=86=92?= =?UTF-8?q?=20property=20false"=20implications?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gap/prop.gd | 37 +++++++++++++++++++++++++++++++++++++ gap/prop.gi | 4 ---- tst/standard/prop.tst | 4 ++-- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/gap/prop.gd b/gap/prop.gd index c4584fdc0..b314b5451 100644 --- a/gap/prop.gd +++ b/gap/prop.gd @@ -109,3 +109,40 @@ InstallTrueMethod(DigraphHasEdges, IsDigraph and DigraphHasLoops); InstallTrueMethod(DigraphHasLoops, IsReflexiveDigraph and DigraphHasVertices); InstallTrueMethod(DigraphHasVertices, IsDigraph and DigraphHasEdges); InstallTrueMethod(DigraphHasVertices, IsDigraph and IsDirectedTree); + +# Implications that something is false +InstallTrueMethod(HasDigraphHasLoops, IsAcyclicDigraph); +InstallTrueMethod(HasDigraphHasLoops, IsTournament); +InstallTrueMethod(HasDigraphHasLoops, IsUndirectedForest); +InstallTrueMethod(HasDigraphHasLoops, IsDirectedTree); +InstallTrueMethod(HasDigraphHasLoops, IsEmptyDigraph); +InstallTrueMethod(HasDigraphHasLoops, IsCompleteDigraph and DigraphHasEdges); +InstallTrueMethod(HasDigraphHasLoops, IsBipartiteDigraph); + +InstallTrueMethod(HasDigraphHasEdges, IsEmptyDigraph); + +InstallTrueMethod(HasIsAcyclicDigraph, IsCompleteDigraph and DigraphHasEdges); +InstallTrueMethod(HasIsAcyclicDigraph, IsDigraph and DigraphHasLoops); +InstallTrueMethod(HasIsAcyclicDigraph, + IsStronglyConnectedDigraph and DigraphHasEdges); +InstallTrueMethod(HasIsAntisymmetricDigraph, + IsCompleteDigraph and DigraphHasEdges); +InstallTrueMethod(HasIsChainDigraph, IsDigraph and DigraphHasLoops); +InstallTrueMethod(HasIsChainDigraph, IsSymmetricDigraph and DigraphHasEdges); +InstallTrueMethod(HasIsCompleteDigraph, IsDigraph and DigraphHasLoops); +InstallTrueMethod(HasIsEmptyDigraph, IsDigraph and DigraphHasEdges); +InstallTrueMethod(HasIsReflexiveDigraph, + IsAcyclicDigraph and DigraphHasVertices); + +InstallTrueMethod(HasIsSymmetricDigraph, IsAcyclicDigraph and DigraphHasEdges); +InstallTrueMethod(HasIsSymmetricDigraph, IsDirectedTree and DigraphHasEdges); +InstallTrueMethod(HasIsSymmetricDigraph, IsTournament and DigraphHasEdges); + +InstallTrueMethod(HasIsMultiDigraph, IsChainDigraph); +InstallTrueMethod(HasIsMultiDigraph, IsCompleteDigraph); +InstallTrueMethod(HasIsMultiDigraph, IsCompleteMultipartiteDigraph); +InstallTrueMethod(HasIsMultiDigraph, IsCycleDigraph); +InstallTrueMethod(HasIsMultiDigraph, IsEmptyDigraph); +InstallTrueMethod(HasIsMultiDigraph, IsFunctionalDigraph); +InstallTrueMethod(HasIsMultiDigraph, IsTournament); +InstallTrueMethod(HasIsMultiDigraph, IsUndirectedForest); diff --git a/gap/prop.gi b/gap/prop.gi index ea3ef29a2..c23a14178 100644 --- a/gap/prop.gi +++ b/gap/prop.gi @@ -189,10 +189,6 @@ function(D) return DigraphNrConnectedComponents(D) = 1; end); -InstallImmediateMethod(IsAcyclicDigraph, "for a reflexive digraph", -IsReflexiveDigraph, 0, -D -> DigraphNrVertices(D) = 0); - InstallImmediateMethod(IsAcyclicDigraph, "for a strongly connected digraph", IsStronglyConnectedDigraph, 0, D -> DigraphNrVertices(D) <= 1 and IsEmptyDigraph(D)); diff --git a/tst/standard/prop.tst b/tst/standard/prop.tst index 8cdca9acf..d76801177 100644 --- a/tst/standard/prop.tst +++ b/tst/standard/prop.tst @@ -1,7 +1,7 @@ ############################################################################# ## #W standard/prop.tst -#Y Copyright (C) 2014-17 James D. Mitchell +#Y Copyright (C) 2014-21 James D. Mitchell ## Wilf A. Wilson ## ## Licensing information can be found in the README file of this package. @@ -139,7 +139,7 @@ gap> gr := Digraph([[1]]);; gap> DigraphHasLoops(gr); true gap> HasIsAcyclicDigraph(gr); -false +true gap> IsAcyclicDigraph(gr); false gap> gr := Digraph([[2], []]);