diff --git a/graphs/dependency.dot b/graphs/dependency.dot index 4a3e429..2b856c8 100644 --- a/graphs/dependency.dot +++ b/graphs/dependency.dot @@ -37,6 +37,18 @@ digraph theorem_deps { red1r_fv [label="red1r_fv", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="red1r_fv theory/Metatheory.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; lemma_2_1_fv_preserved [label="lemma_2_1_fv_preserved", color="#38761d", fillcolor="#d9ead3", style="rounded,filled", fontcolor="#222222", tooltip="lemma_2_1_fv_preserved (section 2.1) theory/Metatheory.v https://arxiv.org/html/2312.13270v1", shape=box]; lemma_2_3_beta_sim [label="lemma_2_3_beta_sim", color="#38761d", fillcolor="#d9ead3", style="rounded,filled", fontcolor="#222222", tooltip="lemma_2_3_beta_sim (section 2.3) theory/Metatheory.v https://arxiv.org/html/2312.13270v1", shape=box]; + par_red1_iff [label="par_red1_iff", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="par_red1_iff theory/Parallel.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + red1_in_par [label="red1_in_par", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="red1_in_par theory/Parallel.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + par_context [label="par_context", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="par_context theory/Parallel.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + par_to_red1_or_eq [label="par_to_red1_or_eq", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="par_to_red1_or_eq theory/Parallel.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + red1_or_eq_to_par [label="red1_or_eq_to_par", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="red1_or_eq_to_par theory/Parallel.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + par_reflexive [label="par_reflexive", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="par_reflexive theory/Parallel.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + gen_list_length [label="gen_list_length", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="gen_list_length theory/Random.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + check_term_true [label="check_term_true", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="check_term_true theory/Random.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + check_all_true [label="check_all_true", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="check_all_true theory/Random.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + gen_sound [label="gen_sound", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="gen_sound theory/Random.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + gen_complete [label="gen_complete", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="gen_complete theory/Random.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + gen_fv_preserved [label="gen_fv_preserved", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="gen_fv_preserved theory/Random.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; zdecs_sound [label="zdecs_sound", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="zdecs_sound theory/Reduction.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; zdecs_complete [label="zdecs_complete", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="zdecs_complete theory/Reduction.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; positions_at [label="positions_at", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="positions_at theory/Reduction.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; @@ -53,6 +65,26 @@ digraph theorem_deps { has_red_f [label="has_red_f", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="has_red_f theory/Reduction.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; has_red_spec [label="has_red_spec", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="has_red_spec theory/Reduction.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; red1_dec [label="red1_dec", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="red1_dec theory/Reduction.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + open_rec_app [label="open_rec_app", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="open_rec_app theory/Substitution.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + open_rec_lam [label="open_rec_lam", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="open_rec_lam theory/Substitution.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + open_rec_esub [label="open_rec_esub", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="open_rec_esub theory/Substitution.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + close_rec_app [label="close_rec_app", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="close_rec_app theory/Substitution.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + close_rec_lam [label="close_rec_lam", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="close_rec_lam theory/Substitution.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + close_rec_esub [label="close_rec_esub", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="close_rec_esub theory/Substitution.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + subst_app [label="subst_app", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="subst_app theory/Substitution.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + subst_lam [label="subst_lam", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="subst_lam theory/Substitution.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + subst_esub [label="subst_esub", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="subst_esub theory/Substitution.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + subst_notin [label="subst_notin", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="subst_notin theory/Substitution.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + subst_lc_self [label="subst_lc_self", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="subst_lc_self theory/Substitution.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + subst_other [label="subst_other", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="subst_other theory/Substitution.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + red_sub_root_to_red1 [label="red_sub_root_to_red1", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="red_sub_root_to_red1 theory/Subsystem.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + red_sub_to_red1 [label="red_sub_to_red1", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="red_sub_to_red1 theory/Subsystem.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + red_sub_context [label="red_sub_context", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="red_sub_context theory/Subsystem.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + red_sub_gc [label="red_sub_gc", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="red_sub_gc theory/Subsystem.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + red_sub_r [label="red_sub_r", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="red_sub_r theory/Subsystem.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + occurs_zfill [label="occurs_zfill", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="occurs_zfill theory/Subsystem.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + zfill_occurs0 [label="zfill_occurs0", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="zfill_occurs0 theory/Subsystem.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; + R_Gc_disjoint [label="R_Gc_disjoint", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="R_Gc_disjoint theory/Subsystem.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; corpus_sound [label="corpus_sound", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="corpus_sound theory/Tests.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; corpus_complete [label="corpus_complete", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="corpus_complete theory/Tests.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; corpus_decides [label="corpus_decides", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="corpus_decides theory/Tests.v https://arxiv.org/html/2312.13270v1", shape=ellipse]; @@ -84,6 +116,15 @@ digraph theorem_deps { red1r_fv -> lemma_2_1_fv_preserved; Plus_red1_context -> lemma_2_3_beta_sim; lemma_2_2_full_comp -> lemma_2_3_beta_sim; + par_red1_iff -> par_to_red1_or_eq; + par_red1_iff -> red1_or_eq_to_par; + has_red_spec -> check_term_true; + steps_sound_red1 -> check_term_true; + check_term_true -> check_all_true; + steps_sound -> gen_sound; + steps_complete -> gen_complete; + lemma_2_1_fv_preserved -> gen_fv_preserved; + steps_sound_red1 -> gen_fv_preserved; zdecs_sound -> root_steps_sound; zdecs_complete -> root_steps_complete; positions_at -> steps_sound; @@ -99,6 +140,13 @@ digraph theorem_deps { steps_complete -> has_red_spec; steps_sound -> has_red_spec; has_red_spec -> red1_dec; + close_rec_notin -> subst_notin; + open_rec_occurs_false -> subst_notin; + subst_fvar_self -> subst_lc_self; + subst_fvar_other -> subst_other; + red_sub_root_to_red1 -> red_sub_to_red1; + occurs_zfill -> zfill_occurs0; + zfill_occurs0 -> R_Gc_disjoint; steps_sound -> corpus_sound; steps_complete -> corpus_complete; has_red_spec -> corpus_decides; diff --git a/graphs/dependency.png b/graphs/dependency.png index d0955f3..b319001 100644 Binary files a/graphs/dependency.png and b/graphs/dependency.png differ diff --git a/graphs/dependency.svg b/graphs/dependency.svg index a8e5d14..ca398b7 100644 --- a/graphs/dependency.svg +++ b/graphs/dependency.svg @@ -4,25 +4,25 @@ - - + + theorem_deps - -Milner's Lambda-Calculus with Partial Substitutions - theorem dependency (M2) -proved -    -stated -    -planned -    -blocked + +Milner's Lambda-Calculus with Partial Substitutions - theorem dependency (M2) +proved +    +stated +    +planned +    +blocked fvs_lift - -fvs_lift + +fvs_lift @@ -30,38 +30,38 @@ open_rec_fvs - -open_rec_fvs + +open_rec_fvs fvs_lift->open_rec_fvs - - + + fvs_zplug_lift - -fvs_zplug_lift + +fvs_zplug_lift fvs_lift->fvs_zplug_lift - - + + lift_lc - -lift_lc + +lift_lc @@ -69,68 +69,68 @@ lift_0_lc - -lift_0_lc + +lift_0_lc lift_lc->lift_0_lc - - + + subst_fvar_self - -subst_fvar_self + +subst_fvar_self lift_0_lc->subst_fvar_self - - + + open_rec_bvar - -open_rec_bvar + +open_rec_bvar open_rec_bvar->open_rec_fvs - - + + open_close - -open_close + +open_close open_rec_bvar->open_close - - + + close_rec_fvar - -close_rec_fvar + +close_rec_fvar @@ -138,8 +138,8 @@ open_rec_occurs_false - -open_rec_occurs_false + +open_rec_occurs_false @@ -147,47 +147,68 @@ open_rec_zplug_lift - -open_rec_zplug_lift + +open_rec_zplug_lift open_rec_occurs_false->open_rec_zplug_lift - - + + full_comp_aux - -full_comp_aux + +full_comp_aux open_rec_occurs_false->full_comp_aux - - + + + + + +subst_notin + + +subst_notin + + + + + +open_rec_occurs_false->subst_notin + + close_rec_notin - -close_rec_notin + +close_rec_notin + + +close_rec_notin->subst_notin + + + close_rec_fvs - -close_rec_fvs + +close_rec_fvs @@ -195,53 +216,83 @@ subst_fvs - -subst_fvs + +subst_fvs close_rec_fvs->subst_fvs - - + + open_rec_bvar_neq - -open_rec_bvar_neq + +open_rec_bvar_neq open_rec_bvar_neq->open_rec_fvs - - + + open_rec_fvs->subst_fvs - - + + + + + +subst_lc_self + + +subst_lc_self + + + + + +subst_fvar_self->subst_lc_self + + subst_fvar_other - -subst_fvar_other + +subst_fvar_other + + +subst_other + + +subst_other + + + + + +subst_fvar_other->subst_other + + + Plus_red1_context - -Plus_red1_context + +Plus_red1_context @@ -249,23 +300,23 @@ lemma_2_3_beta_sim - -lemma_2_3_beta_sim + +lemma_2_3_beta_sim Plus_red1_context->lemma_2_3_beta_sim - - + + occurs_count_zero - -occurs_count_zero + +occurs_count_zero @@ -273,29 +324,29 @@ occurs_count_pos - -occurs_count_pos + +occurs_count_pos occurs_count_zero->occurs_count_pos - - + + occurs_count_zero->full_comp_aux - - + + occurs_count_false - -occurs_count_false + +occurs_count_false @@ -303,107 +354,107 @@ occurs_count_zfill_plug - -occurs_count_zfill_plug + +occurs_count_zfill_plug occurs_count_false->occurs_count_zfill_plug - - + + occurs_lift_self - -occurs_lift_self + +occurs_lift_self occurs_lift_self->occurs_count_zfill_plug - - + + occurs_lift_self->open_rec_zplug_lift - - + + zdecs_nonempty - -zdecs_nonempty + +zdecs_nonempty zdecs_nonempty->full_comp_aux - - + + occurs_count_zfill_plug->full_comp_aux - - + + open_rec_zplug_lift->full_comp_aux - - + + lemma_2_2_full_comp - -lemma_2_2_full_comp + +lemma_2_2_full_comp full_comp_aux->lemma_2_2_full_comp - - + + lemma_2_2_full_comp->lemma_2_3_beta_sim - - + + red1_root_fv - -red1_root_fv + +red1_root_fv fvs_zplug_lift->red1_root_fv - - + + plug_fv_mono - -plug_fv_mono + +plug_fv_mono @@ -411,343 +462,676 @@ red1r_fv - -red1r_fv + +red1r_fv plug_fv_mono->red1r_fv - - + + red1_root_fv->red1r_fv - - + + lemma_2_1_fv_preserved - -lemma_2_1_fv_preserved + +lemma_2_1_fv_preserved red1r_fv->lemma_2_1_fv_preserved - - + + + + + +gen_fv_preserved + + +gen_fv_preserved + + + + + +lemma_2_1_fv_preserved->gen_fv_preserved + + - + corpus_fv_preserved - - -corpus_fv_preserved + + +corpus_fv_preserved - + lemma_2_1_fv_preserved->corpus_fv_preserved - - + + + + + +par_red1_iff + + +par_red1_iff + + + + + +par_to_red1_or_eq + + +par_to_red1_or_eq + + + + + +par_red1_iff->par_to_red1_or_eq + + + + + +red1_or_eq_to_par + + +red1_or_eq_to_par + + + + + +par_red1_iff->red1_or_eq_to_par + + + + + +red1_in_par + + +red1_in_par + + + + + +par_context + + +par_context + + + + + +par_reflexive + + +par_reflexive + + + + + +gen_list_length + + +gen_list_length + + + + + +check_term_true + + +check_term_true + + + + + +check_all_true + + +check_all_true + + + + + +check_term_true->check_all_true + + + + + +gen_sound + + +gen_sound + + + + + +gen_complete + + +gen_complete + + - + zdecs_sound - - -zdecs_sound + + +zdecs_sound zdecs_sound->full_comp_aux - - + + - + root_steps_sound - - -root_steps_sound + + +root_steps_sound - + zdecs_sound->root_steps_sound - - + + - + zdecs_complete - - -zdecs_complete + + +zdecs_complete - + root_steps_complete - - -root_steps_complete + + +root_steps_complete - + zdecs_complete->root_steps_complete - - + + - + positions_at - - -positions_at + + +positions_at - + steps_sound - - -steps_sound + + +steps_sound - + positions_at->steps_sound - - + + - + root_steps_sound->steps_sound - - + + - + steps_complete - - -steps_complete + + +steps_complete - + root_steps_complete->steps_complete - - + + + + + +steps_sound->gen_sound + + - + steps_sound_red1 - - -steps_sound_red1 + + +steps_sound_red1 - + steps_sound->steps_sound_red1 - - + + - + has_red_spec - - -has_red_spec + + +has_red_spec - + steps_sound->has_red_spec - - + + - + corpus_sound - - -corpus_sound + + +corpus_sound - + steps_sound->corpus_sound - - + + + + + +steps_sound_red1->check_term_true + + + + + +steps_sound_red1->gen_fv_preserved + + - + steps_sound_red1->corpus_fv_preserved - - + + - + positions_hole - - -positions_hole + + +positions_hole - + root_steps_in_steps - - -root_steps_in_steps + + +root_steps_in_steps - + positions_hole->root_steps_in_steps - - + + - + root_steps_in_steps->steps_complete - - + + - + plug_comp - - -plug_comp + + +plug_comp - + plug_comp->steps_complete - - + + - + positions_comp - - -positions_comp + + +positions_comp - + positions_comp->steps_complete - - + + - + at_ctx_comp - - -at_ctx_comp + + +at_ctx_comp - + at_ctx_comp->steps_complete - - + + + + + +steps_complete->gen_complete + + - + steps_complete->has_red_spec - - + + - + corpus_complete - - -corpus_complete + + +corpus_complete - + steps_complete->corpus_complete - - + + - + has_red_f - - -has_red_f + + +has_red_f - + has_red_f->has_red_spec - - + + + + + +has_red_spec->check_term_true + + - + red1_dec - - -red1_dec + + +red1_dec - + has_red_spec->red1_dec - - + + - + corpus_decides - - -corpus_decides + + +corpus_decides - + has_red_spec->corpus_decides - - + + + + + +open_rec_app + + +open_rec_app + + + + + +open_rec_lam + + +open_rec_lam + + + + + +open_rec_esub + + +open_rec_esub + + + + + +close_rec_app + + +close_rec_app + + + + + +close_rec_lam + + +close_rec_lam + + + + + +close_rec_esub + + +close_rec_esub + + + + + +subst_app + + +subst_app + + + + + +subst_lam + + +subst_lam + + + + + +subst_esub + + +subst_esub + + + + + +red_sub_root_to_red1 + + +red_sub_root_to_red1 + + + + + +red_sub_to_red1 + + +red_sub_to_red1 + + + + + +red_sub_root_to_red1->red_sub_to_red1 + + + + + +red_sub_context + + +red_sub_context + + + + + +red_sub_gc + + +red_sub_gc + + + + + +red_sub_r + + +red_sub_r + + + + + +occurs_zfill + + +occurs_zfill + + + + + +zfill_occurs0 + + +zfill_occurs0 + + + + + +occurs_zfill->zfill_occurs0 + + + + + +R_Gc_disjoint + + +R_Gc_disjoint + + + + + +zfill_occurs0->R_Gc_disjoint + + diff --git a/graphs/theorems.json b/graphs/theorems.json index 5f664a4..d0844ea 100644 --- a/graphs/theorems.json +++ b/graphs/theorems.json @@ -9,6 +9,7 @@ "html": "https://arxiv.org/html/2312.13270v1" }, "milestones": [ + "M0", "M1", "M2" ], @@ -356,6 +357,142 @@ "lemma_2_2_full_comp" ] }, + { + "id": "par_red1_iff", + "label": "par_red1_iff", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Parallel.v", + "depends": [] + }, + { + "id": "red1_in_par", + "label": "red1_in_par", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Parallel.v", + "depends": [] + }, + { + "id": "par_context", + "label": "par_context", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Parallel.v", + "depends": [] + }, + { + "id": "par_to_red1_or_eq", + "label": "par_to_red1_or_eq", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Parallel.v", + "depends": [ + "par_red1_iff" + ] + }, + { + "id": "red1_or_eq_to_par", + "label": "red1_or_eq_to_par", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Parallel.v", + "depends": [ + "par_red1_iff" + ] + }, + { + "id": "par_reflexive", + "label": "par_reflexive", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Parallel.v", + "depends": [] + }, + { + "id": "gen_list_length", + "label": "gen_list_length", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Random.v", + "depends": [] + }, + { + "id": "check_term_true", + "label": "check_term_true", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Random.v", + "depends": [ + "has_red_spec", + "steps_sound_red1" + ] + }, + { + "id": "check_all_true", + "label": "check_all_true", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Random.v", + "depends": [ + "check_term_true" + ] + }, + { + "id": "gen_sound", + "label": "gen_sound", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Random.v", + "depends": [ + "steps_sound" + ] + }, + { + "id": "gen_complete", + "label": "gen_complete", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Random.v", + "depends": [ + "steps_complete" + ] + }, + { + "id": "gen_fv_preserved", + "label": "gen_fv_preserved", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Random.v", + "depends": [ + "lemma_2_1_fv_preserved", + "steps_sound_red1" + ] + }, { "id": "zdecs_sound", "label": "zdecs_sound", @@ -539,6 +676,219 @@ "has_red_spec" ] }, + { + "id": "open_rec_app", + "label": "open_rec_app", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Substitution.v", + "depends": [] + }, + { + "id": "open_rec_lam", + "label": "open_rec_lam", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Substitution.v", + "depends": [] + }, + { + "id": "open_rec_esub", + "label": "open_rec_esub", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Substitution.v", + "depends": [] + }, + { + "id": "close_rec_app", + "label": "close_rec_app", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Substitution.v", + "depends": [] + }, + { + "id": "close_rec_lam", + "label": "close_rec_lam", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Substitution.v", + "depends": [] + }, + { + "id": "close_rec_esub", + "label": "close_rec_esub", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Substitution.v", + "depends": [] + }, + { + "id": "subst_app", + "label": "subst_app", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Substitution.v", + "depends": [] + }, + { + "id": "subst_lam", + "label": "subst_lam", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Substitution.v", + "depends": [] + }, + { + "id": "subst_esub", + "label": "subst_esub", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Substitution.v", + "depends": [] + }, + { + "id": "subst_notin", + "label": "subst_notin", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Substitution.v", + "depends": [ + "close_rec_notin", + "open_rec_occurs_false" + ] + }, + { + "id": "subst_lc_self", + "label": "subst_lc_self", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Substitution.v", + "depends": [ + "subst_fvar_self" + ] + }, + { + "id": "subst_other", + "label": "subst_other", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Substitution.v", + "depends": [ + "subst_fvar_other" + ] + }, + { + "id": "red_sub_root_to_red1", + "label": "red_sub_root_to_red1", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Subsystem.v", + "depends": [] + }, + { + "id": "red_sub_to_red1", + "label": "red_sub_to_red1", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Subsystem.v", + "depends": [ + "red_sub_root_to_red1" + ] + }, + { + "id": "red_sub_context", + "label": "red_sub_context", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Subsystem.v", + "depends": [] + }, + { + "id": "red_sub_gc", + "label": "red_sub_gc", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Subsystem.v", + "depends": [] + }, + { + "id": "red_sub_r", + "label": "red_sub_r", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Subsystem.v", + "depends": [] + }, + { + "id": "occurs_zfill", + "label": "occurs_zfill", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Subsystem.v", + "depends": [] + }, + { + "id": "zfill_occurs0", + "label": "zfill_occurs0", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Subsystem.v", + "depends": [ + "occurs_zfill" + ] + }, + { + "id": "R_Gc_disjoint", + "label": "R_Gc_disjoint", + "kind": "infra", + "status": "proved", + "milestone": "M0", + "section": "", + "file": "theory/Subsystem.v", + "depends": [ + "zfill_occurs0" + ] + }, { "id": "corpus_sound", "label": "corpus_sound", diff --git a/scripts/audit.sh b/scripts/audit.sh index 4728d89..e4a5ec5 100755 --- a/scripts/audit.sh +++ b/scripts/audit.sh @@ -35,7 +35,7 @@ done < <(find theory -name '*.v' -print0 2>/dev/null) echo "== Print Assumptions ==" WORK="$(mktemp -d ./.audit-work.XXXXXX)" cp theory/*.v "$WORK"/ -for f in ExecReducer Binding Reduction Metatheory Subsystem Substitution Parallel Tests; do +for f in ExecReducer Binding Reduction Metatheory Subsystem Substitution Parallel Tests Random; do echo "-- $f" out="$(rocq compile -Q "$WORK" LambdaSub "$WORK/$f.v" 2>&1 || true)" echo "$out" diff --git a/scripts/samplecheck.sh b/scripts/samplecheck.sh new file mode 100755 index 0000000..3c661e8 --- /dev/null +++ b/scripts/samplecheck.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -euo pipefail +ROOT="$(cd "$(dirname "$0")/.." && pwd)" +cd "$ROOT" + +if ! command -v rocq >/dev/null 2>&1; then + if command -v opam >/dev/null 2>&1; then + eval "$(opam env --switch=rocq-system --set-switch 2>/dev/null || true)" + fi +fi + +if ! command -v rocq >/dev/null 2>&1; then + echo "rocq not on PATH; run: eval \$(opam env --switch=rocq-system --set-switch)" >&2 + exit 1 +fi + +dune build +./scripts/audit.sh +echo "SAMPLE CHECK OK: 16 generated terms checked against red1 by theory/Random.v" diff --git a/theory/Random.v b/theory/Random.v new file mode 100644 index 0000000..f615b43 --- /dev/null +++ b/theory/Random.v @@ -0,0 +1,85 @@ +From Stdlib Require Import List Bool Arith Lia PeanoNat. +Import ListNotations. +From LambdaSub Require Import ExecReducer Binding Reduction Metatheory Subsystem Substitution Parallel. + +Definition next (s : nat) : nat := (s * 3 + 1) mod 97. + +Fixpoint gen (fuel : nat) (s : nat) : trm * nat := + match fuel with + | 0 => (FVar (s mod 5), next s) + | S f => + match next s mod 6 with + | 0 => (FVar (next s mod 5), next (next s)) + | 1 => let (a, s1) := gen f (next s) in + let (b, s2) := gen f s1 in (App a b, next s2) + | 2 => let (a, s1) := gen f (next s) in (Lam a, next s1) + | 3 => let (a, s1) := gen f (next s) in + let (b, s2) := gen f s1 in (ESub a b, next s2) + | 4 => (BVar (next s mod 3), next (next s)) + | _ => (FVar (next s mod 5), next (next s)) + end + end. + +Fixpoint gen_list (count : nat) (s : nat) : list trm := + match count with + | 0 => [] + | S c => let (t, s') := gen 3 s in t :: gen_list c s' + end. + +Lemma gen_list_length : forall count s, length (gen_list count s) = count. +Proof. + induction count; intros s. + - reflexivity. + - cbn [gen_list]. + destruct (gen 3 s) as [t s']. + cbn [length]. + rewrite IHcount. reflexivity. +Qed. + +Definition check_term (t : trm) : bool := + forallb (fun p => has_red t (snd p)) (steps t). + +Definition check_all (l : list trm) : bool := forallb check_term l. + +Lemma check_term_true : forall t, check_term t = true. +Proof. + intros t. unfold check_term. + apply forallb_forall. intros [r s] Hp. + apply has_red_spec. exact (steps_sound_red1 t r s Hp). +Qed. + +Lemma check_all_true : forall l, check_all l = true. +Proof. + intros l. unfold check_all. + apply forallb_forall. intros t _. apply check_term_true. +Qed. + +Example sample_agreement : check_all (gen_list 16 7) = true. +Proof. apply check_all_true. Qed. + +Example sample_length : length (gen_list 16 7) = 16. +Proof. apply gen_list_length. Qed. + +Lemma gen_sound : forall count seed t, In t (gen_list count seed) -> + forall p, In p (steps t) -> red1r (fst p) t (snd p). +Proof. intros count seed t _ [r s] Hp. apply steps_sound. exact Hp. Qed. + +Lemma gen_complete : forall count seed t r t', In t (gen_list count seed) -> + red1r r t t' -> In (r,t') (steps t). +Proof. intros count seed t r t' _ H. apply steps_complete. exact H. Qed. + +Lemma gen_fv_preserved : forall count seed t p, In t (gen_list count seed) -> + In p (steps t) -> incl (fvs (snd p)) (fvs t). +Proof. + intros count seed t [r s] _ H. simpl. + apply (lemma_2_1_fv_preserved t s). exact (steps_sound_red1 t r s H). +Qed. + +Print Assumptions gen_list_length. +Print Assumptions check_term_true. +Print Assumptions check_all_true. +Print Assumptions sample_agreement. +Print Assumptions sample_length. +Print Assumptions gen_sound. +Print Assumptions gen_complete. +Print Assumptions gen_fv_preserved.