equal
deleted
inserted
replaced
112 fun repeat_sep s f = f ::: Scan.repeat (str s |-- f) |
112 fun repeat_sep s f = f ::: Scan.repeat (str s |-- f) |
113 |
113 |
114 val parse_id = Scan.one Symbol.is_letter ::: Scan.many Symbol.is_letdig >> implode |
114 val parse_id = Scan.one Symbol.is_letter ::: Scan.many Symbol.is_letdig >> implode |
115 |
115 |
116 fun parse_varpow ctxt = parse_id -- Scan.optional (str "^" |-- nat) 1 >> |
116 fun parse_varpow ctxt = parse_id -- Scan.optional (str "^" |-- nat) 1 >> |
117 (fn (x, k) => (Proof_Context.cterm_of ctxt (Free (x, @{typ real})), k)) |
117 (fn (x, k) => (Thm.cterm_of ctxt (Free (x, @{typ real})), k)) |
118 |
118 |
119 fun parse_monomial ctxt = repeat_sep "*" (parse_varpow ctxt) >> |
119 fun parse_monomial ctxt = repeat_sep "*" (parse_varpow ctxt) >> |
120 (fn xs => fold FuncUtil.Ctermfunc.update xs FuncUtil.Ctermfunc.empty) |
120 (fn xs => fold FuncUtil.Ctermfunc.update xs FuncUtil.Ctermfunc.empty) |
121 |
121 |
122 fun parse_cmonomial ctxt = |
122 fun parse_cmonomial ctxt = |