This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Definition sig_fst {A B} {p q : {x : A | B x}} (H : p = q) | |
| : proj1_sig p = proj1_sig q := | |
| eq_rect _ (fun z => proj1_sig p = proj1_sig z) eq_refl _ H. | |
| Definition sig_snd {A B} {p q : {x : A | B x}} (H : p = q) | |
| : eq_rect _ B (proj2_sig p) _ (sig_fst H) = proj2_sig q := | |
| match H with | |
| | eq_refl => eq_refl | |
| end. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Definition sig_fst {A B} {p q : {x : A | B x}} (H : p = q) | |
| : proj1_sig p = proj1_sig q := | |
| eq_rect _ (fun z => proj1_sig p = proj1_sig z) eq_refl _ H. | |
| Definition sig_snd {A B} {p q : {x : A | B x}} (H : p = q) | |
| : eq_rect _ B (proj2_sig p) _ (sig_fst H) = proj2_sig q := | |
| match H with | |
| | eq_refl => eq_refl | |
| end. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Definition sig_fst {A B} {p q : {x : A | B x}} (H : p = q) | |
| : proj1_sig p = proj1_sig q := | |
| eq_rect _ (fun z => proj1_sig p = proj1_sig z) eq_refl _ H. | |
| Definition sig_snd {A B} {p q : {x : A | B x}} (H : p = q) | |
| : eq_rect _ B (proj2_sig p) _ (sig_fst H) = proj2_sig q := | |
| match H with | |
| | eq_refl => eq_refl | |
| end. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Definition sig_fst {A B} {p q : {x : A & B x}} (H : p = q) | |
| : projT1 p = projT1 q := | |
| eq_rect _ (fun z => projT1 p = projT1 z) eq_refl _ H. | |
| Definition sig_snd {A B} {p q : {x : A & B x}} (H : p = q) | |
| : eq_rect _ B (projT2 p) _ (sig_fst H) = projT2 q := | |
| match H with | |
| | eq_refl => eq_refl | |
| end. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Definition sig_fst {A B} {p q : {x : A | B x}} (H : p = q) | |
| : proj1_sig p = proj1_sig q := | |
| eq_rect _ (fun z => proj1_sig p = proj1_sig z) eq_refl _ H. | |
| Definition sig_snd {A B} {p q : {x : A | B x}} (H : p = q) | |
| : eq_rect _ B (proj2_sig p) _ (sig_fst H) = proj2_sig q := | |
| match H with | |
| | eq_refl => eq_refl | |
| end. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type term = T_var of var | T_lambda of var * term | T_apply of term * term | |
| and var = { mutable to_ : term } | |
| let v_with var ~to_ k = | |
| let prev = var.to_ in | |
| var.to_ <- to_; | |
| let value = k () in | |
| var.to_ <- prev; | |
| value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type index = int | |
| type term = | |
| | T_var of index | |
| | T_lambda of term lazy_t | |
| | T_apply of term lazy_t * term lazy_t | |
| let rec shift ~by ~depth term = | |
| match term with | |
| | T_var var -> ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (* | |
| Start with an environment based interpreter that does | |
| all the reductions, including under lambdas. | |
| Then make everything not on the head path lazy. | |
| When you go to evaluate everything on the side, | |
| you force the head producing a potentially stuck value | |
| and then apply the new environment, progressing further. | |
| Lazy act like graph sharing for every reduction on the side. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (* | |
| Start with an environment based interpreter that does | |
| all the reductions, including under lambdas. | |
| Then make everything not on the head path lazy. | |
| When you go to evaluate everything on the side, | |
| you force the head producing a potentially stuck value | |
| and then apply the new environment, progressing further. | |
| Lazy acts like graph sharing for reductions on the side. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (* this whole thing is a sketch *) | |
| type var = int [@@deriving show { with_path = false }] | |
| type term = | |
| | T_var of var | |
| | T_let of var * term * term | |
| | T_lambda of var * term | |
| | T_apply of term * term | |
| | T_reify of thunk |
NewerOlder