From 76b57317d7568f4dcd673b1b8085601c6c723355 Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Mon, 11 Feb 2019 22:44:21 +0100 Subject: Organize this commit as a backup of the work on type inference done so far; learnt that I probably need to take a different approach. In particular, should first make the constants completely monomorphic, and then work on full proper type inference, rather than the heuristic approach taken here. --- Prod.thy | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'Prod.thy') diff --git a/Prod.thy b/Prod.thy index 05eff43..4235793 100644 --- a/Prod.thy +++ b/Prod.thy @@ -18,13 +18,13 @@ axiomatization \ \Application should bind tighter than abstraction.\ syntax - "_Prod" :: "[idt, t, t] \ t" ("(3TT '(_: _')./ _)" 30) - "_Prod'" :: "[idt, t, t] \ t" ("(3TT _: _./ _)" 30) + "_Prod" :: "[idt, t, t] \ t" ("(3\'(_: _')./ _)" 30) + "_Prod'" :: "[idt, t, t] \ t" ("(3\_: _./ _)" 30) "_lam" :: "[idt, t, t] \ t" ("(3\'(_: _')./ _)" 30) "_lam'" :: "[idt, t, t] \ t" ("(3\_: _./ _)" 30) translations - "TT(x: A). B" \ "(CONST Prod) A (\x. B)" - "TT x: A. B" \ "(CONST Prod) A (\x. B)" + "\(x: A). B" \ "(CONST Prod) A (\x. B)" + "\x: A. B" \ "(CONST Prod) A (\x. B)" "\(x: A). b" \ "(CONST lam) A (\x. b)" "\x: A. b" \ "(CONST lam) A (\x. b)" @@ -35,25 +35,25 @@ The syntax translations above bind the variable @{term x} in the expressions @{t text \Non-dependent functions are a special case:\ abbreviation Fun :: "[t, t] \ t" (infixr "\" 40) -where "A \ B \ TT(_: A). B" +where "A \ B \ \(_: A). B" axiomatization where \ \Type rules\ - Prod_form: "\A: U i; B: A \ U i\ \ TT x: A. B x: U i" and + Prod_form: "\A: U i; B: A \ U i\ \ \x: A. B x: U i" and - Prod_intro: "\A: U i; \x. x: A \ b x: B x\ \ \x: A. b x: TT x: A. B x" and + Prod_intro: "\A: U i; \x. x: A \ b x: B x\ \ \x: A. b x: \x: A. B x" and - Prod_elim: "\f: TT x: A. B x; a: A\ \ f`a: B a" and + Prod_elim: "\f: \x: A. B x; a: A\ \ f`a: B a" and Prod_cmp: "\\x. x: A \ b x: B x; a: A\ \ (\x: A. b x)`a \ b a" and - Prod_uniq: "f: TT x: A. B x \ \x: A. f`x \ f" and + Prod_uniq: "f: \x: A. B x \ \x: A. f`x \ f" and \ \Congruence rules\ Prod_form_eq: "\A: U i; B: A \ U i; C: A \ U i; \x. x: A \ B x \ C x\ - \ TT x: A. B x \ TT x: A. C x" and + \ \x: A. B x \ \x: A. C x" and Prod_intro_eq: "\\x. x: A \ b x \ c x; A: U i\ \ \x: A. b x \ \x: A. c x" @@ -107,14 +107,14 @@ print_translation \ let fun compose_tr' ctxt [A, g, f] = if Config.get ctxt pretty_compose then Syntax.const @{syntax_const "_compose"} $ g $ f - else Const ("compose", Syntax.read_typ ctxt "t \ t \ t") $ A $ g $ f + else @{const compose} $ A $ g $ f in [(@{const_syntax compose}, compose_tr')] end \ lemma compose_assoc: - assumes "A: U i" and "f: A \ B" and "g: B \ C" and "h: TT x: C. D x" + assumes "A: U i" and "f: A \ B" and "g: B \ C" and "h: \x: C. D x" shows "compose A (compose B h g) f \ compose A h (compose A g f)" by (derive lems: assms cong) -- cgit v1.2.3