Andreas Lochbihler
2014-03-27 16:07:57 UTC
Dear experts on code generation,
The term reconstruction setup for the integer type seems to be broken in Isabelle2013-2
and the development version (tested with 801a72ad52d3). This makes quickcheck-narrowing
raise an exception as soon as the query contains a function variable whose domain is
related to the target-language numerals. If I import ~~/src/HOL/Library/Code_Target_Int,
functions with domain int are also affected.
Here's a minimal example:
theory Scratch imports "~~/src/HOL/Library/Code_Target_Int" begin
lemma "f = (g :: int => bool)"
quickcheck[narrowing]
*** Illegal numeral expression: illegal term,
*** in equation Code_Evaluation.term_of_integer_inst.term_of_integer (Code_Numeral.Neg ?a)
== ...
I am not particularly familiar with all this term reconstruction stuff, but I found the
following. In Code_Evaluation, there's a custom serialisation of term_of for integer for
the target Eval. Narrowing, however, uses the target Haskell_Quickcheck, which is not a
sub-target of Eval. Is there just an adaptation missing?
Best,
Andreas
The term reconstruction setup for the integer type seems to be broken in Isabelle2013-2
and the development version (tested with 801a72ad52d3). This makes quickcheck-narrowing
raise an exception as soon as the query contains a function variable whose domain is
related to the target-language numerals. If I import ~~/src/HOL/Library/Code_Target_Int,
functions with domain int are also affected.
Here's a minimal example:
theory Scratch imports "~~/src/HOL/Library/Code_Target_Int" begin
lemma "f = (g :: int => bool)"
quickcheck[narrowing]
*** Illegal numeral expression: illegal term,
*** in equation Code_Evaluation.term_of_integer_inst.term_of_integer (Code_Numeral.Neg ?a)
== ...
I am not particularly familiar with all this term reconstruction stuff, but I found the
following. In Code_Evaluation, there's a custom serialisation of term_of for integer for
the target Eval. Narrowing, however, uses the target Haskell_Quickcheck, which is not a
sub-target of Eval. Is there just an adaptation missing?
Best,
Andreas