Stream: Archive Mirror: Isabelle Users Mailing List

Topic: [isabelle] Code generation (ML level) Isabelle 2019


view this post on Zulip Email Gateway (Aug 22 2022 at 20:35):

From: Moa Johansson <moa.johansson@chalmers.se>
Hi all,

Just updating some of my code to use Isabelle2019. Noticing the interface to the code generation has changed. I managed to get my code to type-check and work, through some qualified guessing, but it would be nice to understand what I was actually doing… ☺.

In Isabelle2019 the function export_code has the following type:
val export_code:
bool -> string list
-> (((string * string) * ({physical: bool} * (Path.T * Position.T)) option) * Token.T list) list
-> local_theory -> local_theory

More specifically, what does the new arguments
{physical: bool} and
Position.T
actually mean? Setting them to “true” and “Position.start” respectively worked fine in my case, when exporting to Haskell.

Also, I am somewhat wondering about to the remark in the Changelog about the “file” argument becoming legacy and being removed. This refers to the export_code command on the Isar-level, but does it affect me when working at the ML level (i.e. what I put in the argument of type Path.T above)?

Best,
Moa

view this post on Zulip Email Gateway (Aug 22 2022 at 20:35):

From: Florian Haftmann <florian.haftmann@informatik.tu-muenchen.de>
Hi Moa,

these changes in the Isabelle/ML interface correspond to the following
NEWS entry:

More specifically, what does the new arguments
{physical: bool} and
Position.T
actually mean? Setting them to “true” and “Position.start” respectively worked fine in my case, when exporting to Haskell.

Most idiomatic is to use the \<^here> antiquotation in Isabelle/ML for a
position, if there is no position you can just pass through from
corresponding Isar text.

Also, I am somewhat wondering about to the remark in the Changelog about the “file” argument becoming legacy and being removed. This refers to the export_code command on the Isar-level, but does it affect me when working at the ML level (i.e. what I put in the argument of type Path.T above)?

The possibility to generate files from the exported code
programmatically will always remain (cf. module »Export«).

The idea behind the NEWS entry is to reduce / eliminate the need for
arbitrary dumps to the physical file system over time.

Cheers,
Florian
signature.asc


Last updated: Apr 19 2024 at 04:17 UTC