How to define Subtypes in Isabelle and what they mean?

北城余情 提交于 2019-12-12 01:58:36

问题


The question regarding subtyping in Isabelle is very lengthy here. So my simple question is that how I can define type B to be a subtype of A if I define A as below:

typedecl A

By doing this I would like to make all operations and relations defined over A (they are not printed here) accessible to elements of type B.

A bit more complex example is to define B and C to be subtype of A such that B and C are disjoint, and every element of A is either of type B or of type C.

Thanks


回答1:


Isabelle does not have subtypes, although some aspects of subtyping can be emulated as explained in another thread. If you want to use the same operation on different types, you may want to look into Isabelle's type classes.



来源:https://stackoverflow.com/questions/26865837/how-to-define-subtypes-in-isabelle-and-what-they-mean

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!