# HG changeset patch # User nipkow # Date 1724431212 -7200 # Node ID 6adf6cc82013288577404bd218415ad8a7f63880 # Parent 6984640568b94c9084405e9882278b11f73d79f5 tuned comments diff -r 6984640568b9 -r 6adf6cc82013 src/HOL/Data_Structures/Define_Time_Function.thy --- a/src/HOL/Data_Structures/Define_Time_Function.thy Thu Aug 22 22:26:36 2024 +0100 +++ b/src/HOL/Data_Structures/Define_Time_Function.thy Fri Aug 23 18:40:12 2024 +0200 @@ -34,6 +34,16 @@ use \time_function\ accompanied by a \termination\ command. Limitation: The commands do not work properly in locales yet. +If \f\ is defined in a type class, one needs to set up a corresponding type class, say \T_f\, +that fixes a function \T_f\ of the corresponding type (ending in type \nat\). +For every instance of \f :: \\ one needs to create a corresponding instance of the class \T_f\. +Inside that instance one can now use \time_fun "f :: \"\ to define an instance of the function \T_f\. +For example, see the definition and instantiation of class \T_size\ in theory \Time_Funs\. +Note that we can just write \time_fun length\ because \length\ is an abbreviation for \size\ on type \list\. + +If \f\ has an argument of function type, the corresponding argument of \T_f\ is a pair +of that function argument \g\ and its corresponding time function \T_g\. + The pre-defined functions below are assumed to have constant running time. In fact, we make that constant 0. This does not change the asymptotic running time of user-defined functions using the