*To*: Lars Hupel <hupel at in.tum.de>*Subject*: Re: [isabelle] Isar parser for constant names*From*: Makarius <makarius at sketis.net>*Date*: Mon, 19 May 2014 14:01:28 +0200 (CEST)*Cc*: Moa Johansson <moa.johansson at chalmers.se>, isabelle-users at cl.cam.ac.uk*In-reply-to*: <d76619ae00907029980ff1fe486f1009-EhVcX1hCQQpcRwURGhY3AF9BdAJSS1xcXF9EBlw1WENZS1kNVkFyBktcXjBeRUUCW1NQQlxQ-webmailer2@server01.webmailer.hosteurope.de>*References*: <D95C40FC-D44D-447F-AC53-A945621861EF@chalmers.se> <d76619ae00907029980ff1fe486f1009-EhVcX1hCQQpcRwURGhY3AF9BdAJSS1xcXF9EBlw1WENZS1kNVkFyBktcXjBeRUUCW1NQQlxQ-webmailer2@server01.webmailer.hosteurope.de>*User-agent*: Alpine 2.00 (LNX 1167 2008-08-23)

On Mon, 19 May 2014, Lars Hupel wrote:

here's what I do for my Isar command: fun const_raw (..., raw_const) thy = let val ctxt = Proof_Context.init_global thy val (name, _) = Syntax.parse_term ctxt raw_const | > Type.strip_constraints | > dest_Const (* ... *) in (* ... *) end val _ = Outer_Syntax.command @{command_spec "declassify"} "redefines a constant after applying the dictionary construction" ((* ... *) -- Parse.const >> (Toplevel.theory o const_raw))This works with proper markup in Isabelle/jEdit. I'm not sure whether thisis the canonical solution, but so far I never got any "unknown constant"exceptions.

Makarius

**References**:**[isabelle] Isar parser for constant names***From:*Moa Johansson

**Re: [isabelle] Isar parser for constant names***From:*Lars Hupel

- Previous by Date: Re: [isabelle] quickchecking lemma with types defined by typedecl
- Next by Date: [isabelle] ISR 2014: call for participation
- Previous by Thread: Re: [isabelle] Isar parser for constant names
- Next by Thread: [isabelle] quickchecking lemma with types defined by typedecl
- Cl-isabelle-users May 2014 archives indexes sorted by: [ thread ] [ subject ] [ author ] [ date ]
- Cl-isabelle-users list archive Table of Contents
- More information about the Cl-isabelle-users mailing list