(* a version of split half that assures the left side to be non-empty *) fun split_half:: "_ list ==> _ list × _ list"where "split_half xs = (take ((length xs + 1) div 2) xs, drop ((length xs + 1) div 2) xs)"
lemma split_half_conc: "split_half xs = (ls, rs) = (xs = ls@rs ∧ length ls = (length xs + 1) div 2)" by force
lemma drop_not_empty: "xs ≠ [] ==> drop (length xs div 2) xs ≠ []" apply(induction xs) apply(auto split!: list.splits) done
lemma [termination_simp]:"(ls, (sub, sep) # rs) = split ts y ==> size sub < Suc (size_list (λx. Suc (size (fst x))) ts + size l)" using split_conc[of ts y ls "(sub,sep)#rs"] by auto
lemma leaves_split: "split ts x = (ls,rs) ==> leaves (Node ts t) = leaves_list ls @ leaves_list rs @ leaves t" using leaves_conc split_conc by blast
end
locale split_list = fixes split_list :: "('a::{linorder,order_top}) list ==> 'a ==> 'a list × 'a list" assumes split_list_req: "[split_list ks p = (kls,krs)]==> ks = kls @ krs" "[split_list ks p = (kls@[sep],krs); sorted_less ks]==> sep < p" "[split_list ks p = (kls,(sep)#krs); sorted_less ks]==> p ≤ sep"
locale split_full = split_tree: split_tree split + split_list split_list for split:: "('a bplustree × 'a::{linorder,order_top}) list ==> 'a ==> ('a bplustree × 'a) list × ('a bplustree × 'a) list" and split_list:: "'a::{linorder,order_top} list ==> 'a ==> 'a list × 'a list"
section"Abstract split functions"
subsection"Linear split"
text"Finally we show that the split axioms are feasible by providing an example split function"
text"Linear split is similar to well known functions, therefore a quick proof can be done."
fun linear_split where"linear_split xs x = (takeWhile (λ(_,s). s<x) xs, dropWhile (λ(_,s). s<x) xs)" fun linear_split_list where"linear_split_list xs x = (takeWhile (λs. s<x) xs, dropWhile (λs. s<x) xs)"
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.