Newer
Older
# Load into GAP using Read("gaptypes.g"); and export using
# GAPTypesToJson("gap_types.json");
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
LoadPackage("json");
GAPFilterToFilterType := function(fid)
if INFO_FILTERS[fid] in FNUM_CATS then
return "GAP_Category";
elif INFO_FILTERS[fid] in FNUM_REPS then
return "GAP_Representation";
elif INFO_FILTERS[fid] in FNUM_ATTS then
return "GAP_Attribute";
elif INFO_FILTERS[fid] in FNUM_PROS then
return "GAP_Property";
elif INFO_FILTERS[fid] in FNUM_TPRS then
return "GAP_Tester";
else
return "GAP_Filter";
fi;
end;
# Make GAP Type graph as a record
GAPTypesInfo := function()
local res, lres, i, ff;
res := rec();
for i in [1..Length(FILTERS)] do
if IsBound(FILTERS[i]) then
lres := rec();
lres.type := GAPFilterToFilterType(i);
ff := TRUES_FLAGS(WITH_IMPS_FLAGS(FLAGS_FILTER(FILTERS[i])));
lres.implied := List(ff,
function(f)
if IsBound(FILTERS[f]) then
return NAME_FUNC(FILTERS[f]);
else
return "<<unknown>>";
fi;
end);
res.(NAME_FUNC(FILTERS[i])) := lres;
fi;
od;
return res;
end;
# Write the graph of type info to JSon file
PrintTo(file, GapToJsonString(GAPTypesInfo()));
end;