module DSeqArray
use map.Map
use int.Int
use DSeq
function update_array_with_seq (dst:map int 'a) (pos len:int) (src:seq 'a) : map int 'a =
(fun j -> if pos <= j < pos+len then DSeq.get src (j-pos) else dst j)
No proof
lemma get_update_array_with_seq: forall dst: map int 'a. forall src pos_dst len j.
(update_array_with_seq dst pos_dst len src) j = if pos_dst <= j < pos_dst+len then get src (j-pos_dst) else dst j
function update_seq_with_array (dst:seq 'a) (pos_dst len:int) (pos_src:int) (src:map int 'a) : seq 'a
axiom length_update_seq_with_array: forall dst: seq 'a. forall src pos_dst len pos_src. length (update_seq_with_array dst pos_dst len pos_src src) = length dst
axiom default_update_seq_with_array: forall dst: seq 'a. forall src pos_dst len pos_src. default (update_seq_with_array dst pos_dst len pos_src src) = (default dst)
axiom get_update_seq_with_array: forall dst: seq 'a. forall src pos_dst len pos_src j.
0 <= j < length dst -> get (update_seq_with_array dst pos_dst len pos_src src) j = if pos_dst <= j < pos_dst+len then src (j-pos_dst+pos_src) else get dst j
end