# HG changeset patch # User blanchet # Date 1472724652 -7200 # Node ID 9f906a2eb0e70d6d93d985c363765431e7328308 # Parent 75f7a77e53bb4aab0206a50f19f64c5f3328891e added theory to provide workaround to support nested datatypes in quickcheck (until quickcheck is generalized to support it with new datatypes) diff -r 75f7a77e53bb -r 9f906a2eb0e7 src/HOL/Quickcheck_Examples/Quickcheck_Nesting.thy --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/HOL/Quickcheck_Examples/Quickcheck_Nesting.thy Thu Sep 01 12:10:52 2016 +0200 @@ -0,0 +1,19 @@ +theory Quickcheck_Nesting +imports Main +begin + +ML \ +let + open BNF_FP_Def_Sugar + open BNF_LFP_Compat + + val compat_plugin = Plugin_Name.declare_setup @{binding compat}; + + fun compat fp_sugars = + perhaps (try (datatype_compat (map (fst o dest_Type o #T) fp_sugars))); +in + Theory.setup (fp_sugars_interpretation compat_plugin compat) +end +\ + +end diff -r 75f7a77e53bb -r 9f906a2eb0e7 src/HOL/Quickcheck_Examples/Quickcheck_Nesting_Example.thy --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/HOL/Quickcheck_Examples/Quickcheck_Nesting_Example.thy Thu Sep 01 12:10:52 2016 +0200 @@ -0,0 +1,11 @@ +theory Quickcheck_Nesting_Example +imports Quickcheck_Nesting +begin + +datatype x = X "x list" + +lemma "X a = X b" +quickcheck[exhaustive, size = 4, expect = counterexample] +oops + +end diff -r 75f7a77e53bb -r 9f906a2eb0e7 src/HOL/ROOT --- a/src/HOL/ROOT Thu Sep 01 11:41:10 2016 +0200 +++ b/src/HOL/ROOT Thu Sep 01 12:10:52 2016 +0200 @@ -978,6 +978,7 @@ Quickcheck_Lattice_Examples Completeness Quickcheck_Interfaces + Quickcheck_Nesting_Example theories [condition = ISABELLE_GHC] Hotel_Example Quickcheck_Narrowing_Examples