Chun Tian (binghe)
2017-07-03 11:22:13 UTC
Hi,
Currently I have the following Datatype "(âa, âb) CCS" which supports binary âsumâ operation:
val _ = Datatype `CCS = nil
| var 'a
| prefix ('b Action) CCS
| sum CCS CCS
...`;
I also have a recursive function for calculating the âsumâ of this datatype stored in a function: f(0) + f(1) + f(2) + ⊠+ f(n)
val CCS_SIGMA_def = Define `
(CCS_SIGMA (f :num -> ('a, 'b) CCS) 0 = f 0) /\
(CCS_SIGMA f (SUC n) = sum (CCS_SIGMA f n) (f (SUC n))) `;
val _ = overload_on ("SIGMA", ``CCS_SIGMA``);
I donât like above CCS_SIGMA_def, maybe later Iâll switch to another definition more like the SUM_IMAGE defined in HOLâs pred_setTheory:
val SUM_IMAGE_DEF = new_definition(
"SUM_IMAGE_DEF",
``SUM_IMAGE f s = ITSET (\e acc. f e + acc) s 0``);
which takes a set of numbers as the second parameter, looks more flexible. But it seems that all related theorems have to assume the finiteness of the set parameter.
My questions are:
1. is it possible to define a special SUM_IMAGE for my CCS datatype, and it also supports (countable) infinite sums: ``SUM_IMAGE p (UNIV: num)`` valid and meaningful?
2. if this is impossible, whatâs the necessary modification to the original datatype definition?
3. whatâs the necessary modification to support sums over limit ordinals (using HOLâs ordinalTheory in examples)? that is, for L a limit ordinal, I need to construct a sum of all ordinals M smaller than L: SUM f(M), for all M < L
Regards,
Chun Tian
Currently I have the following Datatype "(âa, âb) CCS" which supports binary âsumâ operation:
val _ = Datatype `CCS = nil
| var 'a
| prefix ('b Action) CCS
| sum CCS CCS
...`;
I also have a recursive function for calculating the âsumâ of this datatype stored in a function: f(0) + f(1) + f(2) + ⊠+ f(n)
val CCS_SIGMA_def = Define `
(CCS_SIGMA (f :num -> ('a, 'b) CCS) 0 = f 0) /\
(CCS_SIGMA f (SUC n) = sum (CCS_SIGMA f n) (f (SUC n))) `;
val _ = overload_on ("SIGMA", ``CCS_SIGMA``);
I donât like above CCS_SIGMA_def, maybe later Iâll switch to another definition more like the SUM_IMAGE defined in HOLâs pred_setTheory:
val SUM_IMAGE_DEF = new_definition(
"SUM_IMAGE_DEF",
``SUM_IMAGE f s = ITSET (\e acc. f e + acc) s 0``);
which takes a set of numbers as the second parameter, looks more flexible. But it seems that all related theorems have to assume the finiteness of the set parameter.
My questions are:
1. is it possible to define a special SUM_IMAGE for my CCS datatype, and it also supports (countable) infinite sums: ``SUM_IMAGE p (UNIV: num)`` valid and meaningful?
2. if this is impossible, whatâs the necessary modification to the original datatype definition?
3. whatâs the necessary modification to support sums over limit ordinals (using HOLâs ordinalTheory in examples)? that is, for L a limit ordinal, I need to construct a sum of all ordinals M smaller than L: SUM f(M), for all M < L
Regards,
Chun Tian