theory Op imports Main begin section βΉn-ary operationsβΊ locale nary_operations = fixes ππ :: "'op β 'a list β 'a" and ππ―π¦π±πΆ :: "'op β nat" assumes ππ_ππ―π¦π±πΆ_domain: "length xs = ππ―π¦π±πΆ op βΉ βy. ππ op xs = y" (* locale nary_operations_inl = nary_operations "Ξ»op args. fst (eval op args)" arity for eval :: "'op β 'dyn list β 'dyn Γ 'op option" and arity begin definition equiv_op where "equiv_op x y β‘ fst β eval x = fst β eval y" lemma equivp_equiv_op[simp]: "equivp equiv_op" proof (rule equivpI) show "reflp equiv_op" by (rule reflpI) (simp add: equiv_op_def) next show "symp equiv_op" by (rule sympI) (simp add: equiv_op_def) next show "transp equiv_op" by (rule transpI) (simp add: equiv_op_def) qed end *) (* locale nary_operations0 = fixes eval :: "'op β 'dyn list β 'dyn Γ 'op option" and arity :: "'op β nat" begin definition equiv_op where "equiv_op x y β‘ fst β eval x = fst β eval y" lemma equivp_equiv_op[simp]: "equivp equiv_op" proof (rule equivpI) show "reflp equiv_op" by (rule reflpI) (simp add: equiv_op_def) next show "symp equiv_op" by (rule sympI) (simp add: equiv_op_def) next show "transp equiv_op" by (rule transpI) (simp add: equiv_op_def) qed end *) end