Theory CYK
subsection "The CYK Algorithm"
theory CYK
imports
"HOL-Library.IArray"
"HOL-Library.Code_Target_Numeral"
"HOL-Library.Product_Lexorder"
"HOL-Library.RBT_Mapping"
"../state_monad/State_Main"
"../heap_monad/Heap_Default"
Example_Misc
begin
subsubsection ‹Misc›
lemma append_iff_take_drop:
"w = u@v ⟷ (∃k ∈ {0..length w}. u = take k w ∧ v = drop k w)"
by (metis (full_types) append_eq_conv_conj append_take_drop_id atLeastAtMost_iff le0 le_add1 length_append)
lemma append_iff_take_drop1: "u ≠ [] ⟹ v ≠ [] ⟹
w = u@v ⟷ (∃k ∈ {1..length w - 1}. u = take k w ∧ v = drop k w)"
by(auto simp: append_iff_take_drop)
subsubsection ‹Definitions›