From ff5454812f9e2720bd90c3a5437505644f63b487 Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Fri, 31 Jul 2020 14:56:24 +0200 Subject: (FEAT) Term elaboration of assumption and goal statements. . spartan/core/goals.ML . spartan/core/elaboration.ML . spartan/core/elaborated_statement.ML (FEAT) More context tacticals and search tacticals. . spartan/core/context_tactical.ML (FEAT) Improved subgoal focus. Moves fully elaborated assumptions into the context (MINOR INCOMPATIBILITY). . spartan/core/focus.ML (FIX) Normalize facts in order to be able to resolve properly. . spartan/core/typechecking.ML (MAIN) New definitions. (MAIN) Renamed theories and theorems. (MAIN) Refactor theories to fit new features. --- spartan/lib/More_Types.thy | 150 --------------------------------------------- 1 file changed, 150 deletions(-) delete mode 100644 spartan/lib/More_Types.thy (limited to 'spartan/lib/More_Types.thy') diff --git a/spartan/lib/More_Types.thy b/spartan/lib/More_Types.thy deleted file mode 100644 index 55e6554..0000000 --- a/spartan/lib/More_Types.thy +++ /dev/null @@ -1,150 +0,0 @@ -theory More_Types -imports Spartan - -begin - -section \Sum type\ - -axiomatization - Sum :: \o \ o \ o\ and - inl :: \o \ o \ o \ o\ and - inr :: \o \ o \ o \ o\ and - SumInd :: \o \ o \ (o \ o) \ (o \ o) \ (o \ o) \ o \ o\ - -notation Sum (infixl "\" 50) - -axiomatization where - SumF: "\A: U i; B: U i\ \ A \ B: U i" and - - Sum_inl: "\B: U i; a: A\ \ inl A B a: A \ B" and - - Sum_inr: "\A: U i; b: B\ \ inr A B b: A \ B" and - - SumE: "\ - s: A \ B; - \s. s: A \ B \ C s: U i; - \a. a: A \ c a: C (inl A B a); - \b. b: B \ d b: C (inr A B b) - \ \ SumInd A B (fn s. C s) (fn a. c a) (fn b. d b) s: C s" and - - Sum_comp_inl: "\ - a: A; - \s. s: A \ B \ C s: U i; - \a. a: A \ c a: C (inl A B a); - \b. b: B \ d b: C (inr A B b) - \ \ SumInd A B (fn s. C s) (fn a. c a) (fn b. d b) (inl A B a) \ c a" and - - Sum_comp_inr: "\ - b: B; - \s. s: A \ B \ C s: U i; - \a. a: A \ c a: C (inl A B a); - \b. b: B \ d b: C (inr A B b) - \ \ SumInd A B (fn s. C s) (fn a. c a) (fn b. d b) (inr A B b) \ d b" - -lemmas - [form] = SumF and - [intro] = Sum_inl Sum_inr and - [intros] = Sum_inl[rotated] Sum_inr[rotated] and - [elim ?s] = SumE and - [comp] = Sum_comp_inl Sum_comp_inr - -method left = rule Sum_inl -method right = rule Sum_inr - - -section \Empty and unit types\ - -axiomatization - Top :: \o\ and - tt :: \o\ and - TopInd :: \(o \ o) \ o \ o \ o\ -and - Bot :: \o\ and - BotInd :: \(o \ o) \ o \ o\ - -notation Top ("\") and Bot ("\") - -axiomatization where - TopF: "\: U i" and - - TopI: "tt: \" and - - TopE: "\a: \; \x. x: \ \ C x: U i; c: C tt\ \ TopInd (fn x. C x) c a: C a" and - - Top_comp: "\\x. x: \ \ C x: U i; c: C tt\ \ TopInd (fn x. C x) c tt \ c" -and - BotF: "\: U i" and - - BotE: "\x: \; \x. x: \ \ C x: U i\ \ BotInd (fn x. C x) x: C x" - -lemmas - [form] = TopF BotF and - [intro, intros] = TopI and - [elim ?a] = TopE and - [elim ?x] = BotE and - [comp] = Top_comp - - -section \Booleans\ - -definition "Bool \ \ \ \" -definition "true \ inl \ \ tt" -definition "false \ inr \ \ tt" - -Lemma - BoolF: "Bool: U i" and - Bool_true: "true: Bool" and - Bool_false: "false: Bool" - unfolding Bool_def true_def false_def by typechk+ - -\ \Definitions like these should be handled by a future function package\ -Definition ifelse [rotated 1]: - assumes *[unfolded Bool_def true_def false_def]: - "\x. x: Bool \ C x: U i" - "x: Bool" - "a: C true" - "b: C false" - shows "C x" - by (elim x) (elim, rule *)+ - -Lemma if_true: - assumes - "\x. x: Bool \ C x: U i" - "a: C true" - "b: C false" - shows "ifelse C true a b \ a" - unfolding ifelse_def true_def - supply assms[unfolded Bool_def true_def false_def] - by reduce - -Lemma if_false: - assumes - "\x. x: Bool \ C x: U i" - "a: C true" - "b: C false" - shows "ifelse C false a b \ b" - unfolding ifelse_def false_def - supply assms[unfolded Bool_def true_def false_def] - by reduce - -lemmas - [form] = BoolF and - [intro, intros] = Bool_true Bool_false and - [comp] = if_true if_false and - [elim ?x] = ifelse -lemmas - BoolE = ifelse - -subsection \Notation\ - -definition ifelse_i ("if _ then _ else _") - where [implicit]: "if x then a else b \ ifelse ? x a b" - -translations "if x then a else b" \ "CONST ifelse C x a b" - -subsection \Logical connectives\ - -definition not ("!_") where "not x \ ifelse (K Bool) x false true" - - -end -- cgit v1.2.3