src/HOL/New_DSequence.thy
changeset 36049 0ce5b7a5c2fd
parent 36017 7516568bebeb
child 36176 3fe7e97ccca8
     1.1 --- a/src/HOL/New_DSequence.thy	Wed Mar 31 16:44:41 2010 +0200
     1.2 +++ b/src/HOL/New_DSequence.thy	Wed Mar 31 16:44:41 2010 +0200
     1.3 @@ -35,6 +35,10 @@
     1.4  where
     1.5    "pos_if_seq b = (if b then pos_single () else pos_empty)"
     1.6  
     1.7 +definition pos_iterate_upto :: "(code_numeral => 'a) => code_numeral => code_numeral => 'a pos_dseq"
     1.8 +where
     1.9 +  "pos_iterate_upto f n m = (%i. Lazy_Sequence.iterate_upto f n m)"
    1.10 + 
    1.11  definition pos_map :: "('a => 'b) => 'a pos_dseq => 'b pos_dseq"
    1.12  where
    1.13    "pos_map f xq = (%i. Lazy_Sequence.map f (xq i))"
    1.14 @@ -67,6 +71,10 @@
    1.15  where
    1.16    "neg_if_seq b = (if b then neg_single () else neg_empty)"
    1.17  
    1.18 +definition neg_iterate_upto 
    1.19 +where
    1.20 +  "neg_iterate_upto f n m = (%i. Lazy_Sequence.iterate_upto (%i. Some (f i)) n m)"
    1.21 +
    1.22  definition neg_map :: "('a => 'b) => 'a neg_dseq => 'b neg_dseq"
    1.23  where
    1.24    "neg_map f xq = (%i. Lazy_Sequence.hb_map f (xq i))"
    1.25 @@ -86,10 +94,10 @@
    1.26  hide (open) type pos_dseq neg_dseq
    1.27  
    1.28  hide (open) const 
    1.29 -  pos_empty pos_single pos_bind pos_union pos_if_seq pos_not_seq
    1.30 -  neg_empty neg_single neg_bind neg_union neg_if_seq neg_not_seq
    1.31 +  pos_empty pos_single pos_bind pos_union pos_if_seq pos_iterate_upto pos_not_seq pos_map
    1.32 +  neg_empty neg_single neg_bind neg_union neg_if_seq neg_iterate_upto neg_not_seq neg_map
    1.33  hide (open) fact
    1.34 -  pos_empty_def pos_single_def pos_bind_def pos_union_def pos_if_seq_def pos_not_seq_def pos_map_def
    1.35 -  neg_empty_def neg_single_def neg_bind_def neg_union_def neg_if_seq_def neg_not_seq_def neg_map_def
    1.36 +  pos_empty_def pos_single_def pos_bind_def pos_union_def pos_if_seq_def pos_iterate_upto_def pos_not_seq_def pos_map_def
    1.37 +  neg_empty_def neg_single_def neg_bind_def neg_union_def neg_if_seq_def neg_iterate_upto_def neg_not_seq_def neg_map_def
    1.38  
    1.39  end