isabelle

Trying to Treat Type Classes and Sub-types Like Sets and Subsets

只愿长相守 提交于 2019-12-02 05:08:03
问题 This question is related to my previous SO question about type classes. I ask this question to set up a future question about locales. I don't think type classes will work for what I'm trying to do, but how type classes work have given me ideas about what I want out of locales. Below, when I use the braces notation {0,0} , it doesn't represent the normal HOL braces, and 0 represents the empty set. Some files if you want them A_i130424a.thy - ASCII friendly THY. i130424a.thy - non-ASCII

How to pass assumptions to interpretation of locale

点点圈 提交于 2019-12-02 04:10:37
I would like to use some properties of my structure in the proof required by a locale interpretation As an example, suppose I defined the predicate P and proved some lemmas ( add is a closed binary operation, add is associative and there exists zero the neutral element) about the add operation on elements that satisfy the predicate P I would like to interpret then the set of my elements as a structure that satisfy some locale, e.g. monoid interpretation "{s . P s}" :: monoid "(add)" "(zero)" unfolding monoid_def using add_is_associative zero_is_neutral but then in the goal of my proof I am not

How to run Athena | Coq | Isabelle codes remotely?

帅比萌擦擦* 提交于 2019-12-02 03:04:26
问题 I' ve been creating a Web IDE (WIDE) for theorem proving in Computer Science. You may know, there are 3 most common proof assitants which names Athena, Isabelle and Coq. Most of computer scientist might forget their syntax, scopes etc. My Web IDE works with drag and drop desing and examples. You can edit and write additional code on it, you can download it, you can share it, you can save it etc. It has also own parser. So far everything is OK. Watch out! Here is my question: How can I run the

Simplify pretty-printing of naturals

末鹿安然 提交于 2019-12-02 02:52:16
Let's say I wrote a function for reversing a list. I want to test it out using the value command, just to assure myself that I probably got it right. But the output looks horrible: value "reverse [1,8,3]" > "[1 + 1 + 1, 1 + 1 + (1 + 1) + (1 + 1 + (1 + 1)), 1]" :: "'a list" If I tell Isabelle to treat those numeric characters as naturals, the output is even worse: value "reverse [1::nat,8,3]" > "[Suc (Suc (Suc 0)), Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0))))))), Suc 0]" :: "nat list" Sometimes I resort to using strings, but that's looks a bit funny with all those apostrophes everywhere: value

Simplify pretty-printing of naturals

為{幸葍}努か 提交于 2019-12-02 02:44:56
问题 Let's say I wrote a function for reversing a list. I want to test it out using the value command, just to assure myself that I probably got it right. But the output looks horrible: value "reverse [1,8,3]" > "[1 + 1 + 1, 1 + 1 + (1 + 1) + (1 + 1 + (1 + 1)), 1]" :: "'a list" If I tell Isabelle to treat those numeric characters as naturals, the output is even worse: value "reverse [1::nat,8,3]" > "[Suc (Suc (Suc 0)), Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0))))))), Suc 0]" :: "nat list"

Trying to Treat Type Classes and Sub-types Like Sets and Subsets

血红的双手。 提交于 2019-12-02 01:39:29
This question is related to my previous SO question about type classes . I ask this question to set up a future question about locales. I don't think type classes will work for what I'm trying to do, but how type classes work have given me ideas about what I want out of locales. Below, when I use the braces notation {0,0} , it doesn't represent the normal HOL braces, and 0 represents the empty set. Some files if you want them A_i130424a.thy - ASCII friendly THY. i130424a.thy - non-ASCII friendly THY. i130424a_DOC.pdf - PDF showing line numbers. MFZ_DOC.pdf - Main project this is related to.

How to run Athena | Coq | Isabelle codes remotely?

青春壹個敷衍的年華 提交于 2019-12-02 01:20:58
I' ve been creating a Web IDE (WIDE) for theorem proving in Computer Science. You may know, there are 3 most common proof assitants which names Athena, Isabelle and Coq. Most of computer scientist might forget their syntax, scopes etc. My Web IDE works with drag and drop desing and examples. You can edit and write additional code on it, you can download it, you can share it, you can save it etc. It has also own parser. So far everything is OK. Watch out! Here is my question: How can I run the users' codes and get the result (especially for Athena http://proofcentral.org/ ) when user would like

How to define a partial function in Isabelle?

给你一囗甜甜゛ 提交于 2019-12-02 00:55:14
问题 I tried to define a partial function with the partial_function keyword. It did not work. Here is the one that expresses the intuition best: partial_function (tailrec) oddity :: "nat => nat" where "oddity Zero = Zero " | "oddity (Succ (Succ n)) = n" and then I tried the following: partial_function (tailrec) oddity :: "nat => nat" where "oddity arg = ( case arg of (Succ (Succ n)) => n | Zero => Zero )" partial_function (tailrec) oddity :: "nat => nat" where "oddity (Succ(Succ n)) = n | oddity

Gather all non-undefined values after addition

↘锁芯ラ 提交于 2019-12-02 00:35:00
I have the following addition in Isabelle: function proj_add :: "(real × real) × bit ⇒ (real × real) × bit ⇒ (real × real) × bit" where "proj_add ((x1,y1),l) ((x2,y2),j) = ((add (x1,y1) (x2,y2)), l+j)" if "delta x1 y1 x2 y2 ≠ 0 ∧ (x1,y1) ∈ e_aff ∧ (x2,y2) ∈ e_aff" | "proj_add ((x1,y1),l) ((x2,y2),j) = ((ext_add (x1,y1) (x2,y2)), l+j)" if "delta' x1 y1 x2 y2 ≠ 0 ∧ (x1,y1) ∈ e_aff ∧ (x2,y2) ∈ e_aff" | "proj_add ((x1,y1),l) ((x2,y2),j) = undefined" if "delta x1 y1 x2 y2 = 0 ∧ delta' x1 y1 x2 y2 = 0 ∨ (x1,y1) ∉ e_aff ∨ (x2,y2) ∉ e_aff" apply(fast,fastforce) using coherence e_aff_def by auto Now, I

Can I name the variables generated by case analysis?

跟風遠走 提交于 2019-12-01 19:21:49
Is it possible to give my own names to the variables generated when using case analysis or induction? Lars Noschinski If you are using structured proofs (starting with the proof keyword), you can use the case keywoard to select the case you want to prove and give names to the variables created by case analysis / induction: lemma "length (rev xs) = length xs" proof (induct xs) case Nil then show ?case ... next case (Cons x xs) then show ?case ... qed Here case (Cons x xs) tells Isabelle that you want to prove the case where a list consists of a start element and a remaining list (i.e., the