[isabelle-dev] code abbreviation for mapping over a fixed range
florian.haftmann at informatik.tu-muenchen.de
Thu Nov 12 10:09:16 CET 2015
> The new definition actually causes *more* allocation than the original
> one, except for very short lists, because every call of @ copies its
> first argument. Note that the code equation for [_..<_] is
> lemma upt_rec[code]: "[i..<j] = (if i<j then i#[Suc i..<j] else )"
> which has no calls to @ at all; a corresponding code equation for
> a fused "map_upt f i j = map f [i..<j]" would be
> "map_upt f i j = if i < j then f i # map_upt f (Suc i) j else "
> which could be used to define map_range:
> "map_range f n = map_upt f 0 n"
OK, I'll revert this.
Thanks for having an eye on that.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 198 bytes
Desc: OpenPGP digital signature
More information about the isabelle-dev