renome some more functions for simplicity

This commit is contained in:
Maximilian Keßler 2022-01-21 13:31:49 +01:00
parent d005bb4b33
commit 7996b7b537
2 changed files with 54 additions and 56 deletions

View file

@ -714,8 +714,8 @@
% { % {
% \groupthm_new_group:nn, % \groupthm_new_group:nn,
% \groupthm_renew_group:nn, % \groupthm_renew_group:nn,
% \groupthm_provide_theorem_group:nn, % \groupthm_provide_group:nn,
% \groupthm_declare_theorem_group:nn % \groupthm_declare_group:nn
% } % }
% \begin{syntax} % \begin{syntax}
% \cs{groupthm_new_group:nn}\marg{keys}\marg{theorem group} % \cs{groupthm_new_group:nn}\marg{keys}\marg{theorem group}
@ -747,9 +747,9 @@
% Non-keyval versions of % Non-keyval versions of
% \cs{groupthm_new_group:nn}, % \cs{groupthm_new_group:nn},
% \cs{groupthm_renew_group:nn}, % \cs{groupthm_renew_group:nn},
% \cs{groupthm_provide_theorem_group:nn} % \cs{groupthm_provide_group:nn}
% and % and
% \cs{groupthm_declare_theorem_group:nn} % \cs{groupthm_declare_group:nn}
% %
% These take the individual values of the keyval keys directly, in the order % These take the individual values of the keyval keys directly, in the order
% indicated by the syntax specification. % indicated by the syntax specification.
@ -757,9 +757,9 @@
% \end{function} % \end{function}
% %
% %
% \begin{function}{\groupthm_declare_theorem_group_rule:nnnn} % \begin{function}{\groupthm_declare_group_rule:nnnn}
% \begin{syntax} % \begin{syntax}
% \cs{groupthm_declare_theorem_group_rule:nnnn}\marg{keyname}\marg{theorem group 1} % \cs{groupthm_declare_group_rule:nnnn}\marg{keyname}\marg{theorem group 1}
% \marg{relation}\marg{theorem group 2} % \marg{relation}\marg{theorem group 2}
% \end{syntax} % \end{syntax}
% %
@ -1147,12 +1147,12 @@
% %
% %
% %
% \begin{variable}{\g_@@_defined_theorem_groups_clist} % \begin{variable}{\g_@@_defined_groups_clist}
% %
% This variable will hold a global list of declared theorem groups % This variable will hold a global list of declared theorem groups
% %
% \begin{macrocode} % \begin{macrocode}
\clist_new:N \g_@@_defined_theorem_groups_clist \clist_new:N \g_@@_defined_groups_clist
% \end{macrocode} % \end{macrocode}
% \end{variable} % \end{variable}
% %
@ -1279,19 +1279,19 @@
% Once there is such a proper mechanism, the author will likely update this to proper % Once there is such a proper mechanism, the author will likely update this to proper
% string sorting. % string sorting.
% %
% \begin{macro}{\@@_add_to_theorem_group_ordering:n} % \begin{macro}{\@@_add_to_group_ordering:n}
% \begin{syntax} % \begin{syntax}
% \cs{@@_add_to_theorem_group_ordering:n}\marg{theorem group} % \cs{@@_add_to_group_ordering:n}\marg{theorem group}
% \end{syntax} % \end{syntax}
% %
% Sets hook relations for this group and all already defined theorem groups. % Sets hook relations for this group and all already defined theorem groups.
% %
% \begin{macrocode} % \begin{macrocode}
\cs_new:Npn \@@_add_to_theorem_group_ordering:n #1 \cs_new:Npn \@@_add_to_group_ordering:n #1
{ {
\@@_hook_gset_rule_foreach:nNnn \@@_hook_gset_rule_foreach:nNnn
{ @@/groupsort } { @@/groupsort }
\g_@@_defined_theorem_groups_clist \g_@@_defined_groups_clist
{ before } { before }
{ #1 } { #1 }
} }
@ -1300,19 +1300,19 @@
% %
% %
% %
% \begin{macro}{\@@_remove_from_theorem_group_ordering:n} % \begin{macro}{\@@_remove_from_group_ordering:n}
% \begin{syntax} % \begin{syntax}
% \cs{@@_remove_from_theorem_group_ordering:n}\marg{theorem group} % \cs{@@_remove_from_group_ordering:n}\marg{theorem group}
% \end{syntax} % \end{syntax}
% %
% Removes all relations of this theorem group with the currently defined theorem groups. % Removes all relations of this theorem group with the currently defined theorem groups.
% %
% \begin{macrocode} % \begin{macrocode}
\cs_new:Npn \@@_remove_from_theorem_group_ordering:n #1 \cs_new:Npn \@@_remove_from_group_ordering:n #1
{ {
\@@_hook_gset_rule_foreach:nNnn \@@_hook_gset_rule_foreach:nNnn
{ @@/groupsort } { @@/groupsort }
\g_@@_defined_theorem_groups_clist \g_@@_defined_groups_clist
{ unrelated } { unrelated }
{ #1 } { #1 }
} }
@ -1343,7 +1343,7 @@
% \end{macro} % \end{macro}
% %
% %
% \begin{macro}{\@@_sort_theorem_group_names:} % \begin{macro}{\@@_sort_group_names:}
% %
% As explained briefly before, we first insert all theorems % As explained briefly before, we first insert all theorems
% into the hook, clear the list, and then use the hook again. % into the hook, clear the list, and then use the hook again.
@ -1352,7 +1352,7 @@
% which is also assumed to hold only defined theorem group names. % which is also assumed to hold only defined theorem group names.
% %
% \begin{macrocode} % \begin{macrocode}
\cs_new:Npn \@@_sort_theorem_group_names: \cs_new:Npn \@@_sort_group_names:
{ {
\hook_gremove_code:nn { @@/groupsort }{*} \hook_gremove_code:nn { @@/groupsort }{*}
\clist_map_function:NN \l_@@_group_clist \@@_add_to_sort_hook:n \clist_map_function:NN \l_@@_group_clist \@@_add_to_sort_hook:n
@ -1413,13 +1413,13 @@
% This ensures the ordering hacks explained before. % This ensures the ordering hacks explained before.
% %
% \begin{macrocode} % \begin{macrocode}
\@@_add_to_theorem_group_ordering:n { #1 } \@@_add_to_group_ordering:n { #1 }
% \end{macrocode} % \end{macrocode}
% %
% Add defined group to corresponding list % Add defined group to corresponding list
% %
% \begin{macrocode} % \begin{macrocode}
\clist_gput_left:Nn \g_@@_defined_theorem_groups_clist { #1 } \clist_gput_left:Nn \g_@@_defined_groups_clist { #1 }
} }
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
@ -1457,7 +1457,7 @@
% Remove theorem group from list of defined theorems % Remove theorem group from list of defined theorems
% %
% \begin{macrocode} % \begin{macrocode}
\clist_gremove_all:Nn \g_@@_defined_theorem_groups_clist { #1 } \clist_gremove_all:Nn \g_@@_defined_groups_clist { #1 }
% \end{macrocode} % \end{macrocode}
% %
% Now, unset all relations with all defined theorem groups in the internal hooks. % Now, unset all relations with all defined theorem groups in the internal hooks.
@ -1465,27 +1465,27 @@
% \begin{macrocode} % \begin{macrocode}
\@@_hook_gset_rule_foreach:nNnn \@@_hook_gset_rule_foreach:nNnn
{ ?? } { ?? }
\g_@@_defined_theorem_groups_clist \g_@@_defined_groups_clist
{ unrelated } { unrelated }
{ #1 } { #1 }
\@@_hook_gset_rule_foreach:nNnn \@@_hook_gset_rule_foreach:nNnn
{ @@/prefix } { @@/prefix }
\g_@@_defined_theorem_groups_clist \g_@@_defined_groups_clist
{ unrelated } { unrelated }
{ #1 } { #1 }
\@@_hook_gset_rule_foreach:nNnn \@@_hook_gset_rule_foreach:nNnn
{ @@/suffix } { @@/suffix }
\g_@@_defined_theorem_groups_clist \g_@@_defined_groups_clist
{ unrelated } { unrelated }
{ #1 } { #1 }
\@@_hook_gset_rule_foreach:nNnn \@@_hook_gset_rule_foreach:nNnn
{ @@/mapname } { @@/mapname }
\g_@@_defined_theorem_groups_clist \g_@@_defined_groups_clist
{ unrelated } { unrelated }
{ #1 } { #1 }
\@@_hook_gset_rule_foreach:nNnn \@@_hook_gset_rule_foreach:nNnn
{ @@/thmtools } { @@/thmtools }
\g_@@_defined_theorem_groups_clist \g_@@_defined_groups_clist
{ unrelated } { unrelated }
{ #1 } { #1 }
% \end{macrocode} % \end{macrocode}
@ -1493,7 +1493,7 @@
% Also clear all sorting relations % Also clear all sorting relations
% %
% \begin{macrocode} % \begin{macrocode}
\@@_remove_from_theorem_group_ordering:n { #1 } \@@_remove_from_group_ordering:n { #1 }
} }
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
@ -1735,8 +1735,6 @@
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
% %
% \end{macro}
%
% %
% Finally, we provide \LaTeX2e wrappers as document commands for these. % Finally, we provide \LaTeX2e wrappers as document commands for these.
% %
@ -1785,9 +1783,9 @@
% We also provide the interface for declaring the precedence rules for theorem groups. % We also provide the interface for declaring the precedence rules for theorem groups.
% %
% %
% \begin{macro}{\groupthm_declare_theorem_group_rule:nnnn} % \begin{macro}{\groupthm_declare_group_rule:nnnn}
% \begin{syntax} % \begin{syntax}
% \cs{groupthm_declare_theorem_group_rule:nnnn}\marg{keyname}\marg{theorem group 1} % \cs{groupthm_declare_group_rule:nnnn}\marg{keyname}\marg{theorem group 1}
% \marg{relation}\marg{theorem group 2} % \marg{relation}\marg{theorem group 2}
% \end{syntax} % \end{syntax}
% %
@ -1797,7 +1795,7 @@
% in case it is not the general hook \enquote{\texttt{??}}. % in case it is not the general hook \enquote{\texttt{??}}.
% %
% \begin{macrocode} % \begin{macrocode}
\cs_new:Npn \groupthm_declare_theorem_group_rule:nnnn #1 #2 #3 #4 \cs_new:Npn \groupthm_declare_group_rule:nnnn #1 #2 #3 #4
{ {
\str_set:Nx \l_tmpa_str { \tl_trim_spaces:n { #3 } } \str_set:Nx \l_tmpa_str { \tl_trim_spaces:n { #3 } }
\str_if_eq:VnT \l_tmpa_str { higher } \str_if_eq:VnT \l_tmpa_str { higher }
@ -1828,7 +1826,7 @@
% \begin{macrocode} % \begin{macrocode}
\NewDocumentCommand { \DeclareTheoremGroupRule } { O{??} m m m } \NewDocumentCommand { \DeclareTheoremGroupRule } { O{??} m m m }
{ {
\groupthm_declare_theorem_group_rule:nnnn {#1} {#2} {#3} {#4} \groupthm_declare_group_rule:nnnn {#1} {#2} {#3} {#4}
} }
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
@ -2456,7 +2454,7 @@
% This sorting is necessary so that for each theorem family and set of groups, % This sorting is necessary so that for each theorem family and set of groups,
% the generated name will be unique: % the generated name will be unique:
% \begin{macrocode} % \begin{macrocode}
\@@_sort_theorem_group_names: \@@_sort_group_names:
% \end{macrocode} % \end{macrocode}
% Now just declare the grouped theorem, passing the corresponding arguments and using % Now just declare the grouped theorem, passing the corresponding arguments and using
% specified \texttt{\#6} as backend. % specified \texttt{\#6} as backend.
@ -2996,7 +2994,7 @@
% environment that has been generated by a \cs{NewGroupedTheoremFamily} command % environment that has been generated by a \cs{NewGroupedTheoremFamily} command
% or similar. % or similar.
% \begin{macrocode} % \begin{macrocode}
\@@_sort_theorem_group_names: \@@_sort_group_names:
\cs_if_exist:cTF { __#1__groups_ \clist_use:Nn \l_@@_group_clist { _ } } \cs_if_exist:cTF { __#1__groups_ \clist_use:Nn \l_@@_group_clist { _ } }
{ {
\begin { __#1__groups_ \clist_use:Nn \l_@@_group_clist { _ } } \begin { __#1__groups_ \clist_use:Nn \l_@@_group_clist { _ } }
@ -3019,7 +3017,7 @@
% \end{macrocode} % \end{macrocode}
% End the corresponding environment. % End the corresponding environment.
% \begin{macrocode} % \begin{macrocode}
\@@_sort_theorem_group_names: \@@_sort_group_names:
\end { __#1__groups_ \clist_use:Nn \l_@@_group_clist { _ } } \end { __#1__groups_ \clist_use:Nn \l_@@_group_clist { _ } }
} }
} }

View file

@ -84,7 +84,7 @@
\clist_new:N \l__groupthm_mapname_clist \clist_new:N \l__groupthm_mapname_clist
\clist_new:N \l__groupthm_thmtools_clist \clist_new:N \l__groupthm_thmtools_clist
\clist_new:N \l__groupthm_group_clist \clist_new:N \l__groupthm_group_clist
\clist_new:N \g__groupthm_defined_theorem_groups_clist \clist_new:N \g__groupthm_defined_groups_clist
\bool_new:N \l__groupthm_in_family_options_environment_bool \bool_new:N \l__groupthm_in_family_options_environment_bool
\keys_define:nn { groupthm } \keys_define:nn { groupthm }
{ {
@ -130,19 +130,19 @@
\clist_set_eq:NN \l__groupthm_mapname_clist \l__groupthm_key_mapname_clist \clist_set_eq:NN \l__groupthm_mapname_clist \l__groupthm_key_mapname_clist
\clist_set_eq:NN \l__groupthm_thmtools_clist \l__groupthm_key_thmtools_clist \clist_set_eq:NN \l__groupthm_thmtools_clist \l__groupthm_key_thmtools_clist
} }
\cs_new:Npn \__groupthm_add_to_theorem_group_ordering:n #1 \cs_new:Npn \__groupthm_add_to_group_ordering:n #1
{ {
\__groupthm_hook_gset_rule_foreach:nNnn \__groupthm_hook_gset_rule_foreach:nNnn
{ __groupthm/groupsort } { __groupthm/groupsort }
\g__groupthm_defined_theorem_groups_clist \g__groupthm_defined_groups_clist
{ before } { before }
{ #1 } { #1 }
} }
\cs_new:Npn \__groupthm_remove_from_theorem_group_ordering:n #1 \cs_new:Npn \__groupthm_remove_from_group_ordering:n #1
{ {
\__groupthm_hook_gset_rule_foreach:nNnn \__groupthm_hook_gset_rule_foreach:nNnn
{ __groupthm/groupsort } { __groupthm/groupsort }
\g__groupthm_defined_theorem_groups_clist \g__groupthm_defined_groups_clist
{ unrelated } { unrelated }
{ #1 } { #1 }
} }
@ -154,7 +154,7 @@
\clist_put_left:Nn \l__groupthm_group_clist { #1 } \clist_put_left:Nn \l__groupthm_group_clist { #1 }
} }
} }
\cs_new:Npn \__groupthm_sort_theorem_group_names: \cs_new:Npn \__groupthm_sort_group_names:
{ {
\hook_gremove_code:nn { __groupthm/groupsort }{*} \hook_gremove_code:nn { __groupthm/groupsort }{*}
\clist_map_function:NN \l__groupthm_group_clist \__groupthm_add_to_sort_hook:n \clist_map_function:NN \l__groupthm_group_clist \__groupthm_add_to_sort_hook:n
@ -182,8 +182,8 @@
\clist_put_right:Nn \l__groupthm_thmtools_clist { #5 } \clist_put_right:Nn \l__groupthm_thmtools_clist { #5 }
} }
} }
\__groupthm_add_to_theorem_group_ordering:n { #1 } \__groupthm_add_to_group_ordering:n { #1 }
\clist_gput_left:Nn \g__groupthm_defined_theorem_groups_clist { #1 } \clist_gput_left:Nn \g__groupthm_defined_groups_clist { #1 }
} }
\cs_new:Npn \__groupthm_undefine_group:n #1 \cs_new:Npn \__groupthm_undefine_group:n #1
{ {
@ -193,33 +193,33 @@
\hook_gremove_code:nn { __groupthm/suffix } { #1 } \hook_gremove_code:nn { __groupthm/suffix } { #1 }
\hook_gremove_code:nn { __groupthm/mapname } { #1 } \hook_gremove_code:nn { __groupthm/mapname } { #1 }
\hook_gremove_code:nn { __groupthm/thmtools } { #1 } \hook_gremove_code:nn { __groupthm/thmtools } { #1 }
\clist_gremove_all:Nn \g__groupthm_defined_theorem_groups_clist { #1 } \clist_gremove_all:Nn \g__groupthm_defined_groups_clist { #1 }
\__groupthm_hook_gset_rule_foreach:nNnn \__groupthm_hook_gset_rule_foreach:nNnn
{ ?? } { ?? }
\g__groupthm_defined_theorem_groups_clist \g__groupthm_defined_groups_clist
{ unrelated } { unrelated }
{ #1 } { #1 }
\__groupthm_hook_gset_rule_foreach:nNnn \__groupthm_hook_gset_rule_foreach:nNnn
{ __groupthm/prefix } { __groupthm/prefix }
\g__groupthm_defined_theorem_groups_clist \g__groupthm_defined_groups_clist
{ unrelated } { unrelated }
{ #1 } { #1 }
\__groupthm_hook_gset_rule_foreach:nNnn \__groupthm_hook_gset_rule_foreach:nNnn
{ __groupthm/suffix } { __groupthm/suffix }
\g__groupthm_defined_theorem_groups_clist \g__groupthm_defined_groups_clist
{ unrelated } { unrelated }
{ #1 } { #1 }
\__groupthm_hook_gset_rule_foreach:nNnn \__groupthm_hook_gset_rule_foreach:nNnn
{ __groupthm/mapname } { __groupthm/mapname }
\g__groupthm_defined_theorem_groups_clist \g__groupthm_defined_groups_clist
{ unrelated } { unrelated }
{ #1 } { #1 }
\__groupthm_hook_gset_rule_foreach:nNnn \__groupthm_hook_gset_rule_foreach:nNnn
{ __groupthm/thmtools } { __groupthm/thmtools }
\g__groupthm_defined_theorem_groups_clist \g__groupthm_defined_groups_clist
{ unrelated } { unrelated }
{ #1 } { #1 }
\__groupthm_remove_from_theorem_group_ordering:n { #1 } \__groupthm_remove_from_group_ordering:n { #1 }
} }
\cs_new:Npn \__groupthm_define:nnnNNNn #1 #2 #3 #4 #5 #6 #7 \cs_new:Npn \__groupthm_define:nnnNNNn #1 #2 #3 #4 #5 #6 #7
{ {
@ -343,7 +343,7 @@
{ {
\use:c { groupthm_ \declarator _group:nn } { ##1 } { ##2 } \use:c { groupthm_ \declarator _group:nn } { ##1 } { ##2 }
} }
\cs_new:Npn \groupthm_declare_theorem_group_rule:nnnn #1 #2 #3 #4 \cs_new:Npn \groupthm_declare_group_rule:nnnn #1 #2 #3 #4
{ {
\str_set:Nx \l_tmpa_str { \tl_trim_spaces:n { #3 } } \str_set:Nx \l_tmpa_str { \tl_trim_spaces:n { #3 } }
\str_if_eq:VnT \l_tmpa_str { higher } \str_if_eq:VnT \l_tmpa_str { higher }
@ -365,7 +365,7 @@
\NewDocumentCommand { \DeclareTheoremGroupRule } { O{??} m m m } \NewDocumentCommand { \DeclareTheoremGroupRule } { O{??} m m m }
{ {
\groupthm_declare_theorem_group_rule:nnnn {#1} {#2} {#3} {#4} \groupthm_declare_group_rule:nnnn {#1} {#2} {#3} {#4}
} }
% \subsection{Iterating over powersets} % \subsection{Iterating over powersets}
\clist_new:N \l__powerset_copied_clist \clist_new:N \l__powerset_copied_clist
@ -631,7 +631,7 @@
{ {
\clist_set_eq:NN \l__groupthm_group_clist \l_tmpa_clist \clist_set_eq:NN \l__groupthm_group_clist \l_tmpa_clist
\clist_put_right:Nn \l__groupthm_group_clist { #5 } \clist_put_right:Nn \l__groupthm_group_clist { #5 }
\__groupthm_sort_theorem_group_names: \__groupthm_sort_group_names:
\use:c{groupthm_#6_grouped_theorem:xVnn} \use:c{groupthm_#6_grouped_theorem:xVnn}
{__#1__groups_\clist_use:Nn \l__groupthm_group_clist {_}} {__#1__groups_\clist_use:Nn \l__groupthm_group_clist {_}}
\l__groupthm_group_clist \l__groupthm_group_clist
@ -824,7 +824,7 @@
#3 #3
\bool_set_false:N \l__groupthm_in_family_options_environment_bool \bool_set_false:N \l__groupthm_in_family_options_environment_bool
\clist_put_right:Nn \l__groupthm_group_clist { #4 } \clist_put_right:Nn \l__groupthm_group_clist { #4 }
\__groupthm_sort_theorem_group_names: \__groupthm_sort_group_names:
\cs_if_exist:cTF { __#1__groups_ \clist_use:Nn \l__groupthm_group_clist { _ } } \cs_if_exist:cTF { __#1__groups_ \clist_use:Nn \l__groupthm_group_clist { _ } }
{ {
\begin { __#1__groups_ \clist_use:Nn \l__groupthm_group_clist { _ } } \begin { __#1__groups_ \clist_use:Nn \l__groupthm_group_clist { _ } }
@ -841,7 +841,7 @@
#3 #3
\bool_set_false:N \l__groupthm_in_family_options_environment_bool \bool_set_false:N \l__groupthm_in_family_options_environment_bool
\clist_put_right:Nn \l__groupthm_group_clist { #4 } \clist_put_right:Nn \l__groupthm_group_clist { #4 }
\__groupthm_sort_theorem_group_names: \__groupthm_sort_group_names:
\end { __#1__groups_ \clist_use:Nn \l__groupthm_group_clist { _ } } \end { __#1__groups_ \clist_use:Nn \l__groupthm_group_clist { _ } }
} }
} }