diff -r f8852715be0d -r 7701598a2182 src/Tools/isac/Knowledge/Rational.thy --- a/src/Tools/isac/Knowledge/Rational.thy Sun Jul 18 21:19:25 2021 +0200 +++ b/src/Tools/isac/Knowledge/Rational.thy Mon Jul 19 15:34:54 2021 +0200 @@ -41,7 +41,7 @@ (*("is_ratpolyexp", ("Rational.is_ratpolyexp", eval_is_ratpolyexp ""))*) fun eval_is_ratpolyexp (thmid:string) _ - (t as (Const("Rational.is_ratpolyexp", _) $ arg)) thy = + (t as (Const (\<^const_name>\Rational.is_ratpolyexp\, _) $ arg)) thy = if is_ratpolyexp arg then SOME (TermC.mk_thmid thmid (UnparseC.term_in_thy thy arg) "", HOLogic.Trueprop $ (TermC.mk_equality (t, @{term True}))) @@ -51,7 +51,7 @@ (*("get_denominator", ("Rational.get_denominator", eval_get_denominator ""))*) fun eval_get_denominator (thmid:string) _ - (t as Const ("Rational.get_denominator", _) $ + (t as Const (\<^const_name>\Rational.get_denominator\, _) $ (Const (\<^const_name>\divide\, _) $ _(*num*) $ denom)) thy = SOME (TermC.mk_thmid thmid (UnparseC.term_in_thy thy denom) "", @@ -60,7 +60,7 @@ (*("get_numerator", ("Rational.get_numerator", eval_get_numerator ""))*) fun eval_get_numerator (thmid:string) _ - (t as Const ("Rational.get_numerator", _) $ + (t as Const (\<^const_name>\Rational.get_numerator\, _) $ (Const (\<^const_name>\divide\, _) $num $denom )) thy = SOME (TermC.mk_thmid thmid (UnparseC.term_in_thy thy num) "", @@ -123,17 +123,17 @@ ML \ fun monom_of_term vs (c, es) (t as Const _) = (c, list_update es (find_index (curry op = t) vs) 1) - | monom_of_term _ (c, es) (t as (Const ("Num.numeral_class.numeral", _) $ _)) = + | monom_of_term _ (c, es) (t as (Const (\<^const_name>\numeral\, _) $ _)) = (t |> HOLogic.dest_number |> snd |> curry op * c, es) (*several numerals in one monom*) - | monom_of_term _ (c, es) (t as (Const ("Groups.uminus_class.uminus", _) $ _)) = + | monom_of_term _ (c, es) (t as (Const (\<^const_name>\uminus\, _) $ _)) = (t |> HOLogic.dest_number |> snd |> curry op * c, es) (*several numerals in one monom*) | monom_of_term vs (c, es) (t as Free _) = (c, list_update es (find_index (curry op = t) vs) 1) - | monom_of_term vs (c, es) (Const ("Transcendental.powr", _) $ (b as Free _) $ - (e as Const ("Num.numeral_class.numeral", _) $ _)) = + | monom_of_term vs (c, es) (Const (\<^const_name>\Transcendental.powr\, _) $ (b as Free _) $ + (e as Const (\<^const_name>\numeral\, _) $ _)) = (c, list_update es (find_index (curry op = b) vs) (e |> HOLogic.dest_number |> snd)) - | monom_of_term vs (c, es) (Const ("Transcendental.powr", _) $ (b as Free _) $ - (e as Const ("Groups.uminus_class.uminus", _) $ _)) = + | monom_of_term vs (c, es) (Const (\<^const_name>\Transcendental.powr\, _) $ (b as Free _) $ + (e as Const (\<^const_name>\uminus\, _) $ _)) = (c, list_update es (find_index (curry op = b) vs) (e |> HOLogic.dest_number |> snd)) | monom_of_term vs (c, es) (Const (\<^const_name>\times\, _) $ m1 $ m2) = @@ -144,9 +144,9 @@ (*-------v------*) fun monoms_of_term vs (t as Const _) = [monom_of_term vs (1, replicate (length vs) 0) t] - | monoms_of_term vs (t as Const ("Num.numeral_class.numeral", _) $ _) = + | monoms_of_term vs (t as Const (\<^const_name>\numeral\, _) $ _) = [monom_of_term vs (1, replicate (length vs) 0) t] - | monoms_of_term vs (t as Const ("Groups.uminus_class.uminus", _) $ _) = + | monoms_of_term vs (t as Const (\<^const_name>\uminus\, _) $ _) = [monom_of_term vs (1, replicate (length vs) 0) t] | monoms_of_term vs (t as Free _) = [monom_of_term vs (1, replicate (length vs) 0) t] @@ -191,7 +191,7 @@ | term_of_es baseT expT (_ :: vs) (0 :: es) = [] @ term_of_es baseT expT vs es | term_of_es baseT expT (v :: vs) (1 :: es) = v :: term_of_es baseT expT vs es | term_of_es baseT expT (v :: vs) (e :: es) = - Const ("Transcendental.powr", [baseT, expT] ---> baseT) $ v $ (HOLogic.mk_number expT e) + Const (\<^const_name>\Transcendental.powr\, [baseT, expT] ---> baseT) $ v $ (HOLogic.mk_number expT e) :: term_of_es baseT expT vs es | term_of_es _ _ _ _ = raise ERROR "term_of_es: length vs <> length es" @@ -215,8 +215,8 @@ subsection \Apply gcd_poly for cancelling and adding fractions as terms\ ML \ fun mk_noteq_0 baseT t = - Const ("HOL.Not", HOLogic.boolT --> HOLogic.boolT) $ - (Const ("HOL.eq", [baseT, baseT] ---> HOLogic.boolT) $ t $ HOLogic.mk_number HOLogic.realT 0) + Const (\<^const_name>\Not\, HOLogic.boolT --> HOLogic.boolT) $ + (Const (\<^const_name>\HOL.eq\, [baseT, baseT] ---> HOLogic.boolT) $ t $ HOLogic.mk_number HOLogic.realT 0) fun mk_asms baseT ts = let val as' = filter_out TermC.is_num ts (* asm like "2 ~= 0" is needless *) @@ -464,7 +464,7 @@ (*("is_expanded", ("Rational.is_expanded", eval_is_expanded ""))*) fun eval_is_expanded (thmid:string) _ - (t as (Const("Rational.is_expanded", _) $ arg)) thy = + (t as (Const (\<^const_name>\Rational.is_expanded\, _) $ arg)) thy = if is_expanded arg then SOME (TermC.mk_thmid thmid (UnparseC.term_in_thy thy arg) "", HOLogic.Trueprop $ (TermC.mk_equality (t, @{term True})))