(**************************************************************************) (* ___ *) (* ||M|| *) (* ||A|| A project by Andrea Asperti *) (* ||T|| *) (* ||I|| Developers: *) (* ||T|| The HELM team. *) (* ||A|| http://helm.cs.unibo.it *) (* \ / *) (* \ / This file is distributed under the terms of the *) (* v GNU General Public License Version 2 *) (* *) (**************************************************************************) include "Traces.ma". record monoid: Type[1] ≝ { carrier :> Type[0] ; op: carrier → carrier → carrier ; e: carrier ; neutral_r : ∀x. op … x e = x ; neutral_l : ∀x. op … e x = x ; is_associative: ∀x,y,z. op … (op … x y) z = op … x (op … y z) }. record monoid_action (I : monoid) (M : Type[0]) : Type[0] ≝ { act :2> I → M → M ; act_neutral : ∀x.act (e …) x = x ; act_op : ∀i,j,x.act (op … i j) x = act j (act i x) }. record concrete_transition_sys : Type[2] ≝ { trans_sys :> abstract_status ; cost_mon : monoid ; cost_of : trans_sys → cost_mon }. record abstract_transition_sys (concrete_costs : Type[0]) : Type[1] ≝ { abs_state_t :> Type[0] ; abs_instr : monoid ; act_abs : monoid_action abs_instr abs_state_t ; abs_cost : abs_state_t → concrete_costs }. notation "〚 term 19 C 〛 term 90 A" with precedence 10 for @{ 'sem $C $A }. interpretation "act_abs" 'sem f x = (act ?? (act_abs ??) f x). record galois_rel (C : concrete_transition_sys) (A : abstract_transition_sys (cost_mon C)) : Type[0] ≝ { rel_galois :2> C → A → Prop ; rel_galois_cost : ∀s,a.rel_galois … s a → abs_cost … a = cost_of … s }. record galois_connection : Type[2] ≝ { concr : concrete_transition_sys ; abs_d : abstract_transition_sys (cost_mon concr) ; galois_rel:> galois_rel concr abs_d }. record abstract_interpretation : Type[2] ≝ { galois_conn:> galois_connection ; instr_t : Type[0] ; fetch : concr galois_conn → option instr_t ; instr_map : instr_t → abs_instr … (abs_d galois_conn) ; instr_map_ok : ∀s,s': concr … galois_conn. ∀a: abs_d … galois_conn.∀l,i. as_execute … l s s' → fetch … s = Some ? i → ∀I. instr_map … i = I → galois_conn s a → galois_conn s' (〚I〛 a) }.