Isabelle: Unsupported recursive occurrence of data type using type constructor "Set.set"

Problem

I am wondering if there is a natural way of coding in Isabel grammar for example:

 type_synonym Var = string
 datatype Value = VInt int | ...
 datatype Cmd = Skip | NonDeterministicChoice "Cmd set" | ...

The motivation would be to define several specification commands in terms of non-deterministic selection, for example:

 Magic == NonDeterministicChoice {}
 Rely c r z = Defined using set compreehension and NonDeterministicChoice

Isabelle complains about the recursive appearance of the type "Cmd" in the "Cmd set", that is:

Unsupported recursive appearance of type "Cmd" through the type constructor "Set.set" in an expression of type "Cmd set". Use the "bnf" command to register "Set.set" as a bounded natural functor to allow nested (co) recursion through it

Isabelle, set, , 'set' , .

, , , Isabelle , .

datatype Cmd = Skip | NonDeterministicChoice "Cmd list" | ...

, , . , , : , Cmd, , Value.

:

consts Values :: "Value list"
consts Programs :: "Cmd list"

, " ( ) Cmd" " ( )". , , , , .

NonDeterministicChoiceSet

consts NonDeterministicChoiceSet :: "Cmd set ⇒ Cmd"

() , Cmd NonDeterministicChoice, , , , , , . , "NonDeterministicChoice" , "NonDeterministicChoiceSet" "NonDeterministicChoiceSet" .

  • ?
  • ?
  • -, ? , , Z/Eves, .

!: -)

+4
1

, , , . , .

,

datatype Cmd = Skip | NonDeterministicChoice "Cmd set"

. A := (UNIV :: Cmd), .. . , ,

f: P(A) → A, X ↦ NonDeterministicChoice X

- A A. . ? , , " ". . Z/EVES, , .

, , , . , , - , set (BNF). BNF, , , , , , set, .

, , . (fset) (cset). . , , fset, , , , , fset - . countable, cset. ~~/src/HOL/Library/, fset Countable_Set_Type .

fset , ({||} {}, |∈| ); cset , . , fset/cset set , /, . , , , , , /.

, , , . fset, , . cset, , . , , . ( , )

, NonDeterministicChoiceSet. " /, , . , , , , , , , . , , , .

, , , , , fset/cset, , , .

, , . : , , .

A - [A] ^ κ A κ (, κ = ℵ₀, ℵ₀ - ). [A] ^ κ → A, .. | A | ≥ | [A] ^ κ |.

κ ≥ | A |, [A] ^ κ 2 ^ A ( A) , , | A | ≥ | 2 ^ A |, . , κ < | |. ( , : κ, )

, | A | ≥ κ, K | K | = κ K [A] ^ κ, .. 2 ^ K → [A] ^ κ , , | A | ≥ | [A] ^ κ | ≥ | 2 ^ K | = 2 ^ κ.

, κ, 2 ^ κ, κ . , κ = ℵ₀, , , .

+4

All Articles