From cec7796e7c5851c6997195d2a18876f41c6c8fd7 Mon Sep 17 00:00:00 2001 From: Markus Pfeiffer <markus.pfeiffer@morphism.de> Date: Wed, 27 Jan 2016 13:49:17 +0000 Subject: [PATCH] Output attributes as well --- gap/gaptypes.g | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/gap/gaptypes.g b/gap/gaptypes.g index 283a805..a07c60f 100644 --- a/gap/gaptypes.g +++ b/gap/gaptypes.g @@ -15,23 +15,50 @@ GAPFilterToFilterType := function(fid) elif INFO_FILTERS[fid] in FNUM_PROS then return "GAP_Property"; elif INFO_FILTERS[fid] in FNUM_TPRS then - return "GAP_Tester"; + return "GAP_TrueProperty"; else return "GAP_Filter"; fi; end; +GAPAndFilterUnpack := function(t) + local res; + + res := []; + + if IsOperation(t) then + if (IsInt(FLAG1_FILTER(t)) and IsInt(FLAG2_FILTER(t))) + then + Add(res, NAME_FUNC(t)); + else + Append(res, GAPTypeUnpack(FLAG1_FILTER(t))); + Append(res, GAPTypeUnpack(FLAG2_FILTER(t))); + fi; + fi; + return res; +end; + + # Make GAP Type graph as a record GAPTypesInfo := function() - local res, lres, i, ff; + local res, lres, i, f, ff; res := rec(); for i in [1..Length(FILTERS)] do if IsBound(FILTERS[i]) then lres := rec(); + f := FILTERS[i]; lres.type := GAPFilterToFilterType(i); + # if the filter is an attribute and FLAG1_FILTER of the filter + # is not equal to it, then this is a tester. + if lres.type = "GAP_Attribute" then + if + (FLAG1_FILTER(f)) <> 0 and (FLAG1_FILTER(f) <> i) then + lres.testerfor := NAME_FUNC(FILTERS[FLAG1_FILTER(f)]); + fi; + fi; ff := TRUES_FLAGS(WITH_IMPS_FLAGS(FLAGS_FILTER(FILTERS[i]))); lres.implied := List(ff, @@ -45,7 +72,13 @@ GAPTypesInfo := function() res.(NAME_FUNC(FILTERS[i])) := lres; fi; od; + for i in [1..Length(ATTRIBUTES)] do + lres := rec(); + lres.type := "GAP_Attribute"; + lres.filters := GAPAndFilterUnpack(ATTRIBUTES[i][2]); + res.(ATTRIBUTES[i][1]) := lres; + od; return res; end; -- GitLab