src/HOL/Library/positivstellensatz.ML
changeset 39027 e4262f9e6a4e
parent 38801 319a28dd3564
child 39920 7479334d2c90
equal deleted inserted replaced
39026:962d12bc546c 39027:e4262f9e6a4e
   547 end;
   547 end;
   548 
   548 
   549 (* A linear arithmetic prover *)
   549 (* A linear arithmetic prover *)
   550 local
   550 local
   551   val linear_add = FuncUtil.Ctermfunc.combine (curry op +/) (fn z => z =/ Rat.zero)
   551   val linear_add = FuncUtil.Ctermfunc.combine (curry op +/) (fn z => z =/ Rat.zero)
   552   fun linear_cmul c = FuncUtil.Ctermfunc.map (fn x => c */ x)
   552   fun linear_cmul c = FuncUtil.Ctermfunc.map (fn _ => fn x => c */ x)
   553   val one_tm = @{cterm "1::real"}
   553   val one_tm = @{cterm "1::real"}
   554   fun contradictory p (e,_) = ((FuncUtil.Ctermfunc.is_empty e) andalso not(p Rat.zero)) orelse
   554   fun contradictory p (e,_) = ((FuncUtil.Ctermfunc.is_empty e) andalso not(p Rat.zero)) orelse
   555      ((eq_set (op aconvc) (FuncUtil.Ctermfunc.dom e, [one_tm])) andalso
   555      ((eq_set (op aconvc) (FuncUtil.Ctermfunc.dom e, [one_tm])) andalso
   556        not(p(FuncUtil.Ctermfunc.apply e one_tm)))
   556        not(p(FuncUtil.Ctermfunc.apply e one_tm)))
   557 
   557