Theory IsaSAT_VMTF_LLVM
theory IsaSAT_VMTF_LLVM
imports Watched_Literals.WB_Sort IsaSAT_VMTF
IsaSAT_VMTF_Setup_LLVM
Examples.Sorting_Introsort
IsaSAT_Sorting_LLVM
IsaSAT_Literals_LLVM
IsaSAT_Trail_LLVM
IsaSAT_Clauses_LLVM
IsaSAT_Lookup_Conflict_LLVM
begin
hide_const (open) NEMonad.RETURN NEMonad.ASSERT
definition valid_atoms :: ‹nat_vmtf_node list ⇒ nat set› where
‹valid_atoms xs ≡ {i. i < length xs}›
definition VMTF_score_less where
‹VMTF_score_less xs i j ⟷ stamp (xs ! i) < stamp (xs ! j)›
definition mop_VMTF_score_less where
‹mop_VMTF_score_less xs i j = do {
ASSERT(i < length xs);
ASSERT(j < length xs);
RETURN (stamp (xs ! i) < stamp (xs ! j))
}›
sepref_register VMTF_score_less
sepref_def (in -) mop_VMTF_score_less_impl
is ‹uncurry2 (mop_VMTF_score_less)›
:: ‹(array_assn vmtf_node_assn)⇧k *⇩a atom_assn⇧k *⇩a atom_assn⇧k →⇩a bool1_assn›
supply [[goals_limit = 1]]
unfolding mop_VMTF_score_less_def
apply (rewrite at ‹stamp (_ ! ⌑)› value_of_atm_def[symmetric])
apply (rewrite at ‹stamp (_ ! ⌑)› in ‹_ < ⌑› value_of_atm_def[symmetric])
unfolding index_of_atm_def[symmetric]
by sepref
interpretation VMTF: weak_ordering_on_lt where
C = ‹valid_atoms vs› and
less = ‹VMTF_score_less vs›
by unfold_locales
(auto simp: VMTF_score_less_def split: if_splits)