Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
774 views
in Technique[技术] by (71.8m points)

types - saving a datatype before fixing additional variable in Isabelle/HOL

I'm fairly new to Isabelle and I'm having some trouble with typing: I would like to have two separate, but overlapping types, let's say 'a and 'b. Thinking of them as sets, I would like to have 'b = 'a cup {tau} for a specific tau that doesn't appear in 'a. As I understand it, you can expand a type using "fixes tau :: 'a" in Isabelle, but it seems like then the original type 'a (without tau) gets lost: Current Isabelle code using fixes

I need both types for my later formulation, so is there a way to "save" the state of 'a before fixing tau to it?

Any help would be greatly appreciated!

question from:https://stackoverflow.com/questions/65903299/saving-a-datatype-before-fixing-additional-variable-in-isabelle-hol

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You are misunderstanding locales. Fixes introduces constants of a certain type. Remember what a locale means:

locale t =
   fixes x
   assumes "P x"
begin

lemma b: Q 
  sorry

means that "!!x. P x ==> Q". You are not extending types.

About the actual question: you cannot extend types directly or express that directly in HOL. It is impossible to do so. There are two solutions to extend types in practice:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...