commit 1fe10f27fface9c05c9eb9a601df3c41ad174076 Author: Laureηt Date: Sat Jun 10 20:56:24 2023 +0200 init diff --git a/BE2019/.Naturelle.aux b/BE2019/.Naturelle.aux new file mode 100755 index 0000000..5aa4821 --- /dev/null +++ b/BE2019/.Naturelle.aux @@ -0,0 +1,69 @@ +COQAUX1 b99e0673e480d281145bd0be828a8006 /home/lfainsin/1A/Modé/BE2019/Naturelle.v +383 387 proof_build_time "0.000" +0 0 E_imp_th "0.000" +383 387 context_used "" +383 387 proof_check_time "0.000" +0 0 VernacProof "tac:no using:no" +916 920 proof_build_time "0.000" +0 0 E_forall_th "0.000" +916 920 context_used "" +916 920 proof_check_time "0.000" +1291 1295 proof_build_time "0.001" +0 0 E_et_g_th "0.001" +1291 1295 context_used "" +1291 1295 proof_check_time "0.000" +1601 1605 proof_build_time "0.001" +0 0 E_et_d_th "0.001" +1601 1605 context_used "" +1601 1605 proof_check_time "0.000" +1983 1987 proof_build_time "0.001" +0 0 E_ou_th "0.001" +1983 1987 context_used "" +1983 1987 proof_check_time "0.000" +0 0 VernacProof "tac:no using:no" +2806 2810 proof_build_time "0.001" +0 0 E_exists_th "0.001" +2806 2810 context_used "" +2806 2810 proof_check_time "0.000" +3280 3284 proof_build_time "0.000" +0 0 E_antiT_th "0.000" +3280 3284 context_used "" +3280 3284 proof_check_time "0.000" +3502 3506 proof_build_time "0.001" +0 0 I_antiT_th "0.001" +3502 3506 context_used "" +3502 3506 proof_check_time "0.000" +3683 3687 proof_build_time "0.000" +0 0 I_non_th "0.000" +3683 3687 context_used "" +3683 3687 proof_check_time "0.000" +4135 4158 context_used "" +4135 4158 context_used "" +4135 4158 context_used "" +0 0 VernacProof "tac:no using:no" +4398 4402 proof_build_time "0.003" +0 0 Yoga "0.003" +4398 4402 context_used "" +4398 4402 proof_check_time "0.000" +4404 4428 context_used "" +4404 4428 context_used "" +4557 4561 proof_build_time "0.001" +0 0 contra "0.001" +4557 4561 context_used "" +4557 4561 proof_check_time "0.000" +4642 4646 proof_build_time "0.001" +0 0 P2nnP "0.001" +4642 4646 context_used "" +4642 4646 proof_check_time "0.000" +4731 4735 proof_build_time "0.001" +0 0 nnP2P "0.001" +4731 4735 context_used "" +4731 4735 proof_check_time "0.000" +4737 4755 context_used "" +4756 4786 context_used "" +0 0 VernacProof "tac:no using:no" +4984 4988 proof_build_time "0.002" +0 0 Swap "0.002" +4984 4988 context_used "" +4984 4988 proof_check_time "0.000" +0 0 vo_compile_time "0.617" diff --git a/BE2019/Naturelle.glob b/BE2019/Naturelle.glob new file mode 100755 index 0000000..db0c96e --- /dev/null +++ b/BE2019/Naturelle.glob @@ -0,0 +1,254 @@ +DIGEST b99e0673e480d281145bd0be828a8006 +FNaturelle +R15:23 Coq.Logic.Classical <> <> lib +R97:100 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R97:100 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R218:221 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R218:221 Coq.Init.Logic <> ::type_scope:x_'->'_x not +prf 278:285 <> E_imp_th +R314:314 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R325:329 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R333:336 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R337:339 Naturelle <> psi var +R330:332 Naturelle <> phi var +R318:321 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R322:324 Naturelle <> psi var +R315:317 Naturelle <> phi var +R443:450 Naturelle <> E_imp_th thm +R521:528 Naturelle <> E_imp_th thm +prf 816:826 <> E_forall_th +R856:859 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R855:855 Naturelle <> A var +R869:869 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R885:889 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R890:892 Naturelle <> phi var +R894:894 Naturelle <> a var +R880:882 Naturelle <> phi var +R884:884 Naturelle <> x var +R996:1006 Naturelle <> E_forall_th thm +R1086:1089 Coq.Init.Logic <> ::type_scope:x_'/\'_x not +R1086:1089 Coq.Init.Logic <> ::type_scope:x_'/\'_x not +R1105:1108 Coq.Init.Logic <> conj constr +prf 1157:1165 <> E_et_g_th +R1194:1194 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1205:1209 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1210:1212 Naturelle <> phi var +R1198:1201 Coq.Init.Logic <> ::type_scope:x_'/\'_x not +R1195:1197 Naturelle <> phi var +R1202:1204 Naturelle <> psi var +R1352:1360 Naturelle <> E_et_g_th thm +R1432:1440 Naturelle <> E_et_g_th thm +prf 1465:1473 <> E_et_d_th +R1502:1502 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1513:1517 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1518:1520 Naturelle <> psi var +R1506:1509 Coq.Init.Logic <> ::type_scope:x_'/\'_x not +R1503:1505 Naturelle <> phi var +R1510:1512 Naturelle <> psi var +R1662:1670 Naturelle <> E_et_d_th thm +R1743:1751 Naturelle <> E_et_d_th thm +prf 1776:1782 <> E_ou_th +R1815:1815 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1826:1830 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1831:1831 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1842:1846 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1847:1847 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1858:1862 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1863:1865 Naturelle <> chi var +R1851:1854 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1855:1857 Naturelle <> chi var +R1848:1850 Naturelle <> psi var +R1835:1838 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1839:1841 Naturelle <> chi var +R1832:1834 Naturelle <> phi var +R1819:1822 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R1816:1818 Naturelle <> phi var +R1823:1825 Naturelle <> psi var +R2042:2048 Naturelle <> E_ou_th thm +R2124:2130 Naturelle <> E_ou_th thm +R2194:2197 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R2194:2197 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R2213:2221 Coq.Init.Logic <> or_introl constr +R2305:2308 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R2305:2308 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R2324:2332 Coq.Init.Logic <> or_intror constr +R2416:2423 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2430:2433 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2439:2439 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2438:2438 Naturelle <> x var +R2416:2423 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2430:2433 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2439:2439 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2438:2438 Naturelle <> x var +R2453:2460 Coq.Init.Logic <> ex_intro constr +R2561:2568 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2575:2578 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2584:2584 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2583:2583 Naturelle <> x var +R2561:2568 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2575:2578 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2584:2584 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2583:2583 Naturelle <> x var +R2597:2604 Coq.Init.Logic <> ex_intro constr +prf 2669:2679 <> E_exists_th +R2709:2712 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2708:2708 Naturelle <> A var +R2733:2733 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2749:2753 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2754:2754 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2777:2781 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2782:2784 Naturelle <> chi var +R2770:2773 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2774:2776 Naturelle <> chi var +R2765:2767 Naturelle <> phi var +R2769:2769 Naturelle <> a var +R2734:2740 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2742:2743 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2744:2746 Naturelle <> phi var +R2748:2748 Naturelle <> x var +R2963:2973 Naturelle <> E_exists_th thm +R3083:3085 Coq.Init.Logic <> not def +R3116:3120 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R3132:3132 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R3123:3126 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3127:3131 Coq.Init.Logic <> False ind +R3116:3120 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R3132:3132 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R3123:3126 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3127:3131 Coq.Init.Logic <> False ind +R3145:3151 Coq.Logic.Classical_Prop <> classic prfax +prf 3209:3218 <> E_antiT_th +R3248:3251 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3252:3254 Naturelle <> phi var +R3243:3247 Coq.Init.Logic <> False ind +R3340:3349 Naturelle <> E_antiT_th thm +prf 3370:3379 <> I_antiT_th +R3407:3410 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3411:3411 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3416:3420 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3421:3425 Coq.Init.Logic <> False ind +R3412:3412 Coq.Init.Logic <> ::type_scope:'~'_x not +R3413:3415 Naturelle <> phi var +R3404:3406 Naturelle <> phi var +R3435:3437 Coq.Init.Logic <> not def +R3551:3555 Coq.Init.Logic <> False ind +R3551:3555 Coq.Init.Logic <> False ind +R3567:3576 Naturelle <> I_antiT_th thm +prf 3598:3605 <> I_non_th +R3630:3630 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3643:3647 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3648:3648 Coq.Init.Logic <> ::type_scope:'~'_x not +R3649:3651 Naturelle <> phi var +R3634:3637 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3638:3642 Coq.Init.Logic <> False ind +R3631:3633 Naturelle <> phi var +R3669:3671 Coq.Init.Logic <> not def +R3730:3731 Coq.Init.Logic <> ::type_scope:'~'_x not +R3730:3731 Coq.Init.Logic <> ::type_scope:'~'_x not +R3745:3752 Naturelle <> I_non_th thm +R3801:3810 Naturelle <> I_antiT_th thm +R3875:3878 Coq.Logic.Classical_Prop <> NNPP thm +var 4144:4144 <> E +var 4146:4146 <> Y +var 4148:4148 <> R +prf 4168:4171 <> Yoga +R4175:4175 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4203:4207 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4210:4213 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4214:4214 Coq.Init.Logic <> ::type_scope:'~'_x not +R4215:4215 Naturelle <> E defax +R4208:4208 Coq.Init.Logic <> ::type_scope:'~'_x not +R4209:4209 Naturelle <> R defax +R4176:4176 Coq.Init.Logic <> ::type_scope:x_'/\'_x not +R4190:4195 Coq.Init.Logic <> ::type_scope:x_'/\'_x not +R4202:4202 Coq.Init.Logic <> ::type_scope:x_'/\'_x not +R4178:4182 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4189:4189 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4184:4187 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R4183:4183 Naturelle <> Y defax +R4188:4188 Naturelle <> R defax +R4177:4177 Naturelle <> E defax +R4197:4200 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4201:4201 Naturelle <> R defax +R4196:4196 Naturelle <> Y defax +R4263:4263 Naturelle <> R defax +R4272:4272 Naturelle <> Y defax +R4274:4274 Naturelle <> R defax +R4285:4285 Naturelle <> E defax +R4300:4303 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4304:4304 Naturelle <> R defax +R4299:4299 Naturelle <> Y defax +R4300:4303 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4304:4304 Naturelle <> R defax +R4299:4299 Naturelle <> Y defax +R4343:4346 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4348:4351 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R4347:4347 Naturelle <> Y defax +R4352:4352 Naturelle <> R defax +R4342:4342 Naturelle <> E defax +R4343:4346 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4348:4351 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R4347:4347 Naturelle <> Y defax +R4352:4352 Naturelle <> R defax +R4342:4342 Naturelle <> E defax +var 4413:4415 <> phi +var 4417:4419 <> psi +prf 4438:4443 <> contra +R4447:4447 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4458:4463 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4476:4476 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4468:4471 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4472:4472 Coq.Init.Logic <> ::type_scope:'~'_x not +R4473:4475 Naturelle <> phi defax +R4464:4464 Coq.Init.Logic <> ::type_scope:'~'_x not +R4465:4467 Naturelle <> psi defax +R4451:4454 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4455:4457 Naturelle <> psi defax +R4448:4450 Naturelle <> phi defax +R4517:4519 Naturelle <> psi defax +R4528:4530 Naturelle <> phi defax +prf 4571:4575 <> P2nnP +R4582:4585 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4586:4586 Coq.Init.Logic <> ::type_scope:'~'_x not +R4587:4587 Coq.Init.Logic <> ::type_scope:'~'_x not +R4588:4590 Naturelle <> phi defax +R4579:4581 Naturelle <> phi defax +R4621:4623 Naturelle <> phi defax +prf 4656:4660 <> nnP2P +R4670:4673 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4674:4676 Naturelle <> phi defax +R4664:4664 Coq.Init.Logic <> ::type_scope:'~'_x not +R4665:4666 Coq.Init.Logic <> ::type_scope:'~'_x not +R4667:4669 Naturelle <> phi defax +R4708:4708 Coq.Init.Logic <> ::type_scope:'~'_x not +R4709:4711 Naturelle <> phi defax +R4708:4708 Coq.Init.Logic <> ::type_scope:'~'_x not +R4709:4711 Naturelle <> phi defax +var 4746:4746 <> A +var 4765:4767 <> chi +R4772:4775 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4777:4780 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4776:4776 Naturelle <> A defax +R4771:4771 Naturelle <> A defax +prf 4796:4799 <> Swap +R4803:4803 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4831:4836 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4864:4864 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R4847:4853 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R4855:4856 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R4857:4859 Naturelle <> chi defax +R4863:4863 Naturelle <> y var +R4861:4861 Naturelle <> x var +R4804:4810 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R4812:4813 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R4824:4826 Naturelle <> chi defax +R4830:4830 Naturelle <> y var +R4828:4828 Naturelle <> x var +R4926:4926 Naturelle <> A defax +R4929:4931 Naturelle <> chi defax +R4935:4935 Naturelle <> y var +R4933:4933 Naturelle <> x var +R4926:4926 Naturelle <> A defax +R4929:4931 Naturelle <> chi defax +R4935:4935 Naturelle <> y var +R4933:4933 Naturelle <> x var diff --git a/BE2019/Naturelle.v b/BE2019/Naturelle.v new file mode 100755 index 0000000..47b0dd7 --- /dev/null +++ b/BE2019/Naturelle.v @@ -0,0 +1,292 @@ +Require Export Classical. + +Ltac Hyp Nom := exact Nom. + +Ltac I_imp' := + match goal with + | |- ?A -> ?B => let hyp := fresh "H" in intro hyp + | _ => fail + end. + +Ltac I_imp Nom := + match goal with + | |- ?A -> ?B => intro Nom + | _ => fail + end. + +Theorem E_imp_th : forall (phi psi : Prop), (phi -> psi) -> phi -> psi. +intros Pphi Ppsi Hphi2psi. +Hyp Hphi2psi. +Qed. + +Ltac E_imp' := + match goal with + | |- ?P => eapply (E_imp_th _ P) + end. + +Ltac E_imp phi := + match goal with + | |- ?P => apply (E_imp_th phi P) + end. + +Ltac I_forall' := + match goal with + | |- forall (x : ?A), ?P => let hyp := fresh x in intro hyp + | _ => fail + end. + +Ltac I_forall Nom := + match goal with + | |- forall (x : ?A), ?P => intro Nom + | _ => fail + end. + +Theorem E_forall_th : forall (A : Type) (phi : A -> Prop) a, (forall x, phi x) -> phi a. +Proof. +firstorder. +Qed. + +Ltac E_forall x := + pattern x; + match goal with + | |- (?P x) => apply (E_forall_th _ P x) + | _ => fail + end. + +Ltac I_et := + match goal with + | |- (?A /\ ?B) => apply (@conj A B) + | _ => fail + end. + +Theorem E_et_g_th : forall (phi psi : Prop), (phi /\ psi) -> phi. +intros Pphi Ppsi Hphi_et_psi. +elim Hphi_et_psi. +intros Hphi Hpsi. +Hyp Hphi. +Qed. + +Ltac E_et_g' := + match goal with + | |- ?P => eapply (E_et_g_th P _) + end. + +Ltac E_et_g psi := + match goal with + | |- ?P => apply (E_et_g_th P psi) + end. + +Theorem E_et_d_th : forall (phi psi : Prop), (phi /\ psi) -> psi. +intros Pphi Ppsi H_phi_et_psi. +elim H_phi_et_psi. +intros Hphi Hpsi. +Hyp Hpsi. +Qed. + +Ltac E_et_d' := + match goal with + | |- ?P => eapply (E_et_d_th _ P) + end. + +Ltac E_et_d phi := + match goal with + | |- ?P => eapply (E_et_d_th phi P) + end. + +Theorem E_ou_th : forall (phi psi chi : Prop), (phi \/ psi) -> (phi -> chi) -> (psi -> chi) -> chi. +intros Pphi Ppsi Pchi Hphi_ou_psi Hphi_imp_chi Hpsi_imp_chi. +elim Hphi_ou_psi. +Hyp Hphi_imp_chi. +Hyp Hpsi_imp_chi. +Qed. + +Ltac E_ou' := + match goal with + | |- ?P => eapply (E_ou_th _ _ P) + end. + +Ltac E_ou phi psi := + match goal with + | |- ?P => apply (E_ou_th phi psi P) + end. + +Ltac I_ou_g := + match goal with + | |- (?A \/ ?B) => apply (@or_introl A B) + | _ => fail + end. + +Ltac I_ou_d := + match goal with + | |- (?A \/ ?B) => apply (@or_intror A B) + | _ => fail + end. + +Ltac I_exists' := + match goal with + | |- exists (x : ?A), (@?P x) => eapply (@ex_intro A P _) + | _ => fail + end. + +Ltac I_exists t := + match goal with + | |- exists (x : ?A), (@?P x) => apply (@ex_intro _ P t) + | _ => fail + end. + +Theorem E_exists_th : forall (A : Type) (phi : A -> Prop) (chi : Prop), (exists x, phi x) -> (forall a, phi a -> chi) -> chi. +Proof. +firstorder. +Qed. +(* +Ltac E_exists phi := + match goal with + | |- ?P => apply (E_exists_th _ phi P) + end. +*) +Ltac E_exists phi := + match goal with + | |- ?P => apply (E_exists_th _ phi P); [ idtac | let t := fresh "t" in let ht := fresh "Ht" in intros t ht ] + end. + +Ltac TE := + unfold not; + match goal with + | |- (?P \/ (?P -> False)) => exact (classic P) + | _ => fail + end. + +Theorem E_antiT_th : forall (phi : Prop), False -> phi. +intros Pphi F. +elim F. +Qed. + +Ltac E_antiT := + match goal with + | |- ?P => apply (E_antiT_th P) + end. + +Theorem I_antiT_th : forall (phi : Prop), phi -> (~phi) -> False. +unfold not. +intro Pphi. +intros Hphi Hnphi. +cut Pphi. +Hyp Hnphi. +Hyp Hphi. +Qed. + +Ltac I_antiT phi := + match goal with + | |- False => apply (I_antiT_th phi) + end. + +Theorem I_non_th : forall (phi : Prop), (phi -> False) -> ~phi. +intros. +unfold not. +exact H. +Qed. + +Ltac I_non Nom := + match goal with + | |- ~ ?P => apply (I_non_th P); intro Nom + end. + +Ltac E_non phi := + apply (I_antiT_th phi). + +Ltac absurde Nom := + match goal with + | |- ?P => apply (NNPP P); intro Nom + end. + +(* +Ltac I_antiT phi := apply (I_antiT_th phi). + +Ltac absurde Nom phi := +match goal with +| |- phi => +cut (phi \/ ~phi); +[ +intros L; +elim L; +[ +auto +| +clear L; +intro Nom; +apply (E_antiT_th) +] +| +apply (classic phi) +] +| _ => fail +end. +*) + +Variable E Y R : Prop. + +Theorem Yoga : ((E -> (Y \/ R)) /\ (Y -> R)) -> ~R -> ~E. +Proof. +I_imp H1. +I_imp H2. +I_non H3. +I_antiT R. + E_ou Y R. + E_imp E. + E_et_g (Y -> R). + Hyp H1. + + Hyp H3. + + E_et_d (E -> Y \/ R). + Hyp H1. + + I_imp H4. + Hyp H4. + Hyp H2. +Qed. + +Variable phi psi : Prop. + +Theorem contra : (phi -> psi) -> (~psi -> ~phi). +I_imp H1. +I_imp H2. +I_non H3. +I_antiT psi. +E_imp phi. +Hyp H1. +Hyp H3. +Hyp H2. +Qed. + +Theorem P2nnP : phi -> ~~phi. +I_imp H1. +I_non H2. +I_antiT phi. +Hyp H1. +Hyp H2. +Qed. + +Theorem nnP2P : ~~ phi -> phi. +I_imp H1. +absurde H2. +E_non (~phi). +Hyp H2. +Hyp H1. +Qed. + +Variable A : Type. +Variable chi : A -> A -> Prop. + +Theorem Swap : (exists y, forall x, chi x y) -> (forall x, exists y, chi x y). +Proof. +I_imp H1. +I_forall x. +E_exists (fun y => forall x : A, chi x y). + Hyp H1. + + I_exists t. + E_forall x. + Hyp Ht. +Qed. + diff --git a/BE2019/coq-exercice-1.v b/BE2019/coq-exercice-1.v new file mode 100755 index 0000000..896ed57 --- /dev/null +++ b/BE2019/coq-exercice-1.v @@ -0,0 +1,23 @@ +Require Import Naturelle. +Section Session1_2019_Logique_Exercice_1. + +Variable A B C : Prop. + +Theorem Exercice_1_Coq : (A -> B -> C) -> ((A /\ B) -> C). +intros. +cut B. +cut A. +exact H. +destruct H0. +exact H0. +destruct H0. +exact H1. +Qed. + +Theorem Exercice_1_Naturelle : (A -> B -> C) -> ((A /\ B) -> C). +Proof. +(* A COMPLETER *) +Qed. + +End Session1_2019_Logique_Exercice_1. + diff --git a/BE2019/coq-exercice-2.v b/BE2019/coq-exercice-2.v new file mode 100755 index 0000000..78282cd --- /dev/null +++ b/BE2019/coq-exercice-2.v @@ -0,0 +1,19 @@ +Require Import Naturelle. +Section Session1_2019_Logique_Exercice_2. + +Variable A B : Prop. + +Theorem Exercice_2_Coq : (~A) \/ B -> (~A) \/ (A /\ B). +intros. +right. +split. + +Qed. + +Theorem Exercice_2_Naturelle : (~A) \/ B -> (~A) \/ (A /\ B). +Proof. +(* A COMPLETER *) +Qed. + +End Session1_2019_Logique_Exercice_2. + diff --git a/BE2019/coq-exercice-3.v b/BE2019/coq-exercice-3.v new file mode 100755 index 0000000..c4c74e0 --- /dev/null +++ b/BE2019/coq-exercice-3.v @@ -0,0 +1,102 @@ +Section Session1_2019_Induction_Exercice_3. + +(* Déclaration d’un domaine pour les éléments des listes *) +Variable A : Set. + +(* Déclaration d'un type liste générique d'éléments de type E *) +Inductive liste (E : Set) : Set := +Nil +: liste E +| Cons : E -> liste E -> liste E. + +(* Déclaration du nom de la fonction append *) +Variable append_spec : forall E : Set, liste E -> liste E -> liste E. + +(* Spécification du comportement de append pour Nil en premier paramètre *) +Axiom append_Nil : forall E : Set, forall (l : liste E), append_spec E (Nil E) l = l. + +(* Spécification du comportement de append pour Cons en premier paramètre *) +Axiom append_Cons : forall E : Set, forall (t : E), forall (q l : liste E), + append_spec E ((Cons E) t q) l = (Cons E) t (append_spec E q l). + +(* Spécification du comportement de append pour Nil en second paramètre *) +Axiom append_Nil_right : forall E : Set, forall (l : liste E), (append_spec E l (Nil E)) = l. + +(* append est associative à gauche et à droite *) +Axiom append_associative : forall E : Set, forall (l1 l2 l3 : liste E), + (append_spec E l1 (append_spec E l2 l3)) = (append_spec E (append_spec E l1 l2) l3). + +(* Déclaration du nom de la fonction flatten *) +Variable flatten_spec : forall E : Set, liste (liste E) -> liste E. + +(* Spécification du comportement de flatten pour Nil *) +Axiom flatten_Nil : forall E : Set, flatten_spec E (Nil (liste E)) = (Nil E). + +(* Spécification du comportement de flatten pour Cons *) +Axiom flatten_Cons : forall E : Set, forall (t : liste E), forall (q : liste (liste E)), + flatten_spec E (Cons (liste E) t q) = append_spec E t (flatten_spec E q). + +(* Déclaration du nom de la fonction split *) +Variable split_spec : forall E : Set, liste E -> liste (liste E). + +(* Spécification du comportement de split pour Nil *) +Axiom split_Nil : forall E : Set, split_spec E (Nil E) = (Nil (liste E)). + +(* Spécification du comportement de split pour Cons *) +Axiom split_Cons : forall E : Set, forall (t : E), forall (q : liste E), + split_spec E (Cons E t q) = Cons (liste E) (Cons E t (Nil E)) (split_spec E q). + +(* Cohérence de flatten et de split : flatten(split(l)) = l*) +Theorem flatten_split_consistency : forall E : Set, forall (l : liste E), + flatten_spec E (split_spec E l) = l. +intros. +induction l. +rewrite split_Nil. +rewrite flatten_Nil. +reflexivity. +rewrite split_Cons. +rewrite flatten_Cons. +rewrite IHl. +rewrite append_Cons. +rewrite append_Nil. +reflexivity. +Qed. + +(* Implantation de la fonction append *) +Fixpoint append_impl (E : Set) (l1 l2 : liste E) {struct l1} : liste E := +match l1 with +Nil _ => l2 +| (Cons _ t1 q1) => (Cons E t1 (append_impl E q1 l2)) +end. + +Theorem append_correctness : forall E : Set, forall (l1 l2 : liste E), +(append_spec E l1 l2) = (append_impl E l1 l2). +intro TE. +induction l1. +intro Hl2. +rewrite append_Nil. +simpl. +reflexivity. +intro Hl2. +rewrite append_Cons. +simpl. +rewrite IHl1. +reflexivity. +Qed. + +(* Implantation de la fonction flatten *) +Fixpoint flatten_impl (E : Set) (l : liste (liste E)) {struct l} : liste E := + match l with + Nil => Nil + | (Cons t1 q1) => (Cons t1 (flatten_impl q1 l2)) +end. + + +(* Correction de l'implantation de flatten par rapport à sa spécification *) +Theorem flatten_correctness : forall E : Set, forall (l : liste (liste E)), + (flatten_spec E l) = (flatten_impl E l). +Proof. +(* A COMPLETER *) +Qed. + +End Session1_2019_Induction_Exercice_3. diff --git a/BE2019/why3-exercice-4.mlw b/BE2019/why3-exercice-4.mlw new file mode 100755 index 0000000..335f087 --- /dev/null +++ b/BE2019/why3-exercice-4.mlw @@ -0,0 +1,24 @@ +(* BE : Session 1 2019 *) +(* Implémentation de la fonction somme des premiers entiers par un algorithme ascendant *) + +module Somme + + use int.Int + use int.ComputerDivision + use ref.Refint + + let somme (n: int) : int + requires { n >= 0 } + ensures { 2*result = n*(n+1) } + = + let i = ref 0 in + let r = ref 0 in + while (!i < n) do + invariant { 2*!r = !i*(!i+1) } + variant { n - !i } + i := (!i) + 1; + r := (!r) + (!i) + done; + !r + +end diff --git a/BE2019/why3-exercice-4/why3mnexercicemn4_Somme_VC_somme_1.v b/BE2019/why3-exercice-4/why3mnexercicemn4_Somme_VC_somme_1.v new file mode 100755 index 0000000..f9ef867 --- /dev/null +++ b/BE2019/why3-exercice-4/why3mnexercicemn4_Somme_VC_somme_1.v @@ -0,0 +1,44 @@ +(* This file is generated by Why3's Coq driver *) +(* Beware! Only edit allowed sections below *) +Require Import BuiltIn. +Require BuiltIn. +Require int.Int. +Require int.Abs. +Require int.ComputerDivision. + +(* Why3 assumption *) +Inductive ref (a:Type) := + | mk_ref : a -> ref a. +Axiom ref_WhyType : forall (a:Type) {a_WT:WhyType a}, WhyType (ref a). +Existing Instance ref_WhyType. +Arguments mk_ref {a}. + +(* Why3 assumption *) +Definition contents {a:Type} {a_WT:WhyType a} (v:ref a) : a := + match v with + | mk_ref x => x + end. + +Parameter n: Z. + +Parameter r: Z. + +Parameter i: Z. + +Axiom H : (i < n)%Z. + +Parameter i1: Z. + +Axiom H1 : (i1 = (i + 1%Z)%Z). + +Parameter r1: Z. + +Axiom H2 : (r1 = (r + i1)%Z). + +(* Why3 goal *) +Theorem VC_somme : False. +Proof. + + +Qed. + diff --git a/BE2019/why3-exercice-4/why3mnexercicemn4_Somme_VC_somme_2.v b/BE2019/why3-exercice-4/why3mnexercicemn4_Somme_VC_somme_2.v new file mode 100755 index 0000000..f9ef867 --- /dev/null +++ b/BE2019/why3-exercice-4/why3mnexercicemn4_Somme_VC_somme_2.v @@ -0,0 +1,44 @@ +(* This file is generated by Why3's Coq driver *) +(* Beware! Only edit allowed sections below *) +Require Import BuiltIn. +Require BuiltIn. +Require int.Int. +Require int.Abs. +Require int.ComputerDivision. + +(* Why3 assumption *) +Inductive ref (a:Type) := + | mk_ref : a -> ref a. +Axiom ref_WhyType : forall (a:Type) {a_WT:WhyType a}, WhyType (ref a). +Existing Instance ref_WhyType. +Arguments mk_ref {a}. + +(* Why3 assumption *) +Definition contents {a:Type} {a_WT:WhyType a} (v:ref a) : a := + match v with + | mk_ref x => x + end. + +Parameter n: Z. + +Parameter r: Z. + +Parameter i: Z. + +Axiom H : (i < n)%Z. + +Parameter i1: Z. + +Axiom H1 : (i1 = (i + 1%Z)%Z). + +Parameter r1: Z. + +Axiom H2 : (r1 = (r + i1)%Z). + +(* Why3 goal *) +Theorem VC_somme : False. +Proof. + + +Qed. + diff --git a/BE2019/why3-exercice-4/why3session.xml b/BE2019/why3-exercice-4/why3session.xml new file mode 100755 index 0000000..b5b65e5 --- /dev/null +++ b/BE2019/why3-exercice-4/why3session.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BE2020/.Naturelle.aux b/BE2020/.Naturelle.aux new file mode 100755 index 0000000..c422526 --- /dev/null +++ b/BE2020/.Naturelle.aux @@ -0,0 +1,40 @@ +COQAUX1 3e03a7b5b5c26232f0f3e8f10219c975 /home/lfainsin/1A/Modé/BE2020/Naturelle.v +383 387 proof_build_time "0.000" +0 0 E_imp_th "0.000" +383 387 context_used "" +383 387 proof_check_time "0.000" +0 0 VernacProof "tac:no using:no" +916 920 proof_build_time "0.000" +0 0 E_forall_th "0.000" +916 920 context_used "" +916 920 proof_check_time "0.000" +1291 1295 proof_build_time "0.001" +0 0 E_et_g_th "0.001" +1291 1295 context_used "" +1291 1295 proof_check_time "0.000" +1601 1605 proof_build_time "0.000" +0 0 E_et_d_th "0.000" +1601 1605 context_used "" +1601 1605 proof_check_time "0.000" +1983 1987 proof_build_time "0.001" +0 0 E_ou_th "0.001" +1983 1987 context_used "" +1983 1987 proof_check_time "0.000" +0 0 VernacProof "tac:no using:no" +2806 2810 proof_build_time "0.001" +0 0 E_exists_th "0.001" +2806 2810 context_used "" +2806 2810 proof_check_time "0.000" +3280 3284 proof_build_time "0.000" +0 0 E_antiT_th "0.000" +3280 3284 context_used "" +3280 3284 proof_check_time "0.000" +3502 3506 proof_build_time "0.001" +0 0 I_antiT_th "0.001" +3502 3506 context_used "" +3502 3506 proof_check_time "0.000" +3683 3687 proof_build_time "0.000" +0 0 I_non_th "0.000" +3683 3687 context_used "" +3683 3687 proof_check_time "0.000" +0 0 vo_compile_time "0.107" diff --git a/BE2020/Naturelle.glob b/BE2020/Naturelle.glob new file mode 100755 index 0000000..3c23cb5 --- /dev/null +++ b/BE2020/Naturelle.glob @@ -0,0 +1,150 @@ +DIGEST 3e03a7b5b5c26232f0f3e8f10219c975 +FNaturelle +R15:23 Coq.Logic.Classical <> <> lib +R97:100 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R97:100 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R218:221 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R218:221 Coq.Init.Logic <> ::type_scope:x_'->'_x not +prf 278:285 <> E_imp_th +R314:314 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R325:329 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R333:336 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R337:339 Naturelle <> psi var +R330:332 Naturelle <> phi var +R318:321 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R322:324 Naturelle <> psi var +R315:317 Naturelle <> phi var +R443:450 Naturelle <> E_imp_th thm +R521:528 Naturelle <> E_imp_th thm +prf 816:826 <> E_forall_th +R856:859 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R855:855 Naturelle <> A var +R869:869 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R885:889 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R890:892 Naturelle <> phi var +R894:894 Naturelle <> a var +R880:882 Naturelle <> phi var +R884:884 Naturelle <> x var +R996:1006 Naturelle <> E_forall_th thm +R1086:1089 Coq.Init.Logic <> ::type_scope:x_'/\'_x not +R1086:1089 Coq.Init.Logic <> ::type_scope:x_'/\'_x not +R1105:1108 Coq.Init.Logic <> conj constr +prf 1157:1165 <> E_et_g_th +R1194:1194 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1205:1209 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1210:1212 Naturelle <> phi var +R1198:1201 Coq.Init.Logic <> ::type_scope:x_'/\'_x not +R1195:1197 Naturelle <> phi var +R1202:1204 Naturelle <> psi var +R1352:1360 Naturelle <> E_et_g_th thm +R1432:1440 Naturelle <> E_et_g_th thm +prf 1465:1473 <> E_et_d_th +R1502:1502 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1513:1517 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1518:1520 Naturelle <> psi var +R1506:1509 Coq.Init.Logic <> ::type_scope:x_'/\'_x not +R1503:1505 Naturelle <> phi var +R1510:1512 Naturelle <> psi var +R1662:1670 Naturelle <> E_et_d_th thm +R1743:1751 Naturelle <> E_et_d_th thm +prf 1776:1782 <> E_ou_th +R1815:1815 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1826:1830 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1831:1831 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1842:1846 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1847:1847 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1858:1862 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1863:1865 Naturelle <> chi var +R1851:1854 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1855:1857 Naturelle <> chi var +R1848:1850 Naturelle <> psi var +R1835:1838 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1839:1841 Naturelle <> chi var +R1832:1834 Naturelle <> phi var +R1819:1822 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R1816:1818 Naturelle <> phi var +R1823:1825 Naturelle <> psi var +R2042:2048 Naturelle <> E_ou_th thm +R2124:2130 Naturelle <> E_ou_th thm +R2194:2197 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R2194:2197 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R2213:2221 Coq.Init.Logic <> or_introl constr +R2305:2308 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R2305:2308 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R2324:2332 Coq.Init.Logic <> or_intror constr +R2416:2423 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2430:2433 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2439:2439 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2438:2438 Naturelle <> x var +R2416:2423 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2430:2433 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2439:2439 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2438:2438 Naturelle <> x var +R2453:2460 Coq.Init.Logic <> ex_intro constr +R2561:2568 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2575:2578 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2584:2584 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2583:2583 Naturelle <> x var +R2561:2568 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2575:2578 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2584:2584 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2583:2583 Naturelle <> x var +R2597:2604 Coq.Init.Logic <> ex_intro constr +prf 2669:2679 <> E_exists_th +R2709:2712 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2708:2708 Naturelle <> A var +R2733:2733 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2749:2753 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2754:2754 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2777:2781 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2782:2784 Naturelle <> chi var +R2770:2773 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2774:2776 Naturelle <> chi var +R2765:2767 Naturelle <> phi var +R2769:2769 Naturelle <> a var +R2734:2740 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2742:2743 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2744:2746 Naturelle <> phi var +R2748:2748 Naturelle <> x var +R2963:2973 Naturelle <> E_exists_th thm +R3083:3085 Coq.Init.Logic <> not def +R3116:3120 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R3132:3132 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R3123:3126 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3127:3131 Coq.Init.Logic <> False ind +R3116:3120 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R3132:3132 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R3123:3126 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3127:3131 Coq.Init.Logic <> False ind +R3145:3151 Coq.Logic.Classical_Prop <> classic prfax +prf 3209:3218 <> E_antiT_th +R3248:3251 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3252:3254 Naturelle <> phi var +R3243:3247 Coq.Init.Logic <> False ind +R3340:3349 Naturelle <> E_antiT_th thm +prf 3370:3379 <> I_antiT_th +R3407:3410 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3411:3411 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3416:3420 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3421:3425 Coq.Init.Logic <> False ind +R3412:3412 Coq.Init.Logic <> ::type_scope:'~'_x not +R3413:3415 Naturelle <> phi var +R3404:3406 Naturelle <> phi var +R3435:3437 Coq.Init.Logic <> not def +R3551:3555 Coq.Init.Logic <> False ind +R3551:3555 Coq.Init.Logic <> False ind +R3567:3576 Naturelle <> I_antiT_th thm +prf 3598:3605 <> I_non_th +R3630:3630 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3643:3647 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3648:3648 Coq.Init.Logic <> ::type_scope:'~'_x not +R3649:3651 Naturelle <> phi var +R3634:3637 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3638:3642 Coq.Init.Logic <> False ind +R3631:3633 Naturelle <> phi var +R3669:3671 Coq.Init.Logic <> not def +R3730:3731 Coq.Init.Logic <> ::type_scope:'~'_x not +R3730:3731 Coq.Init.Logic <> ::type_scope:'~'_x not +R3745:3752 Naturelle <> I_non_th thm +R3801:3810 Naturelle <> I_antiT_th thm +R3875:3878 Coq.Logic.Classical_Prop <> NNPP thm diff --git a/BE2020/Naturelle.v b/BE2020/Naturelle.v new file mode 100755 index 0000000..b1d6533 --- /dev/null +++ b/BE2020/Naturelle.v @@ -0,0 +1,224 @@ +Require Export Classical. + +Ltac Hyp Nom := exact Nom. + +Ltac I_imp' := + match goal with + | |- ?A -> ?B => let hyp := fresh "H" in intro hyp + | _ => fail + end. + +Ltac I_imp Nom := + match goal with + | |- ?A -> ?B => intro Nom + | _ => fail + end. + +Theorem E_imp_th : forall (phi psi : Prop), (phi -> psi) -> phi -> psi. +intros Pphi Ppsi Hphi2psi. +Hyp Hphi2psi. +Qed. + +Ltac E_imp' := + match goal with + | |- ?P => eapply (E_imp_th _ P) + end. + +Ltac E_imp phi := + match goal with + | |- ?P => apply (E_imp_th phi P) + end. + +Ltac I_forall' := + match goal with + | |- forall (x : ?A), ?P => let hyp := fresh x in intro hyp + | _ => fail + end. + +Ltac I_forall Nom := + match goal with + | |- forall (x : ?A), ?P => intro Nom + | _ => fail + end. + +Theorem E_forall_th : forall (A : Type) (phi : A -> Prop) a, (forall x, phi x) -> phi a. +Proof. +firstorder. +Qed. + +Ltac E_forall x := + pattern x; + match goal with + | |- (?P x) => apply (E_forall_th _ P x) + | _ => fail + end. + +Ltac I_et := + match goal with + | |- (?A /\ ?B) => apply (@conj A B) + | _ => fail + end. + +Theorem E_et_g_th : forall (phi psi : Prop), (phi /\ psi) -> phi. +intros Pphi Ppsi Hphi_et_psi. +elim Hphi_et_psi. +intros Hphi Hpsi. +Hyp Hphi. +Qed. + +Ltac E_et_g' := + match goal with + | |- ?P => eapply (E_et_g_th P _) + end. + +Ltac E_et_g psi := + match goal with + | |- ?P => apply (E_et_g_th P psi) + end. + +Theorem E_et_d_th : forall (phi psi : Prop), (phi /\ psi) -> psi. +intros Pphi Ppsi H_phi_et_psi. +elim H_phi_et_psi. +intros Hphi Hpsi. +Hyp Hpsi. +Qed. + +Ltac E_et_d' := + match goal with + | |- ?P => eapply (E_et_d_th _ P) + end. + +Ltac E_et_d phi := + match goal with + | |- ?P => eapply (E_et_d_th phi P) + end. + +Theorem E_ou_th : forall (phi psi chi : Prop), (phi \/ psi) -> (phi -> chi) -> (psi -> chi) -> chi. +intros Pphi Ppsi Pchi Hphi_ou_psi Hphi_imp_chi Hpsi_imp_chi. +elim Hphi_ou_psi. +Hyp Hphi_imp_chi. +Hyp Hpsi_imp_chi. +Qed. + +Ltac E_ou' := + match goal with + | |- ?P => eapply (E_ou_th _ _ P) + end. + +Ltac E_ou phi psi := + match goal with + | |- ?P => apply (E_ou_th phi psi P) + end. + +Ltac I_ou_g := + match goal with + | |- (?A \/ ?B) => apply (@or_introl A B) + | _ => fail + end. + +Ltac I_ou_d := + match goal with + | |- (?A \/ ?B) => apply (@or_intror A B) + | _ => fail + end. + +Ltac I_exists' := + match goal with + | |- exists (x : ?A), (@?P x) => eapply (@ex_intro A P _) + | _ => fail + end. + +Ltac I_exists t := + match goal with + | |- exists (x : ?A), (@?P x) => apply (@ex_intro _ P t) + | _ => fail + end. + +Theorem E_exists_th : forall (A : Type) (phi : A -> Prop) (chi : Prop), (exists x, phi x) -> (forall a, phi a -> chi) -> chi. +Proof. +firstorder. +Qed. +(* +Ltac E_exists phi := + match goal with + | |- ?P => apply (E_exists_th _ phi P) + end. +*) +Ltac E_exists phi := + match goal with + | |- ?P => apply (E_exists_th _ phi P); [ idtac | let t := fresh "t" in let ht := fresh "Ht" in intros t ht ] + end. + +Ltac TE := + unfold not; + match goal with + | |- (?P \/ (?P -> False)) => exact (classic P) + | _ => fail + end. + +Theorem E_antiT_th : forall (phi : Prop), False -> phi. +intros Pphi F. +elim F. +Qed. + +Ltac E_antiT := + match goal with + | |- ?P => apply (E_antiT_th P) + end. + +Theorem I_antiT_th : forall (phi : Prop), phi -> (~phi) -> False. +unfold not. +intro Pphi. +intros Hphi Hnphi. +cut Pphi. +Hyp Hnphi. +Hyp Hphi. +Qed. + +Ltac I_antiT phi := + match goal with + | |- False => apply (I_antiT_th phi) + end. + +Theorem I_non_th : forall (phi : Prop), (phi -> False) -> ~phi. +intros. +unfold not. +exact H. +Qed. + +Ltac I_non Nom := + match goal with + | |- ~ ?P => apply (I_non_th P); intro Nom + end. + +Ltac E_non phi := + apply (I_antiT_th phi). + +Ltac absurde Nom := + match goal with + | |- ?P => apply (NNPP P); intro Nom + end. + +(* +Ltac I_antiT phi := apply (I_antiT_th phi). + +Ltac absurde Nom phi := +match goal with +| |- phi => +cut (phi \/ ~phi); +[ +intros L; +elim L; +[ +auto +| +clear L; +intro Nom; +apply (E_antiT_th) +] +| +apply (classic phi) +] +| _ => fail +end. +*) diff --git a/BE2020/coq_exercice_1.v b/BE2020/coq_exercice_1.v new file mode 100755 index 0000000..5b67f60 --- /dev/null +++ b/BE2020/coq_exercice_1.v @@ -0,0 +1,41 @@ +Require Import Naturelle. +Section Session1_2020_Logique_Exercice_1. + +Variable A B C : Prop. + +Theorem Exercice_1_Naturelle : ((A -> C) \/ (B -> C)) -> ((A /\ B) -> C). +I_imp H1. +I_imp H2. +E_imp A. +E_ou (A -> C) (B -> C). +Hyp H1. +trivial. +I_imp H3. +I_imp H4. +E_imp B. +Hyp H3. +E_et_d A. +Hyp H2. +E_et_g B. +Hyp H2. +Qed. + +Theorem Exercice_1_Coq : ((A -> C) \/ (B -> C)) -> ((A /\ B) -> C). +intros. +destruct H. +destruct H0. +cut A. +exact H. +exact H0. +cut B. +exact H. +cut (A /\ B). +intro H2. +elim H2. +intros HA HB. +exact HB. +exact H0. +Qed. + +End Session1_2020_Logique_Exercice_1. + diff --git a/BE2020/coq_exercice_2.v b/BE2020/coq_exercice_2.v new file mode 100755 index 0000000..46e448e --- /dev/null +++ b/BE2020/coq_exercice_2.v @@ -0,0 +1,17 @@ +Require Import Naturelle. +Section Session1_2020_Logique_Exercice_2. + +Variable A B : Prop. + +Theorem Exercice_2_Naturelle : (A -> B) -> ((~A) \/ B). +Proof. +(* A COMPLETER *) +Qed. + +Theorem Exercice_2_Coq : (A -> B) -> ((~A) \/ B). +Proof. +(* A COMPLETER *) +Qed. + +End Session1_2020_Logique_Exercice_2. + diff --git a/BE2020/coq_exercice_3.v b/BE2020/coq_exercice_3.v new file mode 100755 index 0000000..6237cb2 --- /dev/null +++ b/BE2020/coq_exercice_3.v @@ -0,0 +1,91 @@ +Section Session1_2020_Induction_Exercice_3. + +(* Déclaration d’un domaine pour les éléments des listes *) +Variable A : Set. + +Inductive entier : Set := +Zero : entier +| Succ : entier -> entier. + +(* Déclaration du nom de la fonction somme *) +Variable somme_spec : entier -> entier -> entier. + +(* Spécification du comportement de somme pour Zero en premier paramètre *) +Axiom somme_Zero : forall (n : entier), somme_spec Zero n = n. + +(* Spécification du comportement de somme pour Succ en premier paramètre *) +Axiom somme_Succ : forall (n m : entier), + somme_spec (Succ n) m = Succ (somme_spec n m). + +(* somme est associative à gauche et à droite *) +Axiom somme_associative : forall (n1 n2 n3 : entier), + (somme_spec n1 (somme_spec n2 n3)) = (somme_spec (somme_spec n1 n2) n3). + +Inductive liste : Set := +Nil +: liste +| Cons : A -> liste -> liste. + +(* Déclaration du nom de la fonction append *) +Variable append_spec : liste -> liste -> liste. + +(* Spécification du comportement de append pour Nil en premier paramètre *) +Axiom append_Nil : forall (l : liste), append_spec Nil l = l. + +(* Spécification du comportement de append pour Cons en premier paramètre *) +Axiom append_Cons : forall (t : A), forall (q l : liste), + append_spec (Cons t q) l = Cons t (append_spec q l). + +(* append est associative à gauche et à droite *) +Axiom append_associative : forall (l1 l2 l3 : liste), + (append_spec l1 (append_spec l2 l3)) = (append_spec (append_spec l1 l2) l3). + +(* Déclaration du nom de la fonction taille *) +Variable taille_spec : liste -> entier. + +(* Spécification du comportement de taille pour Nil en paramètre *) +Axiom taille_Nil : taille_spec Nil = Zero . + +(* Spécification du comportement de taille pour Cons en paramètre *) +Axiom taille_Cons : forall (t : A), forall (q : liste), + taille_spec (Cons t q) = Succ (taille_spec q) . + + +(* taille commute avec append *) +Theorem taille_append : forall (l1 l2 : liste), +(taille_spec (append_spec l1 l2)) = (somme_spec (taille_spec l1) (taille_spec l2)). +intros. +induction l1. +rewrite append_Nil. +rewrite taille_Nil. +rewrite somme_Zero. +reflexivity. +rewrite append_Cons. +rewrite taille_Cons. +rewrite taille_Cons. +rewrite somme_Succ. +rewrite IHl1. +reflexivity. +Qed. + +(* Implantation de la fonction taille *) +Fixpoint taille_impl (l : liste) {struct l} : entier := + match l with + Nil => Zero + | (Cons t q) => (Succ (taille_impl q)) +end. + +Theorem taille_correctness : forall (l : liste), + (taille_spec l) = (taille_impl l). +intros. +induction l. +simpl taille_impl. +rewrite taille_Nil. +reflexivity. +simpl taille_impl. +rewrite taille_Cons. +rewrite IHl. +reflexivity. +Qed. + +End Session1_2020_Induction_Exercice_3. diff --git a/BE2020/why3_exercice_4.mlw b/BE2020/why3_exercice_4.mlw new file mode 100755 index 0000000..3ab8361 --- /dev/null +++ b/BE2020/why3_exercice_4.mlw @@ -0,0 +1,23 @@ +(* BE : Session 1 2020 *) +(* Implémentation de la fonction carre d'un entier naturel par un algorithme inspiré des identités remarquables *) + +module Carre + + use int.Int + use ref.Refint + + let carre (n: int) : int + requires { 0 <= n } + ensures { !r = n*n } + = + let x = ref n in + let r = ref 0 in + while (!x <> 0) do + invariant { !r + (!x)*(!x) = n*n && 0 <= !x } + variant { !x } + r := (!r) + 2 * (!x) - 1; + x := (!x) - 1 + done; + !r + +end \ No newline at end of file diff --git a/BE2020/why3_exercice_4/why3session.xml b/BE2020/why3_exercice_4/why3session.xml new file mode 100755 index 0000000..22a58ee --- /dev/null +++ b/BE2020/why3_exercice_4/why3session.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TP1/.Naturelle.aux b/TP1/.Naturelle.aux new file mode 100755 index 0000000..a8bbca0 --- /dev/null +++ b/TP1/.Naturelle.aux @@ -0,0 +1,40 @@ +COQAUX1 f13e540aa0997388dd1408b0662438d6 /home/lfainsin/1A/Modé/TP1/Naturelle.v +383 387 proof_build_time "0.001" +0 0 E_imp_th "0.001" +383 387 context_used "" +383 387 proof_check_time "0.000" +0 0 VernacProof "tac:no using:no" +916 920 proof_build_time "0.001" +0 0 E_forall_th "0.001" +916 920 context_used "" +916 920 proof_check_time "0.000" +1291 1295 proof_build_time "0.001" +0 0 E_et_g_th "0.001" +1291 1295 context_used "" +1291 1295 proof_check_time "0.000" +1601 1605 proof_build_time "0.001" +0 0 E_et_d_th "0.001" +1601 1605 context_used "" +1601 1605 proof_check_time "0.000" +1983 1987 proof_build_time "0.001" +0 0 E_ou_th "0.001" +1983 1987 context_used "" +1983 1987 proof_check_time "0.000" +0 0 VernacProof "tac:no using:no" +2806 2810 proof_build_time "0.001" +0 0 E_exists_th "0.001" +2806 2810 context_used "" +2806 2810 proof_check_time "0.000" +3280 3284 proof_build_time "0.000" +0 0 E_antiT_th "0.000" +3280 3284 context_used "" +3280 3284 proof_check_time "0.000" +3502 3506 proof_build_time "0.001" +0 0 I_antiT_th "0.001" +3502 3506 context_used "" +3502 3506 proof_check_time "0.000" +3683 3687 proof_build_time "0.000" +0 0 I_non_th "0.000" +3683 3687 context_used "" +3683 3687 proof_check_time "0.000" +0 0 vo_compile_time "0.713" diff --git a/TP1/Naturelle.glob b/TP1/Naturelle.glob new file mode 100755 index 0000000..df9312d --- /dev/null +++ b/TP1/Naturelle.glob @@ -0,0 +1,150 @@ +DIGEST f13e540aa0997388dd1408b0662438d6 +FNaturelle +R15:23 Coq.Logic.Classical <> <> lib +R97:100 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R97:100 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R218:221 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R218:221 Coq.Init.Logic <> ::type_scope:x_'->'_x not +prf 278:285 <> E_imp_th +R314:314 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R325:329 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R333:336 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R337:339 Naturelle <> psi var +R330:332 Naturelle <> phi var +R318:321 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R322:324 Naturelle <> psi var +R315:317 Naturelle <> phi var +R443:450 Naturelle <> E_imp_th thm +R521:528 Naturelle <> E_imp_th thm +prf 816:826 <> E_forall_th +R856:859 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R855:855 Naturelle <> A var +R869:869 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R885:889 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R890:892 Naturelle <> phi var +R894:894 Naturelle <> a var +R880:882 Naturelle <> phi var +R884:884 Naturelle <> x var +R996:1006 Naturelle <> E_forall_th thm +R1086:1089 Coq.Init.Logic <> ::type_scope:x_'/\'_x not +R1086:1089 Coq.Init.Logic <> ::type_scope:x_'/\'_x not +R1105:1108 Coq.Init.Logic <> conj constr +prf 1157:1165 <> E_et_g_th +R1194:1194 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1205:1209 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1210:1212 Naturelle <> phi var +R1198:1201 Coq.Init.Logic <> ::type_scope:x_'/\'_x not +R1195:1197 Naturelle <> phi var +R1202:1204 Naturelle <> psi var +R1352:1360 Naturelle <> E_et_g_th thm +R1432:1440 Naturelle <> E_et_g_th thm +prf 1465:1473 <> E_et_d_th +R1502:1502 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1513:1517 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1518:1520 Naturelle <> psi var +R1506:1509 Coq.Init.Logic <> ::type_scope:x_'/\'_x not +R1503:1505 Naturelle <> phi var +R1510:1512 Naturelle <> psi var +R1662:1670 Naturelle <> E_et_d_th thm +R1743:1751 Naturelle <> E_et_d_th thm +prf 1776:1782 <> E_ou_th +R1815:1815 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1826:1830 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1831:1831 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1842:1846 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1847:1847 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1858:1862 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1863:1865 Naturelle <> chi var +R1851:1854 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1855:1857 Naturelle <> chi var +R1848:1850 Naturelle <> psi var +R1835:1838 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1839:1841 Naturelle <> chi var +R1832:1834 Naturelle <> phi var +R1819:1822 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R1816:1818 Naturelle <> phi var +R1823:1825 Naturelle <> psi var +R2042:2048 Naturelle <> E_ou_th thm +R2124:2130 Naturelle <> E_ou_th thm +R2194:2197 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R2194:2197 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R2213:2221 Coq.Init.Logic <> or_introl constr +R2305:2308 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R2305:2308 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R2324:2332 Coq.Init.Logic <> or_intror constr +R2416:2423 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2430:2433 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2439:2439 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2438:2438 Naturelle <> x var +R2416:2423 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2430:2433 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2439:2439 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2438:2438 Naturelle <> x var +R2453:2460 Coq.Init.Logic <> ex_intro constr +R2561:2568 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2575:2578 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2584:2584 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2583:2583 Naturelle <> x var +R2561:2568 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2575:2578 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2584:2584 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2583:2583 Naturelle <> x var +R2597:2604 Coq.Init.Logic <> ex_intro constr +prf 2669:2679 <> E_exists_th +R2709:2712 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2708:2708 Naturelle <> A var +R2733:2733 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2749:2753 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2754:2754 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2777:2781 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2782:2784 Naturelle <> chi var +R2770:2773 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2774:2776 Naturelle <> chi var +R2765:2767 Naturelle <> phi var +R2769:2769 Naturelle <> a var +R2734:2740 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2742:2743 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2744:2746 Naturelle <> phi var +R2748:2748 Naturelle <> x var +R2963:2973 Naturelle <> E_exists_th thm +R3083:3085 Coq.Init.Logic <> not def +R3116:3120 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R3132:3132 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R3123:3126 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3127:3131 Coq.Init.Logic <> False ind +R3116:3120 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R3132:3132 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R3123:3126 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3127:3131 Coq.Init.Logic <> False ind +R3145:3151 Coq.Logic.Classical_Prop <> classic prfax +prf 3209:3218 <> E_antiT_th +R3248:3251 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3252:3254 Naturelle <> phi var +R3243:3247 Coq.Init.Logic <> False ind +R3340:3349 Naturelle <> E_antiT_th thm +prf 3370:3379 <> I_antiT_th +R3407:3410 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3411:3411 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3416:3420 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3421:3425 Coq.Init.Logic <> False ind +R3412:3412 Coq.Init.Logic <> ::type_scope:'~'_x not +R3413:3415 Naturelle <> phi var +R3404:3406 Naturelle <> phi var +R3435:3437 Coq.Init.Logic <> not def +R3551:3555 Coq.Init.Logic <> False ind +R3551:3555 Coq.Init.Logic <> False ind +R3567:3576 Naturelle <> I_antiT_th thm +prf 3598:3605 <> I_non_th +R3630:3630 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3643:3647 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3648:3648 Coq.Init.Logic <> ::type_scope:'~'_x not +R3649:3651 Naturelle <> phi var +R3634:3637 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3638:3642 Coq.Init.Logic <> False ind +R3631:3633 Naturelle <> phi var +R3669:3671 Coq.Init.Logic <> not def +R3730:3731 Coq.Init.Logic <> ::type_scope:'~'_x not +R3730:3731 Coq.Init.Logic <> ::type_scope:'~'_x not +R3745:3752 Naturelle <> I_non_th thm +R3801:3810 Naturelle <> I_antiT_th thm +R3875:3878 Coq.Logic.Classical_Prop <> NNPP thm diff --git a/TP1/Naturelle.v b/TP1/Naturelle.v new file mode 100755 index 0000000..0546e4d --- /dev/null +++ b/TP1/Naturelle.v @@ -0,0 +1,225 @@ +Require Export Classical. + +Ltac Hyp Nom := exact Nom. + +Ltac I_imp' := + match goal with + | |- ?A -> ?B => let hyp := fresh "H" in intro hyp + | _ => fail + end. + +Ltac I_imp Nom := + match goal with + | |- ?A -> ?B => intro Nom + | _ => fail + end. + +Theorem E_imp_th : forall (phi psi : Prop), (phi -> psi) -> phi -> psi. +intros Pphi Ppsi Hphi2psi. +Hyp Hphi2psi. +Qed. + +Ltac E_imp' := + match goal with + | |- ?P => eapply (E_imp_th _ P) + end. + +Ltac E_imp phi := + match goal with + | |- ?P => apply (E_imp_th phi P) + end. + +Ltac I_forall' := + match goal with + | |- forall (x : ?A), ?P => let hyp := fresh x in intro hyp + | _ => fail + end. + +Ltac I_forall Nom := + match goal with + | |- forall (x : ?A), ?P => intro Nom + | _ => fail + end. + +Theorem E_forall_th : forall (A : Type) (phi : A -> Prop) a, (forall x, phi x) -> phi a. +Proof. +firstorder. +Qed. + +Ltac E_forall x := + pattern x; + match goal with + | |- (?P x) => apply (E_forall_th _ P x) + | _ => fail + end. + +Ltac I_et := + match goal with + | |- (?A /\ ?B) => apply (@conj A B) + | _ => fail + end. + +Theorem E_et_g_th : forall (phi psi : Prop), (phi /\ psi) -> phi. +intros Pphi Ppsi Hphi_et_psi. +elim Hphi_et_psi. +intros Hphi Hpsi. +Hyp Hphi. +Qed. + +Ltac E_et_g' := + match goal with + | |- ?P => eapply (E_et_g_th P _) + end. + +Ltac E_et_g psi := + match goal with + | |- ?P => apply (E_et_g_th P psi) + end. + +Theorem E_et_d_th : forall (phi psi : Prop), (phi /\ psi) -> psi. +intros Pphi Ppsi H_phi_et_psi. +elim H_phi_et_psi. +intros Hphi Hpsi. +Hyp Hpsi. +Qed. + +Ltac E_et_d' := + match goal with + | |- ?P => eapply (E_et_d_th _ P) + end. + +Ltac E_et_d phi := + match goal with + | |- ?P => eapply (E_et_d_th phi P) + end. + +Theorem E_ou_th : forall (phi psi chi : Prop), (phi \/ psi) -> (phi -> chi) -> (psi -> chi) -> chi. +intros Pphi Ppsi Pchi Hphi_ou_psi Hphi_imp_chi Hpsi_imp_chi. +elim Hphi_ou_psi. +Hyp Hphi_imp_chi. +Hyp Hpsi_imp_chi. +Qed. + +Ltac E_ou' := + match goal with + | |- ?P => eapply (E_ou_th _ _ P) + end. + +Ltac E_ou phi psi := + match goal with + | |- ?P => apply (E_ou_th phi psi P) + end. + +Ltac I_ou_g := + match goal with + | |- (?A \/ ?B) => apply (@or_introl A B) + | _ => fail + end. + +Ltac I_ou_d := + match goal with + | |- (?A \/ ?B) => apply (@or_intror A B) + | _ => fail + end. + +Ltac I_exists' := + match goal with + | |- exists (x : ?A), (@?P x) => eapply (@ex_intro A P _) + | _ => fail + end. + +Ltac I_exists t := + match goal with + | |- exists (x : ?A), (@?P x) => apply (@ex_intro _ P t) + | _ => fail + end. + +Theorem E_exists_th : forall (A : Type) (phi : A -> Prop) (chi : Prop), (exists x, phi x) -> (forall a, phi a -> chi) -> chi. +Proof. +firstorder. +Qed. +(* +Ltac E_exists phi := + match goal with + | |- ?P => apply (E_exists_th _ phi P) + end. +*) +Ltac E_exists phi := + match goal with + | |- ?P => apply (E_exists_th _ phi P); [ idtac | let t := fresh "t" in let ht := fresh "Ht" in intros t ht ] + end. + +Ltac TE := + unfold not; + match goal with + | |- (?P \/ (?P -> False)) => exact (classic P) + | _ => fail + end. + +Theorem E_antiT_th : forall (phi : Prop), False -> phi. +intros Pphi F. +elim F. +Qed. + +Ltac E_antiT := + match goal with + | |- ?P => apply (E_antiT_th P) + end. + +Theorem I_antiT_th : forall (phi : Prop), phi -> (~phi) -> False. +unfold not. +intro Pphi. +intros Hphi Hnphi. +cut Pphi. +Hyp Hnphi. +Hyp Hphi. +Qed. + +Ltac I_antiT phi := + match goal with + | |- False => apply (I_antiT_th phi) + end. + +Theorem I_non_th : forall (phi : Prop), (phi -> False) -> ~phi. +intros. +unfold not. +exact H. +Qed. + +Ltac I_non Nom := + match goal with + | |- ~ ?P => apply (I_non_th P); intro Nom + end. + +Ltac E_non phi := + apply (I_antiT_th phi). + +Ltac absurde Nom := + match goal with + | |- ?P => apply (NNPP P); intro Nom + end. + +(* +Ltac I_antiT phi := apply (I_antiT_th phi). + +Ltac absurde Nom phi := +match goal with +| |- phi => +cut (phi \/ ~phi); +[ +intros L; +elim L; +[ +auto +| +clear L; +intro Nom; +apply (E_antiT_th) +] +| +apply (classic phi) +] +| _ => fail +end. +*) + diff --git a/TP1/TP1.v b/TP1/TP1.v new file mode 100755 index 0000000..731bbef --- /dev/null +++ b/TP1/TP1.v @@ -0,0 +1,119 @@ +(* Les règles de la déduction naturelle doivent être ajoutées à Coq. *) +Require Import Naturelle. + +(* Ouverture d\u2019une section *) +Section CalculPropositionnel. + +(* Déclaration de variables propositionnelles *) +Variable A B C E Y R : Prop. + +(*Exerice 1*) + +Theorem Thm00 : A /\ B -> B /\ A. +I_imp H. +I_et. +E_et_d A. +Hyp H. +E_et_g B. +Hyp H. +Qed. + +Theorem Thm_1 : ((A \/ B) -> C) -> (B -> C). +I_imp H. +I_imp H2. +E_imp (A \/ B). +Hyp H. +I_ou_d. +Hyp H2. +Qed. + +Theorem Thm_2 : A -> ~~A. +I_imp H. +I_non H2. +I_antiT A. +Hyp H. +Hyp H2. +Qed. + +Theorem Thm_3 : (A -> B) -> (~B -> ~A). +I_imp H. +I_imp H2. +I_non H3. +I_antiT B. +E_imp A. +Hyp H. +Hyp H3. +Hyp H2. +Qed. + +Theorem Thm_4 : ~~A -> A. +I_imp H. +absurde H2. +I_antiT (~A). +Hyp H2. +Hyp H. +Qed. + +Theorem Thm_5 : (~B -> ~A) -> (A -> B). + +I_imp H. +I_imp H2. +absurde H3. +I_antiT (A). +Hyp H2. +E_imp (~B). +trivial. +trivial. +Qed. + +Theorem Thm_6 : ((E -> (Y \/ R)) /\ (Y -> R)) -> (~R -> ~E). +intros. +I_non H1. +I_antiT (R). +E_ou Y R. +E_imp E. +E_et_g (Y -> R). +Hyp H. +Hyp H1. +E_et_d (E -> Y \/ R). +Hyp H. +I_imp H2. +tauto. +tauto. +Qed. + +(*Exerice 2*) + +Theorem Coq_E_imp : ((A -> B) /\ A) -> B. +intros. +destruct H as (H1,H2). +tauto. +Qed. + +Theorem Coq_E_et_g : (A /\ B) -> A. +intros. +destruct H as (H1,H2). +trivial. +Qed. + +Theorem Coq_E_ou : ((A \/ B) /\ (A -> C) /\ (B -> C)) -> C. +intros. +destruct H as (H1,H2). +destruct H2 as (H2,H3). +destruct H1 as [H4 | H5]. +E_imp A. +Hyp H2. +Hyp H4. +E_imp B. +trivial. +trivial. +Qed. + +Theorem Thm_7 : ((E -> (Y \/ R)) /\ (Y -> R)) -> (~R -> ~E). +intros. +destruct H as (H1,H2). +tauto. (* à détailler *) +Qed. + +End CalculPropositionnel. + diff --git a/TP2-3/TP2-enigme.mlw b/TP2-3/TP2-enigme.mlw new file mode 100644 index 0000000..c557982 --- /dev/null +++ b/TP2-3/TP2-enigme.mlw @@ -0,0 +1,29 @@ +theory Enigme + + predicate a + predicate b + predicate c + + predicate da = b /\ (not c) + predicate db = a -> c + predicate dc = (not c) /\ ( a \/ b ) + + goal Q1: not (da /\ db /\ dc) + (* on demande ensuite un contre exemple *) + + goal Q2c: da /\ db -> dc (* vrai *) + goal Q2b: dc /\ da -> db (* faux *) + goal Q2a: db /\ dc -> da (* vrai *) + + goal Q3a: (not a) /\ (not b) /\ (not c) -> da (* faux, a ment *) + goal Q3b: (not a) /\ (not b) /\ (not c) -> db (* b dit la vérité *) + goal Q3c: (not a) /\ (not b) /\ (not c) -> dc (* faux, c ment *) + + goal Q4a: da /\ db /\ dc -> a (* faux, a innocent *) + goal Q4b: da /\ db /\ dc -> b (* b coupable *) + goal Q4c: da /\ db /\ dc -> c (* faux, c innocent *) + + goal Q5: not ( (a -> (not da)) /\ (b -> (not db)) /\ (c -> (not dc)) ) + (* on demande ensuite un contre exemple *) + +end diff --git a/TP2-3/TP2.v b/TP2-3/TP2.v new file mode 100644 index 0000000..3a8ef43 --- /dev/null +++ b/TP2-3/TP2.v @@ -0,0 +1,45 @@ +(* Ouverture d’une section *) +Section CalculPredicats. +(* Définition de 2 domaines pour les prédicats *) +Variable A B : Type. + +(* Formule du second ordre : Quantification des prédicats phi et psi *) +Theorem Thm_8 : forall (P Q : A -> Prop), + (forall x1 : A, (P x1) /\ (Q x1)) + -> (forall x2 : A, (P x2)) /\ (forall x3 : A, (Q x3)). +intros. +split. +intro x2. +destruct (H x2). +exact H0. +intro x3. +destruct (H x3). +exact H1. +Qed. + +(* Formule du second ordre : Quantification des prédicats phi et psi *) +Theorem Thm_9 : forall (P : A -> B -> Prop), + (exists x1 : A, forall y1 : B, (P x1 y1)) + -> forall y2 : B, exists x2 : A, (P x2 y2). +intros. +destruct H. +exists x. +generalize y2. +exact H. +Qed. + + +(* Formule du second ordre : Quantification des prédicats phi et psi *) +Theorem Thm_10 : forall (P Q : A -> Prop), + (exists x1 : A, (P x1) -> (Q x1)) + -> (forall x2 : A, (P x2)) -> exists x3 : A, (Q x3). +intros. +destruct H. +exists x. +cut (P x). +exact H. +generalize x. +exact H0. +Qed. + +End CalculPredicats. \ No newline at end of file diff --git a/TP2-3/TP2.v.crashcoqide b/TP2-3/TP2.v.crashcoqide new file mode 100644 index 0000000..5aaba17 --- /dev/null +++ b/TP2-3/TP2.v.crashcoqide @@ -0,0 +1,49 @@ +(* Ouverture d’une section *) +Section CalculPredicats. +(* Définition de 2 domaines pour les prédicats *) +Variable A B : Type. + +(* Formule du second ordre : Quantification des prédicats phi et psi *) +Theorem Thm_8 : forall (P Q : A -> Prop), + (forall x1 : A, (P x1) /\ (Q x1)) + -> (forall x2 : A, (P x2)) /\ (forall x3 : A, (Q x3)). +intros. +split. +intro x2. +exists. + + + + + + + + + + + + + + + + + + + + + + +(* Formule du second ordre : Quantification des prédicats phi et psi +Theorem Thm_9 : forall (P : A -> B -> Prop), + (exists x1 : A, forall y1 : B, (P x1 y1)) + -> forall y2 : B, exists x2 : A, (P x2 y2). +intros.*) + +(* Formule du second ordre : Quantification des prédicats phi et psi +Theorem Thm_10 : forall (P Q : A -> Prop), + (exists x1 : A, (P x1) -> (Q x1)) + -> (forall x2 : A, (P x2)) -> exists x3 : A, (Q x3). +intros. +exists x2.*) + +End CalculPredicats. \ No newline at end of file diff --git a/TP2-3/enigme.mlw b/TP2-3/enigme.mlw new file mode 100644 index 0000000..c557982 --- /dev/null +++ b/TP2-3/enigme.mlw @@ -0,0 +1,29 @@ +theory Enigme + + predicate a + predicate b + predicate c + + predicate da = b /\ (not c) + predicate db = a -> c + predicate dc = (not c) /\ ( a \/ b ) + + goal Q1: not (da /\ db /\ dc) + (* on demande ensuite un contre exemple *) + + goal Q2c: da /\ db -> dc (* vrai *) + goal Q2b: dc /\ da -> db (* faux *) + goal Q2a: db /\ dc -> da (* vrai *) + + goal Q3a: (not a) /\ (not b) /\ (not c) -> da (* faux, a ment *) + goal Q3b: (not a) /\ (not b) /\ (not c) -> db (* b dit la vérité *) + goal Q3c: (not a) /\ (not b) /\ (not c) -> dc (* faux, c ment *) + + goal Q4a: da /\ db /\ dc -> a (* faux, a innocent *) + goal Q4b: da /\ db /\ dc -> b (* b coupable *) + goal Q4c: da /\ db /\ dc -> c (* faux, c innocent *) + + goal Q5: not ( (a -> (not da)) /\ (b -> (not db)) /\ (c -> (not dc)) ) + (* on demande ensuite un contre exemple *) + +end diff --git a/TP2-3/enigme/enigme-Predicats-Thm01_1.cvc b/TP2-3/enigme/enigme-Predicats-Thm01_1.cvc new file mode 100644 index 0000000..a91fa97 --- /dev/null +++ b/TP2-3/enigme/enigme-Predicats-Thm01_1.cvc @@ -0,0 +1,83 @@ +%%% this is a prelude for CVC3 +uni : TYPE; + +ty : TYPE; + +sort: (ty, uni) -> BOOLEAN; + +witness: (ty) -> uni; + +% witness_sort + ASSERT (FORALL (a : ty): (sort(a, witness(a)))); + +int: ty; + +real: ty; + +bool: ty; + +match_bool: (ty, BITVECTOR(1), uni, uni) -> uni; + +% match_bool_sort + ASSERT + (FORALL (a : ty): + (FORALL (x : BITVECTOR(1), x1 : uni, x2 : uni): (sort(a, match_bool(a, x, + x1, x2))))); + +% match_bool_True + ASSERT + (FORALL (a : ty): + (FORALL (z : uni, z1 : uni): + ((sort(a, z)) => (match_bool(a, 0bin1, z, z1) = z)))); + +% match_bool_False + ASSERT + (FORALL (a : ty): + (FORALL (z : uni, z1 : uni): + ((sort(a, z1)) => (match_bool(a, 0bin0, z, z1) = z1)))); + +index_bool: (BITVECTOR(1)) -> INT; + +% index_bool_True + ASSERT (index_bool(0bin1) = 0); + +% index_bool_False + ASSERT (index_bool(0bin0) = 1); + +% bool_inversion + ASSERT (FORALL (u : BITVECTOR(1)): ((u = 0bin1) OR (u = 0bin0))); + +tuple0 : TYPE; + +tuple01: ty; + +Tuple0: tuple0; + +% tuple0_inversion + ASSERT (FORALL (u : tuple0): (u = Tuple0)); + +a: BOOLEAN; + +b: BOOLEAN; + +c: BOOLEAN; + +da: BOOLEAN; + +% da_def + ASSERT (da <=> (b AND (NOT c))); + +db: BOOLEAN; + +% db_def + ASSERT (db <=> (a => c)); + +dc: BOOLEAN; + +% dc_def + ASSERT (dc <=> ((NOT c) AND (a OR b))); + +QUERY +% Thm01 + % File "enigme.mlw", line 13, characters 7-12 + (da AND (db AND dc)); diff --git a/TP2-3/enigme/enigme-Predicats-Thm01_1.smt2 b/TP2-3/enigme/enigme-Predicats-Thm01_1.smt2 new file mode 100644 index 0000000..d170dce --- /dev/null +++ b/TP2-3/enigme/enigme-Predicats-Thm01_1.smt2 @@ -0,0 +1,29 @@ +;;; generated by SMT-LIB2 driver +;;; SMT-LIB2 driver: bit-vectors, common part +(declare-datatypes () ((tuple0 (Tuple0)))) +(declare-fun a () Bool) + +(declare-fun b () Bool) + +(declare-fun c () Bool) + +(declare-fun da () Bool) + +;; da_def + (assert (= da (and b (not c)))) + +(declare-fun db () Bool) + +;; db_def + (assert (= db (=> a c))) + +(declare-fun dc () Bool) + +;; dc_def + (assert (= dc (and (not c) (or a b)))) + +(assert +;; Thm01 + ;; File "enigme.mlw", line 13, characters 7-12 + (not (and da (and db dc)))) +(check-sat) diff --git a/TP2-3/enigme/enigme-Proposition-Q1_1.smt2 b/TP2-3/enigme/enigme-Proposition-Q1_1.smt2 new file mode 100644 index 0000000..baa492f --- /dev/null +++ b/TP2-3/enigme/enigme-Proposition-Q1_1.smt2 @@ -0,0 +1,34 @@ +;;; generated by SMT-LIB2 driver +;;; SMT-LIB2 driver: bit-vectors, common part +(declare-datatypes () ((tuple0 (Tuple0)))) +(declare-fun a () Bool) + +(declare-fun b () Bool) + +(declare-fun c () Bool) + +(declare-fun da () Bool) + +;; da_def + (assert (= da (and b (not c)))) + +(declare-fun db () Bool) + +;; db_def + (assert (= db (=> a c))) + +(declare-fun dc () Bool) + +;; dc_def + (assert (= dc (and (not c) (or a b)))) + +(declare-fun compat () Bool) + +;; compat_def + (assert (= compat (and da (and db dc)))) + +(assert +;; Q1 + ;; File "enigme/../enigme.mlw", line 15, characters 7-9 + (not (not compat))) +(check-sat) diff --git a/TP2-3/enigme/enigme_Predicats_Thm01_1.v b/TP2-3/enigme/enigme_Predicats_Thm01_1.v new file mode 100644 index 0000000..da62a14 --- /dev/null +++ b/TP2-3/enigme/enigme_Predicats_Thm01_1.v @@ -0,0 +1,27 @@ +(* This file is generated by Why3's Coq driver *) +(* Beware! Only edit allowed sections below *) +Require Import BuiltIn. +Require BuiltIn. + +Parameter a: Prop. + +Parameter b: Prop. + +Parameter c: Prop. + +(* Why3 assumption *) +Definition da : Prop := b /\ ~ c. + +(* Why3 assumption *) +Definition db : Prop := a -> c. + +(* Why3 assumption *) +Definition dc : Prop := ~ c /\ (a \/ b). + +(* Why3 goal *) +Theorem Thm01 : da /\ (db /\ dc). +Proof. + + +Qed. + diff --git a/TP2-3/enigme/why3session.xml b/TP2-3/enigme/why3session.xml new file mode 100644 index 0000000..683e08b --- /dev/null +++ b/TP2-3/enigme/why3session.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TP2-3/sujet.pdf b/TP2-3/sujet.pdf new file mode 100644 index 0000000..22138a7 Binary files /dev/null and b/TP2-3/sujet.pdf differ diff --git a/TP2/TP2.v b/TP2/TP2.v new file mode 100755 index 0000000..3a8ef43 --- /dev/null +++ b/TP2/TP2.v @@ -0,0 +1,45 @@ +(* Ouverture d’une section *) +Section CalculPredicats. +(* Définition de 2 domaines pour les prédicats *) +Variable A B : Type. + +(* Formule du second ordre : Quantification des prédicats phi et psi *) +Theorem Thm_8 : forall (P Q : A -> Prop), + (forall x1 : A, (P x1) /\ (Q x1)) + -> (forall x2 : A, (P x2)) /\ (forall x3 : A, (Q x3)). +intros. +split. +intro x2. +destruct (H x2). +exact H0. +intro x3. +destruct (H x3). +exact H1. +Qed. + +(* Formule du second ordre : Quantification des prédicats phi et psi *) +Theorem Thm_9 : forall (P : A -> B -> Prop), + (exists x1 : A, forall y1 : B, (P x1 y1)) + -> forall y2 : B, exists x2 : A, (P x2 y2). +intros. +destruct H. +exists x. +generalize y2. +exact H. +Qed. + + +(* Formule du second ordre : Quantification des prédicats phi et psi *) +Theorem Thm_10 : forall (P Q : A -> Prop), + (exists x1 : A, (P x1) -> (Q x1)) + -> (forall x2 : A, (P x2)) -> exists x3 : A, (Q x3). +intros. +destruct H. +exists x. +cut (P x). +exact H. +generalize x. +exact H0. +Qed. + +End CalculPredicats. \ No newline at end of file diff --git a/TP2/TP2.v.crashcoqide b/TP2/TP2.v.crashcoqide new file mode 100755 index 0000000..5aaba17 --- /dev/null +++ b/TP2/TP2.v.crashcoqide @@ -0,0 +1,49 @@ +(* Ouverture d’une section *) +Section CalculPredicats. +(* Définition de 2 domaines pour les prédicats *) +Variable A B : Type. + +(* Formule du second ordre : Quantification des prédicats phi et psi *) +Theorem Thm_8 : forall (P Q : A -> Prop), + (forall x1 : A, (P x1) /\ (Q x1)) + -> (forall x2 : A, (P x2)) /\ (forall x3 : A, (Q x3)). +intros. +split. +intro x2. +exists. + + + + + + + + + + + + + + + + + + + + + + +(* Formule du second ordre : Quantification des prédicats phi et psi +Theorem Thm_9 : forall (P : A -> B -> Prop), + (exists x1 : A, forall y1 : B, (P x1 y1)) + -> forall y2 : B, exists x2 : A, (P x2 y2). +intros.*) + +(* Formule du second ordre : Quantification des prédicats phi et psi +Theorem Thm_10 : forall (P Q : A -> Prop), + (exists x1 : A, (P x1) -> (Q x1)) + -> (forall x2 : A, (P x2)) -> exists x3 : A, (Q x3). +intros. +exists x2.*) + +End CalculPredicats. \ No newline at end of file diff --git a/TP2/enigme.mlw b/TP2/enigme.mlw new file mode 100755 index 0000000..c557982 --- /dev/null +++ b/TP2/enigme.mlw @@ -0,0 +1,29 @@ +theory Enigme + + predicate a + predicate b + predicate c + + predicate da = b /\ (not c) + predicate db = a -> c + predicate dc = (not c) /\ ( a \/ b ) + + goal Q1: not (da /\ db /\ dc) + (* on demande ensuite un contre exemple *) + + goal Q2c: da /\ db -> dc (* vrai *) + goal Q2b: dc /\ da -> db (* faux *) + goal Q2a: db /\ dc -> da (* vrai *) + + goal Q3a: (not a) /\ (not b) /\ (not c) -> da (* faux, a ment *) + goal Q3b: (not a) /\ (not b) /\ (not c) -> db (* b dit la vérité *) + goal Q3c: (not a) /\ (not b) /\ (not c) -> dc (* faux, c ment *) + + goal Q4a: da /\ db /\ dc -> a (* faux, a innocent *) + goal Q4b: da /\ db /\ dc -> b (* b coupable *) + goal Q4c: da /\ db /\ dc -> c (* faux, c innocent *) + + goal Q5: not ( (a -> (not da)) /\ (b -> (not db)) /\ (c -> (not dc)) ) + (* on demande ensuite un contre exemple *) + +end diff --git a/TP2/enigme/enigme-Predicats-Thm01_1.cvc b/TP2/enigme/enigme-Predicats-Thm01_1.cvc new file mode 100755 index 0000000..a91fa97 --- /dev/null +++ b/TP2/enigme/enigme-Predicats-Thm01_1.cvc @@ -0,0 +1,83 @@ +%%% this is a prelude for CVC3 +uni : TYPE; + +ty : TYPE; + +sort: (ty, uni) -> BOOLEAN; + +witness: (ty) -> uni; + +% witness_sort + ASSERT (FORALL (a : ty): (sort(a, witness(a)))); + +int: ty; + +real: ty; + +bool: ty; + +match_bool: (ty, BITVECTOR(1), uni, uni) -> uni; + +% match_bool_sort + ASSERT + (FORALL (a : ty): + (FORALL (x : BITVECTOR(1), x1 : uni, x2 : uni): (sort(a, match_bool(a, x, + x1, x2))))); + +% match_bool_True + ASSERT + (FORALL (a : ty): + (FORALL (z : uni, z1 : uni): + ((sort(a, z)) => (match_bool(a, 0bin1, z, z1) = z)))); + +% match_bool_False + ASSERT + (FORALL (a : ty): + (FORALL (z : uni, z1 : uni): + ((sort(a, z1)) => (match_bool(a, 0bin0, z, z1) = z1)))); + +index_bool: (BITVECTOR(1)) -> INT; + +% index_bool_True + ASSERT (index_bool(0bin1) = 0); + +% index_bool_False + ASSERT (index_bool(0bin0) = 1); + +% bool_inversion + ASSERT (FORALL (u : BITVECTOR(1)): ((u = 0bin1) OR (u = 0bin0))); + +tuple0 : TYPE; + +tuple01: ty; + +Tuple0: tuple0; + +% tuple0_inversion + ASSERT (FORALL (u : tuple0): (u = Tuple0)); + +a: BOOLEAN; + +b: BOOLEAN; + +c: BOOLEAN; + +da: BOOLEAN; + +% da_def + ASSERT (da <=> (b AND (NOT c))); + +db: BOOLEAN; + +% db_def + ASSERT (db <=> (a => c)); + +dc: BOOLEAN; + +% dc_def + ASSERT (dc <=> ((NOT c) AND (a OR b))); + +QUERY +% Thm01 + % File "enigme.mlw", line 13, characters 7-12 + (da AND (db AND dc)); diff --git a/TP2/enigme/enigme-Predicats-Thm01_1.smt2 b/TP2/enigme/enigme-Predicats-Thm01_1.smt2 new file mode 100755 index 0000000..d170dce --- /dev/null +++ b/TP2/enigme/enigme-Predicats-Thm01_1.smt2 @@ -0,0 +1,29 @@ +;;; generated by SMT-LIB2 driver +;;; SMT-LIB2 driver: bit-vectors, common part +(declare-datatypes () ((tuple0 (Tuple0)))) +(declare-fun a () Bool) + +(declare-fun b () Bool) + +(declare-fun c () Bool) + +(declare-fun da () Bool) + +;; da_def + (assert (= da (and b (not c)))) + +(declare-fun db () Bool) + +;; db_def + (assert (= db (=> a c))) + +(declare-fun dc () Bool) + +;; dc_def + (assert (= dc (and (not c) (or a b)))) + +(assert +;; Thm01 + ;; File "enigme.mlw", line 13, characters 7-12 + (not (and da (and db dc)))) +(check-sat) diff --git a/TP2/enigme/enigme-Proposition-Q1_1.smt2 b/TP2/enigme/enigme-Proposition-Q1_1.smt2 new file mode 100755 index 0000000..baa492f --- /dev/null +++ b/TP2/enigme/enigme-Proposition-Q1_1.smt2 @@ -0,0 +1,34 @@ +;;; generated by SMT-LIB2 driver +;;; SMT-LIB2 driver: bit-vectors, common part +(declare-datatypes () ((tuple0 (Tuple0)))) +(declare-fun a () Bool) + +(declare-fun b () Bool) + +(declare-fun c () Bool) + +(declare-fun da () Bool) + +;; da_def + (assert (= da (and b (not c)))) + +(declare-fun db () Bool) + +;; db_def + (assert (= db (=> a c))) + +(declare-fun dc () Bool) + +;; dc_def + (assert (= dc (and (not c) (or a b)))) + +(declare-fun compat () Bool) + +;; compat_def + (assert (= compat (and da (and db dc)))) + +(assert +;; Q1 + ;; File "enigme/../enigme.mlw", line 15, characters 7-9 + (not (not compat))) +(check-sat) diff --git a/TP2/enigme/enigme_Predicats_Thm01_1.v b/TP2/enigme/enigme_Predicats_Thm01_1.v new file mode 100755 index 0000000..da62a14 --- /dev/null +++ b/TP2/enigme/enigme_Predicats_Thm01_1.v @@ -0,0 +1,27 @@ +(* This file is generated by Why3's Coq driver *) +(* Beware! Only edit allowed sections below *) +Require Import BuiltIn. +Require BuiltIn. + +Parameter a: Prop. + +Parameter b: Prop. + +Parameter c: Prop. + +(* Why3 assumption *) +Definition da : Prop := b /\ ~ c. + +(* Why3 assumption *) +Definition db : Prop := a -> c. + +(* Why3 assumption *) +Definition dc : Prop := ~ c /\ (a \/ b). + +(* Why3 goal *) +Theorem Thm01 : da /\ (db /\ dc). +Proof. + + +Qed. + diff --git a/TP2/enigme/why3session.xml b/TP2/enigme/why3session.xml new file mode 100755 index 0000000..683e08b --- /dev/null +++ b/TP2/enigme/why3session.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TP4/induction-etu.mlw b/TP4/induction-etu.mlw new file mode 100644 index 0000000..7970ca3 --- /dev/null +++ b/TP4/induction-etu.mlw @@ -0,0 +1,23 @@ +theory Induction + +(* Définition du type inductif liste *) +type liste 'a = Nil | Cons 'a (liste 'a) + +(* Concaténation de deux listes *) +function append (l1 l2 : liste 'a) : liste 'a = + match l1 with + | Nil -> l2 + | Cons t q -> Cons t (append q l2) + end + +lemma append_Nil_left : forall l : liste 'a. append Nil l = l + +lemma append_Cons_left : forall e : 'a. forall l1 l2 : liste 'a. + append (Cons e l1) l2 = Cons e (append l1 l2) + +lemma append_Nil_right: forall l : liste 'a. append l Nil = l + +lemma append_associative : forall l1 [@induction] l2 l3 : liste 'a. + append l1 (append l2 l3) = append (append l1 l2) l3 + +end \ No newline at end of file diff --git a/TP4/induction-etu.v b/TP4/induction-etu.v new file mode 100644 index 0000000..954c5a4 --- /dev/null +++ b/TP4/induction-etu.v @@ -0,0 +1,121 @@ +Require Import Extraction. +(* Ouverture d’une section *) +Section Induction. +(* Déclaration d’un domaine pour les éléments des listes *) +Variable A : Set. + +Inductive liste : Set := + Nil : liste +| Cons : A -> liste -> liste. + +(* Déclaration du nom de la fonction *) +Variable append_spec : liste -> liste -> liste. + +(* Spécification du comportement pour Nil *) +Axiom append_Nil : forall (l : liste), append_spec Nil l = l. + +(* Spécification du comportement pour Cons *) +Axiom append_Cons : forall (t : A), forall (q l : liste), + append_spec (Cons t q) l = Cons t (append_spec q l). + +Theorem append_Nil_right : forall (l : liste), (append_spec l Nil) = l. +intros. +induction l. +(*cas de base*) +apply append_Nil. +(*cas general*) +rewrite append_Cons. +rewrite IHl. +reflexivity. +Qed. + +Theorem append_associative : forall (l1 l2 l3 : liste), + (append_spec l1 (append_spec l2 l3)) = (append_spec (append_spec l1 l2) l3). +intros. +induction l1. +(*cas de base*) +rewrite append_Nil. +rewrite append_Nil. +reflexivity. +(*cas general*) +rewrite append_Cons. +rewrite IHl1. +rewrite append_Cons. +rewrite append_Cons. +reflexivity. +Qed. + +(* Implantation de la fonction append *) +Fixpoint append_impl (l1 l2 : liste) {struct l1} : liste := + match l1 with + Nil => l2 + | (Cons t1 q1) => (Cons t1 (append_impl q1 l2)) +end. + +Theorem append_correctness : forall (l1 l2 : liste), + (append_spec l1 l2) = (append_impl l1 l2). +intros. +induction l1. +(*cas de base*) +rewrite append_Nil. +simpl append_impl. +reflexivity. +(*cas general*) +rewrite append_Cons. +simpl append_impl. +rewrite IHl1. +reflexivity. +Qed. + +(* Implantation de la fonction rev (reverse d'une liste) *) +Fixpoint rev_impl (l : liste) : liste := + match l with + Nil => Nil + | (Cons t1 q1) => (append_impl (rev_impl q1)( Cons t1 Nil)) +end. + +Lemma rev_append : forall (l1 l2 : liste), + (rev_impl (append_impl l1 l2)) = (append_impl (rev_impl l2) (rev_impl l1)). +intros. +induction l1. +(*cas de base *) +simpl append_impl. +rewrite <- append_correctness. +rewrite append_Nil_right. +reflexivity. +(*cas general*) +simpl rev_impl. +rewrite IHl1. +rewrite <- append_correctness. +rewrite <- append_correctness. +rewrite <- append_correctness. +rewrite <- append_correctness. +rewrite append_associative. +reflexivity. +Qed. + +Theorem rev_rev : forall (l : liste), (rev_impl (rev_impl l)) = l. +intros. +induction l. +(*Cas de base*) +simpl rev_impl. +reflexivity. +(*cas general*) +simpl rev_impl. +rewrite rev_append. +rewrite IHl. +simpl rev_impl. +rewrite <- append_correctness. +rewrite append_Cons. +rewrite append_Nil. +reflexivity. +Qed. + +End Induction. + +Extraction Language Ocaml. +Extraction "/tmp/induction" append_impl rev_impl. +Extraction Language Haskell. +Extraction "/tmp/induction" append_impl rev_impl. +Extraction Language Scheme. +Extraction "/tmp/induction" append_impl rev_impl. diff --git a/TP4/readme.txt b/TP4/readme.txt new file mode 100644 index 0000000..b626354 --- /dev/null +++ b/TP4/readme.txt @@ -0,0 +1,9 @@ +2020-10-13 +Modélisation TP4 +http://moodle-n7.inp-toulouse.fr/pluginfile.php/90409/mod_resource/content/4/equipes-TD5TD6.txt + +Membres de groupe G-5: +EL HADFI Younes +HAMMAMI Linda +HAUTEVILLE Leane +FAINSIN Laurent diff --git a/TP5/induction-etu.mlw b/TP5/induction-etu.mlw new file mode 100755 index 0000000..7970ca3 --- /dev/null +++ b/TP5/induction-etu.mlw @@ -0,0 +1,23 @@ +theory Induction + +(* Définition du type inductif liste *) +type liste 'a = Nil | Cons 'a (liste 'a) + +(* Concaténation de deux listes *) +function append (l1 l2 : liste 'a) : liste 'a = + match l1 with + | Nil -> l2 + | Cons t q -> Cons t (append q l2) + end + +lemma append_Nil_left : forall l : liste 'a. append Nil l = l + +lemma append_Cons_left : forall e : 'a. forall l1 l2 : liste 'a. + append (Cons e l1) l2 = Cons e (append l1 l2) + +lemma append_Nil_right: forall l : liste 'a. append l Nil = l + +lemma append_associative : forall l1 [@induction] l2 l3 : liste 'a. + append l1 (append l2 l3) = append (append l1 l2) l3 + +end \ No newline at end of file diff --git a/TP5/induction-etu.v b/TP5/induction-etu.v new file mode 100755 index 0000000..d93cb9f --- /dev/null +++ b/TP5/induction-etu.v @@ -0,0 +1,123 @@ +Require Import Extraction. +(* Ouverture d’une section *) +Section Induction. +(* Déclaration d’un domaine pour les éléments des listes *) +Variable A : Set. + +Inductive liste : Set := + Nil : liste +| Cons : A -> liste -> liste. + +(* Déclaration du nom de la fonction *) +Variable append_spec : liste -> liste -> liste. + +(* Spécification du comportement pour Nil *) +Axiom append_Nil : forall (l : liste), append_spec Nil l = l. + +(* Spécification du comportement pour Cons *) +Axiom append_Cons : forall (t : A), forall (q l : liste), + append_spec (Cons t q) l = Cons t (append_spec q l). + +Theorem append_Nil_right : forall (l : liste), (append_spec l Nil) = l. +intros. +induction l. +(* cas de base *) +apply append_Nil. +(* cas général *) +rewrite append_Cons. +rewrite IHl. +reflexivity. +Qed. + + +Theorem append_associative : forall (l1 l2 l3 : liste), + (append_spec l1 (append_spec l2 l3)) = (append_spec (append_spec l1 l2) l3). +intros. +induction l1. +(* cas de base *) +rewrite append_Nil. +rewrite append_Nil. +reflexivity. +(* cas général *) +rewrite append_Cons. +rewrite append_Cons. +rewrite append_Cons. +rewrite IHl1. +reflexivity. +Qed. + + +(* Implantation de la fonction append *) +Fixpoint append_impl (l1 l2 : liste) {struct l1} : liste := + match l1 with + Nil => l2 + | (Cons t1 q1) => (Cons t1 (append_impl q1 l2)) +end. + +Theorem append_correctness : forall (l1 l2 : liste), + (append_spec l1 l2) = (append_impl l1 l2). +intros. +induction l1. +(* cas de base *) +rewrite append_Nil. +simpl append_impl. +reflexivity. +(* cas général *) +rewrite append_Cons. +simpl append_impl. +rewrite IHl1. +reflexivity. +Qed. + +(* Implantation de la fonction rev (reverse d'une liste) *) +Fixpoint rev_impl (l : liste) : liste := + match l with + Nil => l + | (Cons x y) => ( append_impl (rev_impl y) (Cons x Nil) ) +end. + + +Lemma rev_append : forall (l1 l2 : liste), + (rev_impl (append_impl l1 l2)) = (append_impl (rev_impl l2) (rev_impl l1)). +intros. +induction l1. +(* cas de base *) +simpl rev_impl. +rewrite <- append_correctness. +rewrite append_Nil_right. +reflexivity. +(* cas général *) +simpl rev_impl. +rewrite IHl1. +rewrite <- append_correctness. +rewrite <- append_correctness. +rewrite <- append_correctness. +rewrite <- append_correctness. +rewrite append_associative. +reflexivity. +Qed. + +Theorem rev_rev : forall (l : liste), (rev_impl (rev_impl l)) = l. +intros. +induction l. +(* cas de base *) +simpl rev_impl. +reflexivity. +(* cas général *) +simpl rev_impl. +rewrite rev_append. +rewrite IHl. +simpl rev_impl. +rewrite <- append_correctness. +rewrite append_Cons. +rewrite append_Nil. +reflexivity. +Qed. + +End Induction. +Extraction Language Ocaml. +Extraction "/tmp/induction" append_impl rev_impl. +Extraction Language Haskell. +Extraction "/tmp/induction" append_impl rev_impl. +Extraction Language Scheme. +Extraction "/tmp/induction" append_impl rev_impl. diff --git a/TP5/induction-etu.wlm b/TP5/induction-etu.wlm new file mode 100755 index 0000000..7970ca3 --- /dev/null +++ b/TP5/induction-etu.wlm @@ -0,0 +1,23 @@ +theory Induction + +(* Définition du type inductif liste *) +type liste 'a = Nil | Cons 'a (liste 'a) + +(* Concaténation de deux listes *) +function append (l1 l2 : liste 'a) : liste 'a = + match l1 with + | Nil -> l2 + | Cons t q -> Cons t (append q l2) + end + +lemma append_Nil_left : forall l : liste 'a. append Nil l = l + +lemma append_Cons_left : forall e : 'a. forall l1 l2 : liste 'a. + append (Cons e l1) l2 = Cons e (append l1 l2) + +lemma append_Nil_right: forall l : liste 'a. append l Nil = l + +lemma append_associative : forall l1 [@induction] l2 l3 : liste 'a. + append l1 (append l2 l3) = append (append l1 l2) l3 + +end \ No newline at end of file diff --git a/TP5/induction-etu/why3session.xml b/TP5/induction-etu/why3session.xml new file mode 100755 index 0000000..a0ad9c4 --- /dev/null +++ b/TP5/induction-etu/why3session.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TP6/ascendant.mlw b/TP6/ascendant.mlw new file mode 100755 index 0000000..8666063 --- /dev/null +++ b/TP6/ascendant.mlw @@ -0,0 +1,37 @@ +(* Spécification de la fonction factorielle *) + +theory Factorielle + + use int.Int + + function factorielle( n : int ) : int + + axiom factorielle_zero : (factorielle zero) = one + + axiom factorielle_succ : forall n : int. (n > 0) -> (factorielle n) = (n * (factorielle (n - 1))) + +end + +(* Implémentation de la fonction factorielle par un algorithme ascendant *) + +module FactorielleAscendant + + use int.Int + use ref.Refint + use Factorielle + + let factorielle_ascendant (n: int) : int + requires { 0 <= n } + ensures { result = (factorielle n) } + = + let i = ref 0 in + let r = ref 1 in + while (!i < n) do + invariant { !r = (factorielle !i) && ( 0 <= !i <= n ) } + variant { n - !i } + i := (!i) + 1; + r := (!i) * (!r) + done; + !r + +end diff --git a/TP6/ascendant/ascendant_FactorielleAscendant_VC_factorielle_ascendant_1.v b/TP6/ascendant/ascendant_FactorielleAscendant_VC_factorielle_ascendant_1.v new file mode 100755 index 0000000..2a3167a --- /dev/null +++ b/TP6/ascendant/ascendant_FactorielleAscendant_VC_factorielle_ascendant_1.v @@ -0,0 +1,42 @@ +(* This file is generated by Why3's Coq driver *) +(* Beware! Only edit allowed sections below *) +Require Import BuiltIn. +Require BuiltIn. +Require int.Int. + +(* Why3 assumption *) +Inductive ref (a:Type) := + | mk_ref : a -> ref a. +Axiom ref_WhyType : forall (a:Type) {a_WT:WhyType a}, WhyType (ref a). +Existing Instance ref_WhyType. +Arguments mk_ref {a}. + +(* Why3 assumption *) +Definition contents {a:Type} {a_WT:WhyType a} (v:ref a) : a := + match v with + | mk_ref x => x + end. + +Parameter factorielle: Z -> Z. + +Axiom factorielle_zero : ((factorielle 0%Z) = 1%Z). + +Axiom factorielle_succ : + forall (n:Z), (0%Z < n)%Z -> + ((factorielle n) = (n * (factorielle (n - 1%Z)%Z))%Z). + +Parameter n: Z. + +Axiom H : (0%Z <= n)%Z. + +(* Why3 goal *) +Theorem VC_factorielle_ascendant : + (1%Z = (factorielle 0%Z)) /\ ((0%Z <= 0%Z)%Z /\ (0%Z <= n)%Z). +split. +rewrite factorielle_zero. +reflexivity. +split. +omega. +apply H. +Qed. + diff --git a/TP6/ascendant/ascendant_FactorielleAscendant_VC_factorielle_ascendant_2.v b/TP6/ascendant/ascendant_FactorielleAscendant_VC_factorielle_ascendant_2.v new file mode 100755 index 0000000..ee12c35 --- /dev/null +++ b/TP6/ascendant/ascendant_FactorielleAscendant_VC_factorielle_ascendant_2.v @@ -0,0 +1,67 @@ +(* This file is generated by Why3's Coq driver *) +(* Beware! Only edit allowed sections below *) +Require Import BuiltIn. +Require BuiltIn. +Require int.Int. + +(* Why3 assumption *) +Inductive ref (a:Type) := + | mk_ref : a -> ref a. +Axiom ref_WhyType : forall (a:Type) {a_WT:WhyType a}, WhyType (ref a). +Existing Instance ref_WhyType. +Arguments mk_ref {a}. + +(* Why3 assumption *) +Definition contents {a:Type} {a_WT:WhyType a} (v:ref a) : a := + match v with + | mk_ref x => x + end. + +Parameter factorielle: Z -> Z. + +Axiom factorielle_zero : ((factorielle 0%Z) = 1%Z). + +Axiom factorielle_succ : + forall (n:Z), (0%Z < n)%Z -> + ((factorielle n) = (n * (factorielle (n - 1%Z)%Z))%Z). + +Parameter n: Z. + +Axiom H : (0%Z <= n)%Z. + +Parameter r: Z. + +Parameter i: Z. + +Axiom H1 : (r = (factorielle i)). + +Axiom H2 : (0%Z <= i)%Z. + +Axiom H3 : (i <= n)%Z. + +Axiom H4 : (i < n)%Z. + +Parameter i1: Z. + +Axiom H5 : (i1 = (i + 1%Z)%Z). + +Parameter r1: Z. + +Axiom H6 : (r1 = (i1 * r)%Z). + +(* Why3 goal *) +Theorem VC_factorielle_ascendant : + (0%Z <= (n - i)%Z)%Z /\ ((n - i1)%Z < (n - i)%Z)%Z. +split. +generalize H. +intros. +generalize H3. +intros. +omega. +generalize H. +intros. +generalize H5. +intros. +omega. +Qed. + diff --git a/TP6/ascendant/ascendant_FactorielleAscendant_VC_factorielle_ascendant_3.v b/TP6/ascendant/ascendant_FactorielleAscendant_VC_factorielle_ascendant_3.v new file mode 100755 index 0000000..750c948 --- /dev/null +++ b/TP6/ascendant/ascendant_FactorielleAscendant_VC_factorielle_ascendant_3.v @@ -0,0 +1,70 @@ +(* This file is generated by Why3's Coq driver *) +(* Beware! Only edit allowed sections below *) +Require Import BuiltIn. +Require BuiltIn. +Require int.Int. + +(* Why3 assumption *) +Inductive ref (a:Type) := + | mk_ref : a -> ref a. +Axiom ref_WhyType : forall (a:Type) {a_WT:WhyType a}, WhyType (ref a). +Existing Instance ref_WhyType. +Arguments mk_ref {a}. + +(* Why3 assumption *) +Definition contents {a:Type} {a_WT:WhyType a} (v:ref a) : a := + match v with + | mk_ref x => x + end. + +Parameter factorielle: Z -> Z. + +Axiom factorielle_zero : ((factorielle 0%Z) = 1%Z). + +Axiom factorielle_succ : + forall (n:Z), (0%Z < n)%Z -> + ((factorielle n) = (n * (factorielle (n - 1%Z)%Z))%Z). + +Parameter n: Z. + +Axiom H : (0%Z <= n)%Z. + +Parameter r: Z. + +Parameter i: Z. + +Axiom H1 : (r = (factorielle i)). + +Axiom H2 : (0%Z <= i)%Z. + +Axiom H3 : (i <= n)%Z. + +Axiom H4 : (i < n)%Z. + +Parameter i1: Z. + +Axiom H5 : (i1 = (i + 1%Z)%Z). + +Parameter r1: Z. + +Axiom H6 : (r1 = (i1 * r)%Z). + +Axiom H7 : ((i+1-1) = i)%Z. + +(* Why3 goal *) +Theorem VC_factorielle_ascendant : + (r1 = (factorielle i1)) /\ ((0%Z <= i1)%Z /\ (i1 <= n)%Z). +split. +generalize H1. +intros. +rewrite H6. +rewrite -> factorielle_succ. +rewrite H5. +rewrite H0. +rewrite H7. +reflexivity. +generalize H2. +intros. +rewrite H5. +Qed. + diff --git a/TP6/ascendant/ascendant_FactorielleAscendant_VC_factorielle_ascendant_4.v b/TP6/ascendant/ascendant_FactorielleAscendant_VC_factorielle_ascendant_4.v new file mode 100755 index 0000000..1165424 --- /dev/null +++ b/TP6/ascendant/ascendant_FactorielleAscendant_VC_factorielle_ascendant_4.v @@ -0,0 +1,52 @@ +(* This file is generated by Why3's Coq driver *) +(* Beware! Only edit allowed sections below *) +Require Import BuiltIn. +Require BuiltIn. +Require int.Int. + +(* Why3 assumption *) +Inductive ref (a:Type) := + | mk_ref : a -> ref a. +Axiom ref_WhyType : forall (a:Type) {a_WT:WhyType a}, WhyType (ref a). +Existing Instance ref_WhyType. +Arguments mk_ref {a}. + +(* Why3 assumption *) +Definition contents {a:Type} {a_WT:WhyType a} (v:ref a) : a := + match v with + | mk_ref x => x + end. + +Parameter factorielle: Z -> Z. + +Axiom factorielle_zero : ((factorielle 0%Z) = 1%Z). + +Axiom factorielle_succ : + forall (n:Z), (0%Z < n)%Z -> + ((factorielle n) = (n * (factorielle (n - 1%Z)%Z))%Z). + +Parameter n: Z. + +Axiom H : (0%Z <= n)%Z. + +Parameter r: Z. + +Parameter i: Z. + +Axiom H1 : (r = (factorielle i)). + +Axiom H2 : (0%Z <= i)%Z. + +Axiom H3 : (i <= n)%Z. +Axiom H4 : ~ (i < n)%Z. + +(* H3 et H4 implique H43 *) +Axiom H34 : ( i = n )%Z. + +(* Why3 goal *) +Theorem VC_factorielle_ascendant : (r = (factorielle n)). +rewrite H1. +rewrite H34. +reflexivity. +Qed. + diff --git a/TP6/ascendant/why3session.xml b/TP6/ascendant/why3session.xml new file mode 100755 index 0000000..bb94a95 --- /dev/null +++ b/TP6/ascendant/why3session.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TP6/descendant.mlw b/TP6/descendant.mlw new file mode 100755 index 0000000..4d7c0f2 --- /dev/null +++ b/TP6/descendant.mlw @@ -0,0 +1,37 @@ +(* Spécification de la fonction factorielle *) + +theory Factorielle + + use int.Int + + function factorielle( n : int ) : int + + axiom factorielle_zero : (factorielle zero) = one + + axiom factorielle_succ : forall n : int. (n > 0) -> (factorielle n) = (n * (factorielle (n - 1))) + +end + +(* Implémentation de la fonction factorielle par un algorithme descendant *) + +module FactorielleDescendant + + use int.Int + use Factorielle + use ref.Refint + + let factorielle_descendant (n: int) : int + requires { 0 <= n } + ensures { result = (factorielle n) } + = + let i = ref n in + let r = ref 1 in + while (0 < !i) do + invariant { !r * factorielle !i = factorielle n && 0 <= !i } + variant { !i } + r := !i * !r; + i := !i - 1 + done; + !r + +end diff --git a/TP6/descendant/why3session.xml b/TP6/descendant/why3session.xml new file mode 100755 index 0000000..dd7a418 --- /dev/null +++ b/TP6/descendant/why3session.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TP6/division.mlw b/TP6/division.mlw new file mode 100755 index 0000000..418b256 --- /dev/null +++ b/TP6/division.mlw @@ -0,0 +1,23 @@ + +(* Division entière par l'algorithme d'Euclide *) + +module Division + + use int.Int + use ref.Refint + + let division (a b: int) (* renvoie une paire d'entiers (quotient,reste) *) + requires { 0 <= a && 0 < b } + ensures { let (q,r) = result in q * b + r = a && 0 <= r < b } + = + let q = ref 0 in + let r = ref a in + while !r >= b do + invariant { a = !q * b + !r && 0 <= !q && 0 <= !r } + variant { !r - b } + q := (!q) + 1; + r := (!r) - b + done; + (!q,!r) + +end diff --git a/TP6/division/why3session.xml b/TP6/division/why3session.xml new file mode 100755 index 0000000..86c96fa --- /dev/null +++ b/TP6/division/why3session.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TP6/pgcd.mlw b/TP6/pgcd.mlw new file mode 100755 index 0000000..8a1d401 --- /dev/null +++ b/TP6/pgcd.mlw @@ -0,0 +1,38 @@ + +(* PGCD : Algorithme Euclide *) + +theory PGCD + + use int.Int + + function pgcd(a b : int) : int + + axiom A1 : forall a: int. (a>0) -> ( pgcd a a ) = a + axiom A2 : forall a,b: int. (a>0 && b>0) -> ( pgcd a b ) = ( pgcd b a ) + axiom A3 : forall a,b: int. (a>b>0) -> ( pgcd a b ) = (pgcd (a-b) b ) + +end + +module PGCDEuclide + + use import int.Int + use import ref.Refint + use import PGCD + + let pgcd_euclide (a b: int) : int + requires { 0 < a && 0 < b } + ensures { result = (pgcd a b)} + = + let ap = ref a in + let bp = ref b in + while (!ap <> !bp) do + invariant { (pgcd a b ) = ( pgcd !ap !bp ) && !ap > 0 && !bp > 0 } + variant { !ap + !bp } + if (!ap <= !bp) then + bp := !bp - !ap + else + ap := !ap - !bp + done; + !ap + +end diff --git a/TP6/pgcd/why3session.xml b/TP6/pgcd/why3session.xml new file mode 100755 index 0000000..92cf434 --- /dev/null +++ b/TP6/pgcd/why3session.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TP7/.Naturelle.aux b/TP7/.Naturelle.aux new file mode 100755 index 0000000..9986a4a --- /dev/null +++ b/TP7/.Naturelle.aux @@ -0,0 +1,40 @@ +COQAUX1 f13e540aa0997388dd1408b0662438d6 /home/lfainsin/1A/Modé/TP7/Naturelle.v +383 387 proof_build_time "0.000" +0 0 E_imp_th "0.000" +383 387 context_used "" +383 387 proof_check_time "0.000" +0 0 VernacProof "tac:no using:no" +916 920 proof_build_time "0.000" +0 0 E_forall_th "0.000" +916 920 context_used "" +916 920 proof_check_time "0.000" +1291 1295 proof_build_time "0.001" +0 0 E_et_g_th "0.001" +1291 1295 context_used "" +1291 1295 proof_check_time "0.000" +1601 1605 proof_build_time "0.000" +0 0 E_et_d_th "0.000" +1601 1605 context_used "" +1601 1605 proof_check_time "0.000" +1983 1987 proof_build_time "0.001" +0 0 E_ou_th "0.001" +1983 1987 context_used "" +1983 1987 proof_check_time "0.000" +0 0 VernacProof "tac:no using:no" +2806 2810 proof_build_time "0.001" +0 0 E_exists_th "0.001" +2806 2810 context_used "" +2806 2810 proof_check_time "0.000" +3280 3284 proof_build_time "0.000" +0 0 E_antiT_th "0.000" +3280 3284 context_used "" +3280 3284 proof_check_time "0.000" +3502 3506 proof_build_time "0.001" +0 0 I_antiT_th "0.001" +3502 3506 context_used "" +3502 3506 proof_check_time "0.000" +3683 3687 proof_build_time "0.000" +0 0 I_non_th "0.000" +3683 3687 context_used "" +3683 3687 proof_check_time "0.000" +0 0 vo_compile_time "0.107" diff --git a/TP7/._Naturelle.v b/TP7/._Naturelle.v new file mode 100755 index 0000000..9f9b07e Binary files /dev/null and b/TP7/._Naturelle.v differ diff --git a/TP7/Naturelle.glob b/TP7/Naturelle.glob new file mode 100755 index 0000000..df9312d --- /dev/null +++ b/TP7/Naturelle.glob @@ -0,0 +1,150 @@ +DIGEST f13e540aa0997388dd1408b0662438d6 +FNaturelle +R15:23 Coq.Logic.Classical <> <> lib +R97:100 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R97:100 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R218:221 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R218:221 Coq.Init.Logic <> ::type_scope:x_'->'_x not +prf 278:285 <> E_imp_th +R314:314 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R325:329 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R333:336 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R337:339 Naturelle <> psi var +R330:332 Naturelle <> phi var +R318:321 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R322:324 Naturelle <> psi var +R315:317 Naturelle <> phi var +R443:450 Naturelle <> E_imp_th thm +R521:528 Naturelle <> E_imp_th thm +prf 816:826 <> E_forall_th +R856:859 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R855:855 Naturelle <> A var +R869:869 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R885:889 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R890:892 Naturelle <> phi var +R894:894 Naturelle <> a var +R880:882 Naturelle <> phi var +R884:884 Naturelle <> x var +R996:1006 Naturelle <> E_forall_th thm +R1086:1089 Coq.Init.Logic <> ::type_scope:x_'/\'_x not +R1086:1089 Coq.Init.Logic <> ::type_scope:x_'/\'_x not +R1105:1108 Coq.Init.Logic <> conj constr +prf 1157:1165 <> E_et_g_th +R1194:1194 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1205:1209 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1210:1212 Naturelle <> phi var +R1198:1201 Coq.Init.Logic <> ::type_scope:x_'/\'_x not +R1195:1197 Naturelle <> phi var +R1202:1204 Naturelle <> psi var +R1352:1360 Naturelle <> E_et_g_th thm +R1432:1440 Naturelle <> E_et_g_th thm +prf 1465:1473 <> E_et_d_th +R1502:1502 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1513:1517 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1518:1520 Naturelle <> psi var +R1506:1509 Coq.Init.Logic <> ::type_scope:x_'/\'_x not +R1503:1505 Naturelle <> phi var +R1510:1512 Naturelle <> psi var +R1662:1670 Naturelle <> E_et_d_th thm +R1743:1751 Naturelle <> E_et_d_th thm +prf 1776:1782 <> E_ou_th +R1815:1815 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1826:1830 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1831:1831 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1842:1846 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1847:1847 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1858:1862 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1863:1865 Naturelle <> chi var +R1851:1854 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1855:1857 Naturelle <> chi var +R1848:1850 Naturelle <> psi var +R1835:1838 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R1839:1841 Naturelle <> chi var +R1832:1834 Naturelle <> phi var +R1819:1822 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R1816:1818 Naturelle <> phi var +R1823:1825 Naturelle <> psi var +R2042:2048 Naturelle <> E_ou_th thm +R2124:2130 Naturelle <> E_ou_th thm +R2194:2197 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R2194:2197 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R2213:2221 Coq.Init.Logic <> or_introl constr +R2305:2308 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R2305:2308 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R2324:2332 Coq.Init.Logic <> or_intror constr +R2416:2423 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2430:2433 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2439:2439 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2438:2438 Naturelle <> x var +R2416:2423 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2430:2433 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2439:2439 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2438:2438 Naturelle <> x var +R2453:2460 Coq.Init.Logic <> ex_intro constr +R2561:2568 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2575:2578 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2584:2584 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2583:2583 Naturelle <> x var +R2561:2568 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2575:2578 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2584:2584 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2583:2583 Naturelle <> x var +R2597:2604 Coq.Init.Logic <> ex_intro constr +prf 2669:2679 <> E_exists_th +R2709:2712 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2708:2708 Naturelle <> A var +R2733:2733 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2749:2753 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2754:2754 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2777:2781 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2782:2784 Naturelle <> chi var +R2770:2773 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R2774:2776 Naturelle <> chi var +R2765:2767 Naturelle <> phi var +R2769:2769 Naturelle <> a var +R2734:2740 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2742:2743 Coq.Init.Logic <> ::type_scope:'exists'_x_'..'_x_','_x not +R2744:2746 Naturelle <> phi var +R2748:2748 Naturelle <> x var +R2963:2973 Naturelle <> E_exists_th thm +R3083:3085 Coq.Init.Logic <> not def +R3116:3120 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R3132:3132 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R3123:3126 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3127:3131 Coq.Init.Logic <> False ind +R3116:3120 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R3132:3132 Coq.Init.Logic <> ::type_scope:x_'\/'_x not +R3123:3126 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3127:3131 Coq.Init.Logic <> False ind +R3145:3151 Coq.Logic.Classical_Prop <> classic prfax +prf 3209:3218 <> E_antiT_th +R3248:3251 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3252:3254 Naturelle <> phi var +R3243:3247 Coq.Init.Logic <> False ind +R3340:3349 Naturelle <> E_antiT_th thm +prf 3370:3379 <> I_antiT_th +R3407:3410 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3411:3411 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3416:3420 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3421:3425 Coq.Init.Logic <> False ind +R3412:3412 Coq.Init.Logic <> ::type_scope:'~'_x not +R3413:3415 Naturelle <> phi var +R3404:3406 Naturelle <> phi var +R3435:3437 Coq.Init.Logic <> not def +R3551:3555 Coq.Init.Logic <> False ind +R3551:3555 Coq.Init.Logic <> False ind +R3567:3576 Naturelle <> I_antiT_th thm +prf 3598:3605 <> I_non_th +R3630:3630 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3643:3647 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3648:3648 Coq.Init.Logic <> ::type_scope:'~'_x not +R3649:3651 Naturelle <> phi var +R3634:3637 Coq.Init.Logic <> ::type_scope:x_'->'_x not +R3638:3642 Coq.Init.Logic <> False ind +R3631:3633 Naturelle <> phi var +R3669:3671 Coq.Init.Logic <> not def +R3730:3731 Coq.Init.Logic <> ::type_scope:'~'_x not +R3730:3731 Coq.Init.Logic <> ::type_scope:'~'_x not +R3745:3752 Naturelle <> I_non_th thm +R3801:3810 Naturelle <> I_antiT_th thm +R3875:3878 Coq.Logic.Classical_Prop <> NNPP thm diff --git a/TP7/Naturelle.v b/TP7/Naturelle.v new file mode 100755 index 0000000..0546e4d --- /dev/null +++ b/TP7/Naturelle.v @@ -0,0 +1,225 @@ +Require Export Classical. + +Ltac Hyp Nom := exact Nom. + +Ltac I_imp' := + match goal with + | |- ?A -> ?B => let hyp := fresh "H" in intro hyp + | _ => fail + end. + +Ltac I_imp Nom := + match goal with + | |- ?A -> ?B => intro Nom + | _ => fail + end. + +Theorem E_imp_th : forall (phi psi : Prop), (phi -> psi) -> phi -> psi. +intros Pphi Ppsi Hphi2psi. +Hyp Hphi2psi. +Qed. + +Ltac E_imp' := + match goal with + | |- ?P => eapply (E_imp_th _ P) + end. + +Ltac E_imp phi := + match goal with + | |- ?P => apply (E_imp_th phi P) + end. + +Ltac I_forall' := + match goal with + | |- forall (x : ?A), ?P => let hyp := fresh x in intro hyp + | _ => fail + end. + +Ltac I_forall Nom := + match goal with + | |- forall (x : ?A), ?P => intro Nom + | _ => fail + end. + +Theorem E_forall_th : forall (A : Type) (phi : A -> Prop) a, (forall x, phi x) -> phi a. +Proof. +firstorder. +Qed. + +Ltac E_forall x := + pattern x; + match goal with + | |- (?P x) => apply (E_forall_th _ P x) + | _ => fail + end. + +Ltac I_et := + match goal with + | |- (?A /\ ?B) => apply (@conj A B) + | _ => fail + end. + +Theorem E_et_g_th : forall (phi psi : Prop), (phi /\ psi) -> phi. +intros Pphi Ppsi Hphi_et_psi. +elim Hphi_et_psi. +intros Hphi Hpsi. +Hyp Hphi. +Qed. + +Ltac E_et_g' := + match goal with + | |- ?P => eapply (E_et_g_th P _) + end. + +Ltac E_et_g psi := + match goal with + | |- ?P => apply (E_et_g_th P psi) + end. + +Theorem E_et_d_th : forall (phi psi : Prop), (phi /\ psi) -> psi. +intros Pphi Ppsi H_phi_et_psi. +elim H_phi_et_psi. +intros Hphi Hpsi. +Hyp Hpsi. +Qed. + +Ltac E_et_d' := + match goal with + | |- ?P => eapply (E_et_d_th _ P) + end. + +Ltac E_et_d phi := + match goal with + | |- ?P => eapply (E_et_d_th phi P) + end. + +Theorem E_ou_th : forall (phi psi chi : Prop), (phi \/ psi) -> (phi -> chi) -> (psi -> chi) -> chi. +intros Pphi Ppsi Pchi Hphi_ou_psi Hphi_imp_chi Hpsi_imp_chi. +elim Hphi_ou_psi. +Hyp Hphi_imp_chi. +Hyp Hpsi_imp_chi. +Qed. + +Ltac E_ou' := + match goal with + | |- ?P => eapply (E_ou_th _ _ P) + end. + +Ltac E_ou phi psi := + match goal with + | |- ?P => apply (E_ou_th phi psi P) + end. + +Ltac I_ou_g := + match goal with + | |- (?A \/ ?B) => apply (@or_introl A B) + | _ => fail + end. + +Ltac I_ou_d := + match goal with + | |- (?A \/ ?B) => apply (@or_intror A B) + | _ => fail + end. + +Ltac I_exists' := + match goal with + | |- exists (x : ?A), (@?P x) => eapply (@ex_intro A P _) + | _ => fail + end. + +Ltac I_exists t := + match goal with + | |- exists (x : ?A), (@?P x) => apply (@ex_intro _ P t) + | _ => fail + end. + +Theorem E_exists_th : forall (A : Type) (phi : A -> Prop) (chi : Prop), (exists x, phi x) -> (forall a, phi a -> chi) -> chi. +Proof. +firstorder. +Qed. +(* +Ltac E_exists phi := + match goal with + | |- ?P => apply (E_exists_th _ phi P) + end. +*) +Ltac E_exists phi := + match goal with + | |- ?P => apply (E_exists_th _ phi P); [ idtac | let t := fresh "t" in let ht := fresh "Ht" in intros t ht ] + end. + +Ltac TE := + unfold not; + match goal with + | |- (?P \/ (?P -> False)) => exact (classic P) + | _ => fail + end. + +Theorem E_antiT_th : forall (phi : Prop), False -> phi. +intros Pphi F. +elim F. +Qed. + +Ltac E_antiT := + match goal with + | |- ?P => apply (E_antiT_th P) + end. + +Theorem I_antiT_th : forall (phi : Prop), phi -> (~phi) -> False. +unfold not. +intro Pphi. +intros Hphi Hnphi. +cut Pphi. +Hyp Hnphi. +Hyp Hphi. +Qed. + +Ltac I_antiT phi := + match goal with + | |- False => apply (I_antiT_th phi) + end. + +Theorem I_non_th : forall (phi : Prop), (phi -> False) -> ~phi. +intros. +unfold not. +exact H. +Qed. + +Ltac I_non Nom := + match goal with + | |- ~ ?P => apply (I_non_th P); intro Nom + end. + +Ltac E_non phi := + apply (I_antiT_th phi). + +Ltac absurde Nom := + match goal with + | |- ?P => apply (NNPP P); intro Nom + end. + +(* +Ltac I_antiT phi := apply (I_antiT_th phi). + +Ltac absurde Nom phi := +match goal with +| |- phi => +cut (phi \/ ~phi); +[ +intros L; +elim L; +[ +auto +| +clear L; +intro Nom; +apply (E_antiT_th) +] +| +apply (classic phi) +] +| _ => fail +end. +*) + diff --git a/TP7/Unnamed_coqscript_1.crashcoqide b/TP7/Unnamed_coqscript_1.crashcoqide new file mode 100755 index 0000000..e69de29 diff --git a/TP7/coq-exercice-1.v b/TP7/coq-exercice-1.v new file mode 100755 index 0000000..55f33e1 --- /dev/null +++ b/TP7/coq-exercice-1.v @@ -0,0 +1,29 @@ +Require Import Naturelle. +Section Session1_2019_Logique_Exercice_1. + +Variable A B C : Prop. + +Theorem Exercice_1_Naturelle : (A -> B -> C) -> ((A /\ B) -> C). +I_imp H. +I_imp H0. +E_imp B. +E_imp A. +exact H. +E_et_g B. +exact H0. +E_et_d A. +exact H0. +Qed. + +Theorem Exercice_1_Coq : (A -> B -> C) -> ((A /\ B) -> C). +intros. +destruct H0. +cut B. +cut A. +exact H. +exact H0. +exact H1. +Qed. + +End Session1_2019_Logique_Exercice_1. + diff --git a/TP7/coq-exercice-2.v b/TP7/coq-exercice-2.v new file mode 100755 index 0000000..3b10b1b --- /dev/null +++ b/TP7/coq-exercice-2.v @@ -0,0 +1,15 @@ +Require Import Naturelle. +Section Session1_2019_Logique_Exercice_2. + +Variable A B : Prop. + +Theorem Exercice_2_Naturelle : (~A) \/ B -> (~A) \/ (A /\ B). + +Theorem Exercice_2_Coq : (~A) \/ B -> (~A) \/ (A /\ B). +intros. + + +Qed. + +End Session1_2019_Logique_Exercice_2. + diff --git a/TP7/coq-exercice-3.v b/TP7/coq-exercice-3.v new file mode 100755 index 0000000..3c3108e --- /dev/null +++ b/TP7/coq-exercice-3.v @@ -0,0 +1,113 @@ +Section Session1_2019_Induction_Exercice_3. + +(* Déclaration d’un domaine pour les éléments des listes *) +Variable A : Set. + +(* Déclaration d'un type liste générique d'éléments de type E *) +Inductive liste (E : Set) : Set := +Nil +: liste E +| Cons : E -> liste E -> liste E. + +(* Déclaration du nom de la fonction append *) +Variable append_spec : forall E : Set, liste E -> liste E -> liste E. + +(* Spécification du comportement de append pour Nil en premier paramètre *) +Axiom append_Nil : forall E : Set, forall (l : liste E), append_spec E (Nil E) l = l. + +(* Spécification du comportement de append pour Cons en premier paramètre *) +Axiom append_Cons : forall E : Set, forall (t : E), forall (q l : liste E), + append_spec E ((Cons E) t q) l = (Cons E) t (append_spec E q l). + +(* Spécification du comportement de append pour Nil en second paramètre *) +Axiom append_Nil_right : forall E : Set, forall (l : liste E), (append_spec E l (Nil E)) = l. + +(* append est associative à gauche et à droite *) +Axiom append_associative : forall E : Set, forall (l1 l2 l3 : liste E), + (append_spec E l1 (append_spec E l2 l3)) = (append_spec E (append_spec E l1 l2) l3). + +(* Déclaration du nom de la fonction flatten *) +Variable flatten_spec : forall E : Set, liste (liste E) -> liste E. + +(* Spécification du comportement de flatten pour Nil *) +Axiom flatten_Nil : forall E : Set, flatten_spec E (Nil (liste E)) = (Nil E). + +(* Spécification du comportement de flatten pour Cons *) +Axiom flatten_Cons : forall E : Set, forall (t : liste E), forall (q : liste (liste E)), + flatten_spec E (Cons (liste E) t q) = append_spec E t (flatten_spec E q). + +(* Déclaration du nom de la fonction split *) +Variable split_spec : forall E : Set, liste E -> liste (liste E). + +(* Spécification du comportement de split pour Nil *) +Axiom split_Nil : forall E : Set, split_spec E (Nil E) = (Nil (liste E)). + +(* Spécification du comportement de split pour Cons *) +Axiom split_Cons : forall E : Set, forall (t : E), forall (q : liste E), + split_spec E (Cons E t q) = Cons (liste E) (Cons E t (Nil E)) (split_spec E q). + +(* Cohérence de flatten et de split : flatten(split(l)) = l*) +Theorem flatten_split_consistency : forall E : Set, forall (l : liste E), + flatten_spec E (split_spec E l) = l. +intros. +induction l. +(* cas de base *) +rewrite split_Nil. +rewrite flatten_Nil. +reflexivity. +(* cas général *) +rewrite split_Cons. +rewrite flatten_Cons. +rewrite append_Cons. +rewrite append_Nil. +rewrite IHl. +reflexivity. +Qed. + +(* Implantation de la fonction append *) +Fixpoint append_impl (E : Set) (l1 l2 : liste E) {struct l1} : liste E := +match l1 with +Nil _ => l2 +| (Cons _ t1 q1) => (Cons E t1 (append_impl E q1 l2)) +end. + +Theorem append_correctness : forall E : Set, forall (l1 l2 : liste E), +(append_spec E l1 l2) = (append_impl E l1 l2). +intro TE. +induction l1. +intro Hl2. +rewrite append_Nil. +simpl. +reflexivity. +intro Hl2. +rewrite append_Cons. +simpl. +rewrite IHl1. +reflexivity. +Qed. + +(* Implantation de la fonction flatten *) +Fixpoint flatten_impl (E : Set) (l : liste (liste E)) {struct l} : liste E := + match l with + Nil _ => Nil _ + | (Cons _ t q) => (append_impl E t (flatten_impl E q )) +end. + +(* Correction de l'implantation de flatten par rapport à sa spécification *) +Theorem flatten_correctness : forall E : Set, forall (l : liste (liste E)), + (flatten_spec E l) = (flatten_impl E l). +intros. +induction l. +(* cas de base *) +rewrite flatten_Nil. +simpl flatten_impl. +reflexivity. +(* cas général *) +rewrite flatten_Cons. +simpl flatten_impl. +rewrite append_correctness. +rewrite IHl. +reflexivity. +Qed. + +End Session1_2019_Induction_Exercice_3. diff --git a/TP7/why3-exercice-4.mlw b/TP7/why3-exercice-4.mlw new file mode 100755 index 0000000..ea8fff6 --- /dev/null +++ b/TP7/why3-exercice-4.mlw @@ -0,0 +1,24 @@ +(* BE : Session 1 2019 *) +(* Implémentation de la fonction somme des premiers entiers par un algorithme ascendant *) + +module Somme + + use int.Int + use int.ComputerDivision + use ref.Refint + + let somme (n: int) : int + requires { n >= 0 } + ensures { 2 * result = n * (n+1) } + = + let i = ref 0 in + let r = ref 0 in + while (!i < n) do + invariant { !r * 2 = !i * ( !i + 1 ) && n >= !i} + variant { n - !i } + i := (!i) + 1; + r := (!r) + (!i) + done; + !r + +end diff --git a/TP7/why3-exercice-4/why3session.xml b/TP7/why3-exercice-4/why3session.xml new file mode 100755 index 0000000..e2a07be --- /dev/null +++ b/TP7/why3-exercice-4/why3session.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TP8-9/outils-unix/cmd-sed.txt b/TP8-9/outils-unix/cmd-sed.txt new file mode 100755 index 0000000..0a48d78 --- /dev/null +++ b/TP8-9/outils-unix/cmd-sed.txt @@ -0,0 +1,2 @@ +sed -E -e "s/<\/?[a-z]+>//g" < enseignant-element.xml-sed +sed -E -e "s/<\/?[a-z]+>//g" < enseignant-attribut.xml-sed \ No newline at end of file diff --git a/TP8-9/outils-unix/commandes-TP5.sh b/TP8-9/outils-unix/commandes-TP5.sh new file mode 100755 index 0000000..7a5cc32 --- /dev/null +++ b/TP8-9/outils-unix/commandes-TP5.sh @@ -0,0 +1,11 @@ +#!/bin/sh +echo "Affichage des lignes contenant des nombres entiers naturels :" +egrep -e "\ ([0-9]+)$" exemple.txt +echo "Affichage des lignes contenant des nombres entiers relatifs :" +egrep -e "\ ([+-]+[0-9]+)$" exemple.txt +echo "Affichage des lignes contenant des nombres décimaux :" +egrep -e "\ ([+-]?[0-9]+[.][0-9]+([eE][-+]?[1-9][0-9]*)?)$" exemple.txt +echo "Affichage des lignes contenant des nombres rationnels :" +egrep -e "\ ([+-]?[0-9]+/[1-9][0-9]*)$" exemple.txt +echo "Affichage des lignes contenant des nombres complexes rationnels :" +egrep -e "\ (([+-]?[0-9]+/[1-9][0-9]*)?[+-]?[0-9]+/[1-9][0-9]*i?)$" exemple.txt diff --git a/TP8-9/outils-unix/enseignant-attribut.xml-sed.out b/TP8-9/outils-unix/enseignant-attribut.xml-sed.out new file mode 100755 index 0000000..8970742 --- /dev/null +++ b/TP8-9/outils-unix/enseignant-attribut.xml-sed.out @@ -0,0 +1,5 @@ + + + + + diff --git a/TP8-9/outils-unix/enseignant-attribut.xml-vim b/TP8-9/outils-unix/enseignant-attribut.xml-vim new file mode 100755 index 0000000..8970742 --- /dev/null +++ b/TP8-9/outils-unix/enseignant-attribut.xml-vim @@ -0,0 +1,5 @@ + + + + + diff --git a/TP8-9/outils-unix/enseignant-element.xml-sed.out b/TP8-9/outils-unix/enseignant-element.xml-sed.out new file mode 100755 index 0000000..034c83d --- /dev/null +++ b/TP8-9/outils-unix/enseignant-element.xml-sed.out @@ -0,0 +1,8 @@ + + + Marc + Pantel + + Traduction des langages + Sémantique formelle + diff --git a/TP8-9/outils-unix/enseignant-element.xml-vim b/TP8-9/outils-unix/enseignant-element.xml-vim new file mode 100755 index 0000000..1a04f6d --- /dev/null +++ b/TP8-9/outils-unix/enseignant-element.xml-vim @@ -0,0 +1,8 @@ + + + Marc + Pantel + + Traduction des langages + Sémantique formelle + diff --git a/TP8-9/outils-unix/exemple.txt b/TP8-9/outils-unix/exemple.txt new file mode 100755 index 0000000..21b2513 --- /dev/null +++ b/TP8-9/outils-unix/exemple.txt @@ -0,0 +1,23 @@ +Suite de chiffres : 0123456789 +Entier naturel : 0 +Entier naturel : 123 +Entier relatif : +123 +Entier relatif : -123 +Décimal : 0.123 +Décimal : -0.123 +Décimal : 0.123e10 +Décimal : 0.123E10 +Décimal : -0.123e10 +Décimal : -0.123E10 +Décimal : 0.123e-10 +Décimal : 0.123E-10 +Décimal : -0.123e-10 +Décimal : -0.123e-10 +Rationnel : 1/2 +Rationnel : -1/2 +Complexe : 1/2i +Complexe : -1/2i +Complexe : 2/3+1/2i +Complexe : 2/3+1/2i +Complexe : -2/3-1/2i +Complexe : -2/3-1/2i diff --git a/TP8-9/process-analysis/MainProcessus b/TP8-9/process-analysis/MainProcessus new file mode 100755 index 0000000..392f611 Binary files /dev/null and b/TP8-9/process-analysis/MainProcessus differ diff --git a/TP8-9/process-analysis/Makefile b/TP8-9/process-analysis/Makefile new file mode 100755 index 0000000..f436d80 --- /dev/null +++ b/TP8-9/process-analysis/Makefile @@ -0,0 +1,36 @@ + +OCAMLLEX = ocamllex +OCAMLYACC = menhir +OCAMLC = ocamlc +OCAMLLD = ocamlc + + +.SUFFIXES: .ml .mli .cmo .cmi .mll .mly + +%.cmi : %.mli + $(OCAMLC) -c $< + +%.cmo : %.ml %.cmi + $(OCAMLC) -c $< + +%.cmo : %.ml + $(OCAMLC) -c $< + +%.cmo : %.cmi + $(OCAMLC) -c $< + +%.ml : %.mll + $(OCAMLLEX) $< + +%.mli %.ml : %.mly + $(OCAMLYACC) $< + +all : mainProcessus + +lexerProcessus.ml : parserProcessus.cmi + +mainProcessus : lexerProcessus.cmo parserProcessus.cmo mainProcessus.cmo + $(OCAMLC) -o MainProcessus lexerProcessus.cmo parserProcessus.cmo mainProcessus.cmo + +clean : + -rm -f *.cmo *.cmi lexerProcessus.ml parserProcessus.ml MainProcessus diff --git a/TP8-9/process-analysis/lexerProcessus.ml b/TP8-9/process-analysis/lexerProcessus.ml new file mode 100755 index 0000000..01a031c --- /dev/null +++ b/TP8-9/process-analysis/lexerProcessus.ml @@ -0,0 +1,1279 @@ +# 1 "lexerProcessus.mll" + + +(* Partie recopiée dans le fichier CaML généré. *) +(* Ouverture de modules exploités dans les actions *) +(* Déclarations de types, de constantes, de fonctions, d'exceptions exploités dans les actions *) + + open ParserProcessus + exception LexicalError + + +# 13 "lexerProcessus.ml" +let __ocaml_lex_tables = { + Lexing.lex_base = + "\000\000\238\255\239\255\078\000\153\000\242\255\243\255\163\000\ + \238\000\057\001\132\001\207\001\026\002\016\000\002\000\003\000\ + \149\001\181\001\223\001\224\001\000\002\042\002\254\255\043\002\ + \075\002\108\002\160\002\235\002\061\003\136\003\211\003\030\004\ + \105\004\180\004\255\004\074\005\149\005\224\005\043\006\118\006\ + \193\006\012\007\087\007\162\007\237\007\056\008\131\008\206\008\ + \025\009\100\009\175\009\250\009\069\010\144\010\219\010\038\011\ + \113\011\188\011\007\012\082\012\157\012\232\012\051\013\126\013\ + \201\013\020\014\095\014\170\014\245\014\064\015\139\015\214\015\ + \033\016"; + Lexing.lex_backtrk = + "\255\255\255\255\255\255\015\000\014\000\255\255\255\255\015\000\ + \015\000\015\000\015\000\015\000\015\000\017\000\000\000\001\000\ + \255\255\255\255\001\000\255\255\255\255\001\000\255\255\255\255\ + \255\255\001\000\015\000\015\000\015\000\015\000\015\000\002\000\ + \015\000\015\000\015\000\015\000\015\000\015\000\015\000\003\000\ + \015\000\015\000\015\000\010\000\015\000\015\000\015\000\015\000\ + \015\000\004\000\007\000\015\000\015\000\015\000\015\000\015\000\ + \015\000\008\000\005\000\006\000\015\000\015\000\015\000\015\000\ + \015\000\015\000\015\000\009\000\015\000\015\000\015\000\015\000\ + \011\000"; + Lexing.lex_default = + "\001\000\000\000\000\000\255\255\255\255\000\000\000\000\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\015\000\ + \019\000\023\000\019\000\019\000\023\000\019\000\000\000\023\000\ + \023\000\023\000\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255"; + Lexing.lex_trans = + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\014\000\014\000\014\000\014\000\255\255\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \014\000\000\000\014\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\013\000\ + \004\000\004\000\004\000\004\000\004\000\004\000\004\000\004\000\ + \004\000\004\000\016\000\000\000\000\000\000\000\000\000\015\000\ + \000\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\000\000\000\000\000\000\000\000\003\000\ + \000\000\011\000\003\000\003\000\003\000\003\000\009\000\003\000\ + \003\000\008\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \012\000\003\000\007\000\010\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\006\000\000\000\005\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\000\000\000\000\000\000\000\000\003\000\000\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\004\000\004\000\004\000\004\000\004\000\004\000\004\000\ + \004\000\004\000\004\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\000\000\000\000\ + \002\000\000\000\003\000\255\255\003\000\003\000\003\000\003\000\ + \060\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\000\000\000\000\000\000\000\000\003\000\000\000\003\000\ + \003\000\003\000\003\000\003\000\059\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\000\000\000\000\000\000\000\000\ + \003\000\000\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\051\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\000\000\017\000\ + \000\000\000\000\000\000\000\000\018\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\017\000\ + \000\000\000\000\000\000\003\000\022\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \044\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\017\000\020\000\000\000\000\000\000\000\018\000\021\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\020\000\000\000\000\000\000\000\003\000\022\000\ + \003\000\003\000\033\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\032\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\020\000\024\000\000\000\000\000\ + \000\000\021\000\025\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\024\000\000\000\000\000\ + \000\000\003\000\022\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\026\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\255\255\024\000\000\000\ + \000\000\000\000\000\000\025\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\255\255\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\000\000\000\000\000\000\000\000\000\000\255\255\ + \255\255\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\000\000\000\000\000\000\000\000\003\000\ + \255\255\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\027\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\000\000\000\000\000\000\ + \000\000\000\000\255\255\255\255\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\000\000\000\000\ + \000\000\000\000\003\000\255\255\003\000\003\000\028\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\255\255\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \000\000\000\000\000\000\000\000\003\000\000\000\003\000\003\000\ + \003\000\003\000\029\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\000\000\000\000\000\000\000\000\003\000\ + \000\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\030\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\000\000\000\000\ + \000\000\000\000\003\000\000\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\031\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\000\000\000\000\000\000\000\000\003\000\000\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\000\000\000\000\000\000\000\000\ + \003\000\000\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \040\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\000\000\ + \000\000\000\000\000\000\003\000\000\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \034\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\000\000\000\000\000\000\000\000\003\000\000\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \035\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\000\000\000\000\000\000\ + \000\000\003\000\000\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \036\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \000\000\000\000\000\000\000\000\003\000\000\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\037\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\000\000\000\000\000\000\000\000\003\000\ + \000\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\038\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\000\000\000\000\ + \000\000\000\000\003\000\000\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\039\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\000\000\000\000\000\000\000\000\003\000\000\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\000\000\000\000\000\000\000\000\ + \003\000\000\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\041\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\000\000\ + \000\000\000\000\000\000\003\000\000\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\042\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\000\000\000\000\000\000\000\000\003\000\000\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\043\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\000\000\000\000\000\000\ + \000\000\003\000\000\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \000\000\000\000\000\000\000\000\003\000\000\000\045\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\000\000\000\000\000\000\000\000\003\000\ + \000\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\046\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\000\000\000\000\ + \000\000\000\000\003\000\000\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\047\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\000\000\000\000\000\000\000\000\003\000\000\000\003\000\ + \003\000\003\000\003\000\048\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\049\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\000\000\000\000\000\000\000\000\ + \003\000\000\000\003\000\003\000\003\000\050\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\000\000\ + \000\000\000\000\000\000\003\000\000\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\000\000\000\000\000\000\000\000\003\000\000\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\000\000\000\000\000\000\ + \000\000\003\000\000\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \052\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \000\000\000\000\000\000\000\000\003\000\000\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\053\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\000\000\000\000\000\000\000\000\003\000\ + \000\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\054\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\000\000\000\000\ + \000\000\000\000\003\000\000\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\055\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\000\000\000\000\000\000\000\000\003\000\000\000\003\000\ + \003\000\003\000\003\000\056\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\000\000\000\000\000\000\000\000\ + \003\000\000\000\003\000\003\000\003\000\057\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\058\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\000\000\ + \000\000\000\000\000\000\003\000\000\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\000\000\000\000\000\000\000\000\003\000\000\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\000\000\000\000\000\000\ + \000\000\003\000\000\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \000\000\000\000\000\000\000\000\003\000\000\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\061\000\003\000\ + \062\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\000\000\000\000\000\000\000\000\003\000\ + \000\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\068\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\000\000\000\000\ + \000\000\000\000\003\000\000\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\063\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\000\000\000\000\000\000\000\000\003\000\000\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\064\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\000\000\000\000\000\000\000\000\ + \003\000\000\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\065\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\000\000\ + \000\000\000\000\000\000\003\000\000\000\003\000\003\000\066\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\000\000\000\000\000\000\000\000\003\000\000\000\ + \003\000\003\000\003\000\003\000\067\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\000\000\000\000\000\000\ + \000\000\003\000\000\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \000\000\000\000\000\000\000\000\003\000\000\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\069\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\000\000\000\000\000\000\000\000\003\000\ + \000\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\070\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\000\000\000\000\ + \000\000\000\000\003\000\000\000\003\000\003\000\003\000\003\000\ + \071\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\000\000\000\000\000\000\000\000\003\000\000\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\072\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\000\000\000\000\000\000\000\000\ + \003\000\000\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000"; + Lexing.lex_check = + "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\000\000\000\000\014\000\014\000\015\000\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \000\000\255\255\014\000\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\013\000\255\255\255\255\255\255\255\255\013\000\ + \255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\255\255\255\255\255\255\255\255\000\000\ + \255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\255\255\000\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\255\255\255\255\255\255\255\255\003\000\255\255\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ + \003\000\004\000\004\000\004\000\004\000\004\000\004\000\004\000\ + \004\000\004\000\004\000\007\000\007\000\007\000\007\000\007\000\ + \007\000\007\000\007\000\007\000\007\000\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\007\000\007\000\007\000\007\000\ + \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\ + \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\ + \007\000\007\000\007\000\007\000\007\000\007\000\255\255\255\255\ + \000\000\255\255\007\000\015\000\007\000\007\000\007\000\007\000\ + \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\ + \007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\ + \007\000\007\000\007\000\007\000\007\000\007\000\008\000\008\000\ + \008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\008\000\ + \008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\ + \008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\ + \008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\ + \008\000\255\255\255\255\255\255\255\255\008\000\255\255\008\000\ + \008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\ + \008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\ + \008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\ + \008\000\009\000\009\000\009\000\009\000\009\000\009\000\009\000\ + \009\000\009\000\009\000\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\009\000\009\000\009\000\009\000\009\000\009\000\ + \009\000\009\000\009\000\009\000\009\000\009\000\009\000\009\000\ + \009\000\009\000\009\000\009\000\009\000\009\000\009\000\009\000\ + \009\000\009\000\009\000\009\000\255\255\255\255\255\255\255\255\ + \009\000\255\255\009\000\009\000\009\000\009\000\009\000\009\000\ + \009\000\009\000\009\000\009\000\009\000\009\000\009\000\009\000\ + \009\000\009\000\009\000\009\000\009\000\009\000\009\000\009\000\ + \009\000\009\000\009\000\009\000\010\000\010\000\010\000\010\000\ + \010\000\010\000\010\000\010\000\010\000\010\000\255\255\016\000\ + \255\255\255\255\255\255\255\255\016\000\010\000\010\000\010\000\ + \010\000\010\000\010\000\010\000\010\000\010\000\010\000\010\000\ + \010\000\010\000\010\000\010\000\010\000\010\000\010\000\010\000\ + \010\000\010\000\010\000\010\000\010\000\010\000\010\000\017\000\ + \255\255\255\255\255\255\010\000\017\000\010\000\010\000\010\000\ + \010\000\010\000\010\000\010\000\010\000\010\000\010\000\010\000\ + \010\000\010\000\010\000\010\000\010\000\010\000\010\000\010\000\ + \010\000\010\000\010\000\010\000\010\000\010\000\010\000\011\000\ + \011\000\011\000\011\000\011\000\011\000\011\000\011\000\011\000\ + \011\000\018\000\019\000\255\255\255\255\255\255\018\000\019\000\ + \011\000\011\000\011\000\011\000\011\000\011\000\011\000\011\000\ + \011\000\011\000\011\000\011\000\011\000\011\000\011\000\011\000\ + \011\000\011\000\011\000\011\000\011\000\011\000\011\000\011\000\ + \011\000\011\000\020\000\255\255\255\255\255\255\011\000\020\000\ + \011\000\011\000\011\000\011\000\011\000\011\000\011\000\011\000\ + \011\000\011\000\011\000\011\000\011\000\011\000\011\000\011\000\ + \011\000\011\000\011\000\011\000\011\000\011\000\011\000\011\000\ + \011\000\011\000\012\000\012\000\012\000\012\000\012\000\012\000\ + \012\000\012\000\012\000\012\000\021\000\023\000\255\255\255\255\ + \255\255\021\000\023\000\012\000\012\000\012\000\012\000\012\000\ + \012\000\012\000\012\000\012\000\012\000\012\000\012\000\012\000\ + \012\000\012\000\012\000\012\000\012\000\012\000\012\000\012\000\ + \012\000\012\000\012\000\012\000\012\000\024\000\255\255\255\255\ + \255\255\012\000\024\000\012\000\012\000\012\000\012\000\012\000\ + \012\000\012\000\012\000\012\000\012\000\012\000\012\000\012\000\ + \012\000\012\000\012\000\012\000\012\000\012\000\012\000\012\000\ + \012\000\012\000\012\000\012\000\012\000\016\000\025\000\255\255\ + \255\255\255\255\255\255\025\000\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\017\000\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\ + \026\000\026\000\255\255\255\255\255\255\255\255\255\255\018\000\ + \019\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\ + \026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\ + \026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\ + \026\000\026\000\026\000\255\255\255\255\255\255\255\255\026\000\ + \020\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\ + \026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\ + \026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\ + \026\000\026\000\026\000\027\000\027\000\027\000\027\000\027\000\ + \027\000\027\000\027\000\027\000\027\000\255\255\255\255\255\255\ + \255\255\255\255\021\000\023\000\027\000\027\000\027\000\027\000\ + \027\000\027\000\027\000\027\000\027\000\027\000\027\000\027\000\ + \027\000\027\000\027\000\027\000\027\000\027\000\027\000\027\000\ + \027\000\027\000\027\000\027\000\027\000\027\000\255\255\255\255\ + \255\255\255\255\027\000\024\000\027\000\027\000\027\000\027\000\ + \027\000\027\000\027\000\027\000\027\000\027\000\027\000\027\000\ + \027\000\027\000\027\000\027\000\027\000\027\000\027\000\027\000\ + \027\000\027\000\027\000\027\000\027\000\027\000\255\255\255\255\ + \255\255\255\255\255\255\255\255\025\000\028\000\028\000\028\000\ + \028\000\028\000\028\000\028\000\028\000\028\000\028\000\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\028\000\028\000\ + \028\000\028\000\028\000\028\000\028\000\028\000\028\000\028\000\ + \028\000\028\000\028\000\028\000\028\000\028\000\028\000\028\000\ + \028\000\028\000\028\000\028\000\028\000\028\000\028\000\028\000\ + \255\255\255\255\255\255\255\255\028\000\255\255\028\000\028\000\ + \028\000\028\000\028\000\028\000\028\000\028\000\028\000\028\000\ + \028\000\028\000\028\000\028\000\028\000\028\000\028\000\028\000\ + \028\000\028\000\028\000\028\000\028\000\028\000\028\000\028\000\ + \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\ + \029\000\029\000\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\029\000\029\000\029\000\029\000\029\000\029\000\029\000\ + \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\ + \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\ + \029\000\029\000\029\000\255\255\255\255\255\255\255\255\029\000\ + \255\255\029\000\029\000\029\000\029\000\029\000\029\000\029\000\ + \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\ + \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\ + \029\000\029\000\029\000\030\000\030\000\030\000\030\000\030\000\ + \030\000\030\000\030\000\030\000\030\000\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\030\000\030\000\030\000\030\000\ + \030\000\030\000\030\000\030\000\030\000\030\000\030\000\030\000\ + \030\000\030\000\030\000\030\000\030\000\030\000\030\000\030\000\ + \030\000\030\000\030\000\030\000\030\000\030\000\255\255\255\255\ + \255\255\255\255\030\000\255\255\030\000\030\000\030\000\030\000\ + \030\000\030\000\030\000\030\000\030\000\030\000\030\000\030\000\ + \030\000\030\000\030\000\030\000\030\000\030\000\030\000\030\000\ + \030\000\030\000\030\000\030\000\030\000\030\000\031\000\031\000\ + \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\031\000\ + \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\ + \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\ + \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\ + \031\000\255\255\255\255\255\255\255\255\031\000\255\255\031\000\ + \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\ + \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\ + \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\ + \031\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\ + \032\000\032\000\032\000\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\032\000\032\000\032\000\032\000\032\000\032\000\ + \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\ + \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\ + \032\000\032\000\032\000\032\000\255\255\255\255\255\255\255\255\ + \032\000\255\255\032\000\032\000\032\000\032\000\032\000\032\000\ + \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\ + \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\ + \032\000\032\000\032\000\032\000\033\000\033\000\033\000\033\000\ + \033\000\033\000\033\000\033\000\033\000\033\000\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\033\000\033\000\033\000\ + \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\ + \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\ + \033\000\033\000\033\000\033\000\033\000\033\000\033\000\255\255\ + \255\255\255\255\255\255\033\000\255\255\033\000\033\000\033\000\ + \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\ + \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\ + \033\000\033\000\033\000\033\000\033\000\033\000\033\000\034\000\ + \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\ + \034\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\ + \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\ + \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\ + \034\000\034\000\255\255\255\255\255\255\255\255\034\000\255\255\ + \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\ + \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\ + \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\ + \034\000\034\000\035\000\035\000\035\000\035\000\035\000\035\000\ + \035\000\035\000\035\000\035\000\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\035\000\035\000\035\000\035\000\035\000\ + \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\ + \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\ + \035\000\035\000\035\000\035\000\035\000\255\255\255\255\255\255\ + \255\255\035\000\255\255\035\000\035\000\035\000\035\000\035\000\ + \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\ + \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\ + \035\000\035\000\035\000\035\000\035\000\036\000\036\000\036\000\ + \036\000\036\000\036\000\036\000\036\000\036\000\036\000\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\036\000\036\000\ + \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\ + \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\ + \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\ + \255\255\255\255\255\255\255\255\036\000\255\255\036\000\036\000\ + \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\ + \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\ + \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\ + \037\000\037\000\037\000\037\000\037\000\037\000\037\000\037\000\ + \037\000\037\000\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\037\000\037\000\037\000\037\000\037\000\037\000\037\000\ + \037\000\037\000\037\000\037\000\037\000\037\000\037\000\037\000\ + \037\000\037\000\037\000\037\000\037\000\037\000\037\000\037\000\ + \037\000\037\000\037\000\255\255\255\255\255\255\255\255\037\000\ + \255\255\037\000\037\000\037\000\037\000\037\000\037\000\037\000\ + \037\000\037\000\037\000\037\000\037\000\037\000\037\000\037\000\ + \037\000\037\000\037\000\037\000\037\000\037\000\037\000\037\000\ + \037\000\037\000\037\000\038\000\038\000\038\000\038\000\038\000\ + \038\000\038\000\038\000\038\000\038\000\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\038\000\038\000\038\000\038\000\ + \038\000\038\000\038\000\038\000\038\000\038\000\038\000\038\000\ + \038\000\038\000\038\000\038\000\038\000\038\000\038\000\038\000\ + \038\000\038\000\038\000\038\000\038\000\038\000\255\255\255\255\ + \255\255\255\255\038\000\255\255\038\000\038\000\038\000\038\000\ + \038\000\038\000\038\000\038\000\038\000\038\000\038\000\038\000\ + \038\000\038\000\038\000\038\000\038\000\038\000\038\000\038\000\ + \038\000\038\000\038\000\038\000\038\000\038\000\039\000\039\000\ + \039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\039\000\ + \039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\ + \039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\ + \039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\ + \039\000\255\255\255\255\255\255\255\255\039\000\255\255\039\000\ + \039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\ + \039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\ + \039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\ + \039\000\040\000\040\000\040\000\040\000\040\000\040\000\040\000\ + \040\000\040\000\040\000\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\040\000\040\000\040\000\040\000\040\000\040\000\ + \040\000\040\000\040\000\040\000\040\000\040\000\040\000\040\000\ + \040\000\040\000\040\000\040\000\040\000\040\000\040\000\040\000\ + \040\000\040\000\040\000\040\000\255\255\255\255\255\255\255\255\ + \040\000\255\255\040\000\040\000\040\000\040\000\040\000\040\000\ + \040\000\040\000\040\000\040\000\040\000\040\000\040\000\040\000\ + \040\000\040\000\040\000\040\000\040\000\040\000\040\000\040\000\ + \040\000\040\000\040\000\040\000\041\000\041\000\041\000\041\000\ + \041\000\041\000\041\000\041\000\041\000\041\000\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\041\000\041\000\041\000\ + \041\000\041\000\041\000\041\000\041\000\041\000\041\000\041\000\ + \041\000\041\000\041\000\041\000\041\000\041\000\041\000\041\000\ + \041\000\041\000\041\000\041\000\041\000\041\000\041\000\255\255\ + \255\255\255\255\255\255\041\000\255\255\041\000\041\000\041\000\ + \041\000\041\000\041\000\041\000\041\000\041\000\041\000\041\000\ + \041\000\041\000\041\000\041\000\041\000\041\000\041\000\041\000\ + \041\000\041\000\041\000\041\000\041\000\041\000\041\000\042\000\ + \042\000\042\000\042\000\042\000\042\000\042\000\042\000\042\000\ + \042\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \042\000\042\000\042\000\042\000\042\000\042\000\042\000\042\000\ + \042\000\042\000\042\000\042\000\042\000\042\000\042\000\042\000\ + \042\000\042\000\042\000\042\000\042\000\042\000\042\000\042\000\ + \042\000\042\000\255\255\255\255\255\255\255\255\042\000\255\255\ + \042\000\042\000\042\000\042\000\042\000\042\000\042\000\042\000\ + \042\000\042\000\042\000\042\000\042\000\042\000\042\000\042\000\ + \042\000\042\000\042\000\042\000\042\000\042\000\042\000\042\000\ + \042\000\042\000\043\000\043\000\043\000\043\000\043\000\043\000\ + \043\000\043\000\043\000\043\000\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\043\000\043\000\043\000\043\000\043\000\ + \043\000\043\000\043\000\043\000\043\000\043\000\043\000\043\000\ + \043\000\043\000\043\000\043\000\043\000\043\000\043\000\043\000\ + \043\000\043\000\043\000\043\000\043\000\255\255\255\255\255\255\ + \255\255\043\000\255\255\043\000\043\000\043\000\043\000\043\000\ + \043\000\043\000\043\000\043\000\043\000\043\000\043\000\043\000\ + \043\000\043\000\043\000\043\000\043\000\043\000\043\000\043\000\ + \043\000\043\000\043\000\043\000\043\000\044\000\044\000\044\000\ + \044\000\044\000\044\000\044\000\044\000\044\000\044\000\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\044\000\044\000\ + \044\000\044\000\044\000\044\000\044\000\044\000\044\000\044\000\ + \044\000\044\000\044\000\044\000\044\000\044\000\044\000\044\000\ + \044\000\044\000\044\000\044\000\044\000\044\000\044\000\044\000\ + \255\255\255\255\255\255\255\255\044\000\255\255\044\000\044\000\ + \044\000\044\000\044\000\044\000\044\000\044\000\044\000\044\000\ + \044\000\044\000\044\000\044\000\044\000\044\000\044\000\044\000\ + \044\000\044\000\044\000\044\000\044\000\044\000\044\000\044\000\ + \045\000\045\000\045\000\045\000\045\000\045\000\045\000\045\000\ + \045\000\045\000\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\045\000\045\000\045\000\045\000\045\000\045\000\045\000\ + \045\000\045\000\045\000\045\000\045\000\045\000\045\000\045\000\ + \045\000\045\000\045\000\045\000\045\000\045\000\045\000\045\000\ + \045\000\045\000\045\000\255\255\255\255\255\255\255\255\045\000\ + \255\255\045\000\045\000\045\000\045\000\045\000\045\000\045\000\ + \045\000\045\000\045\000\045\000\045\000\045\000\045\000\045\000\ + \045\000\045\000\045\000\045\000\045\000\045\000\045\000\045\000\ + \045\000\045\000\045\000\046\000\046\000\046\000\046\000\046\000\ + \046\000\046\000\046\000\046\000\046\000\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\046\000\046\000\046\000\046\000\ + \046\000\046\000\046\000\046\000\046\000\046\000\046\000\046\000\ + \046\000\046\000\046\000\046\000\046\000\046\000\046\000\046\000\ + \046\000\046\000\046\000\046\000\046\000\046\000\255\255\255\255\ + \255\255\255\255\046\000\255\255\046\000\046\000\046\000\046\000\ + \046\000\046\000\046\000\046\000\046\000\046\000\046\000\046\000\ + \046\000\046\000\046\000\046\000\046\000\046\000\046\000\046\000\ + \046\000\046\000\046\000\046\000\046\000\046\000\047\000\047\000\ + \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\047\000\ + \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\ + \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\ + \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\ + \047\000\255\255\255\255\255\255\255\255\047\000\255\255\047\000\ + \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\ + \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\ + \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\ + \047\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\ + \048\000\048\000\048\000\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\048\000\048\000\048\000\048\000\048\000\048\000\ + \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\ + \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\ + \048\000\048\000\048\000\048\000\255\255\255\255\255\255\255\255\ + \048\000\255\255\048\000\048\000\048\000\048\000\048\000\048\000\ + \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\ + \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\ + \048\000\048\000\048\000\048\000\049\000\049\000\049\000\049\000\ + \049\000\049\000\049\000\049\000\049\000\049\000\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\049\000\049\000\049\000\ + \049\000\049\000\049\000\049\000\049\000\049\000\049\000\049\000\ + \049\000\049\000\049\000\049\000\049\000\049\000\049\000\049\000\ + \049\000\049\000\049\000\049\000\049\000\049\000\049\000\255\255\ + \255\255\255\255\255\255\049\000\255\255\049\000\049\000\049\000\ + \049\000\049\000\049\000\049\000\049\000\049\000\049\000\049\000\ + \049\000\049\000\049\000\049\000\049\000\049\000\049\000\049\000\ + \049\000\049\000\049\000\049\000\049\000\049\000\049\000\050\000\ + \050\000\050\000\050\000\050\000\050\000\050\000\050\000\050\000\ + \050\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \050\000\050\000\050\000\050\000\050\000\050\000\050\000\050\000\ + \050\000\050\000\050\000\050\000\050\000\050\000\050\000\050\000\ + \050\000\050\000\050\000\050\000\050\000\050\000\050\000\050\000\ + \050\000\050\000\255\255\255\255\255\255\255\255\050\000\255\255\ + \050\000\050\000\050\000\050\000\050\000\050\000\050\000\050\000\ + \050\000\050\000\050\000\050\000\050\000\050\000\050\000\050\000\ + \050\000\050\000\050\000\050\000\050\000\050\000\050\000\050\000\ + \050\000\050\000\051\000\051\000\051\000\051\000\051\000\051\000\ + \051\000\051\000\051\000\051\000\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\051\000\051\000\051\000\051\000\051\000\ + \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\ + \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\ + \051\000\051\000\051\000\051\000\051\000\255\255\255\255\255\255\ + \255\255\051\000\255\255\051\000\051\000\051\000\051\000\051\000\ + \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\ + \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\ + \051\000\051\000\051\000\051\000\051\000\052\000\052\000\052\000\ + \052\000\052\000\052\000\052\000\052\000\052\000\052\000\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\052\000\052\000\ + \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\ + \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\ + \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\ + \255\255\255\255\255\255\255\255\052\000\255\255\052\000\052\000\ + \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\ + \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\ + \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\ + \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\ + \053\000\053\000\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\053\000\053\000\053\000\053\000\053\000\053\000\053\000\ + \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\ + \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\ + \053\000\053\000\053\000\255\255\255\255\255\255\255\255\053\000\ + \255\255\053\000\053\000\053\000\053\000\053\000\053\000\053\000\ + \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\ + \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\ + \053\000\053\000\053\000\054\000\054\000\054\000\054\000\054\000\ + \054\000\054\000\054\000\054\000\054\000\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\054\000\054\000\054\000\054\000\ + \054\000\054\000\054\000\054\000\054\000\054\000\054\000\054\000\ + \054\000\054\000\054\000\054\000\054\000\054\000\054\000\054\000\ + \054\000\054\000\054\000\054\000\054\000\054\000\255\255\255\255\ + \255\255\255\255\054\000\255\255\054\000\054\000\054\000\054\000\ + \054\000\054\000\054\000\054\000\054\000\054\000\054\000\054\000\ + \054\000\054\000\054\000\054\000\054\000\054\000\054\000\054\000\ + \054\000\054\000\054\000\054\000\054\000\054\000\055\000\055\000\ + \055\000\055\000\055\000\055\000\055\000\055\000\055\000\055\000\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\055\000\ + \055\000\055\000\055\000\055\000\055\000\055\000\055\000\055\000\ + \055\000\055\000\055\000\055\000\055\000\055\000\055\000\055\000\ + \055\000\055\000\055\000\055\000\055\000\055\000\055\000\055\000\ + \055\000\255\255\255\255\255\255\255\255\055\000\255\255\055\000\ + \055\000\055\000\055\000\055\000\055\000\055\000\055\000\055\000\ + \055\000\055\000\055\000\055\000\055\000\055\000\055\000\055\000\ + \055\000\055\000\055\000\055\000\055\000\055\000\055\000\055\000\ + \055\000\056\000\056\000\056\000\056\000\056\000\056\000\056\000\ + \056\000\056\000\056\000\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\056\000\056\000\056\000\056\000\056\000\056\000\ + \056\000\056\000\056\000\056\000\056\000\056\000\056\000\056\000\ + \056\000\056\000\056\000\056\000\056\000\056\000\056\000\056\000\ + \056\000\056\000\056\000\056\000\255\255\255\255\255\255\255\255\ + \056\000\255\255\056\000\056\000\056\000\056\000\056\000\056\000\ + \056\000\056\000\056\000\056\000\056\000\056\000\056\000\056\000\ + \056\000\056\000\056\000\056\000\056\000\056\000\056\000\056\000\ + \056\000\056\000\056\000\056\000\057\000\057\000\057\000\057\000\ + \057\000\057\000\057\000\057\000\057\000\057\000\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\057\000\057\000\057\000\ + \057\000\057\000\057\000\057\000\057\000\057\000\057\000\057\000\ + \057\000\057\000\057\000\057\000\057\000\057\000\057\000\057\000\ + \057\000\057\000\057\000\057\000\057\000\057\000\057\000\255\255\ + \255\255\255\255\255\255\057\000\255\255\057\000\057\000\057\000\ + \057\000\057\000\057\000\057\000\057\000\057\000\057\000\057\000\ + \057\000\057\000\057\000\057\000\057\000\057\000\057\000\057\000\ + \057\000\057\000\057\000\057\000\057\000\057\000\057\000\058\000\ + \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\ + \058\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\ + \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\ + \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\ + \058\000\058\000\255\255\255\255\255\255\255\255\058\000\255\255\ + \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\ + \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\ + \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\ + \058\000\058\000\059\000\059\000\059\000\059\000\059\000\059\000\ + \059\000\059\000\059\000\059\000\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\059\000\059\000\059\000\059\000\059\000\ + \059\000\059\000\059\000\059\000\059\000\059\000\059\000\059\000\ + \059\000\059\000\059\000\059\000\059\000\059\000\059\000\059\000\ + \059\000\059\000\059\000\059\000\059\000\255\255\255\255\255\255\ + \255\255\059\000\255\255\059\000\059\000\059\000\059\000\059\000\ + \059\000\059\000\059\000\059\000\059\000\059\000\059\000\059\000\ + \059\000\059\000\059\000\059\000\059\000\059\000\059\000\059\000\ + \059\000\059\000\059\000\059\000\059\000\060\000\060\000\060\000\ + \060\000\060\000\060\000\060\000\060\000\060\000\060\000\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\060\000\060\000\ + \060\000\060\000\060\000\060\000\060\000\060\000\060\000\060\000\ + \060\000\060\000\060\000\060\000\060\000\060\000\060\000\060\000\ + \060\000\060\000\060\000\060\000\060\000\060\000\060\000\060\000\ + \255\255\255\255\255\255\255\255\060\000\255\255\060\000\060\000\ + \060\000\060\000\060\000\060\000\060\000\060\000\060\000\060\000\ + \060\000\060\000\060\000\060\000\060\000\060\000\060\000\060\000\ + \060\000\060\000\060\000\060\000\060\000\060\000\060\000\060\000\ + \061\000\061\000\061\000\061\000\061\000\061\000\061\000\061\000\ + \061\000\061\000\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\061\000\061\000\061\000\061\000\061\000\061\000\061\000\ + \061\000\061\000\061\000\061\000\061\000\061\000\061\000\061\000\ + \061\000\061\000\061\000\061\000\061\000\061\000\061\000\061\000\ + \061\000\061\000\061\000\255\255\255\255\255\255\255\255\061\000\ + \255\255\061\000\061\000\061\000\061\000\061\000\061\000\061\000\ + \061\000\061\000\061\000\061\000\061\000\061\000\061\000\061\000\ + \061\000\061\000\061\000\061\000\061\000\061\000\061\000\061\000\ + \061\000\061\000\061\000\062\000\062\000\062\000\062\000\062\000\ + \062\000\062\000\062\000\062\000\062\000\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\062\000\062\000\062\000\062\000\ + \062\000\062\000\062\000\062\000\062\000\062\000\062\000\062\000\ + \062\000\062\000\062\000\062\000\062\000\062\000\062\000\062\000\ + \062\000\062\000\062\000\062\000\062\000\062\000\255\255\255\255\ + \255\255\255\255\062\000\255\255\062\000\062\000\062\000\062\000\ + \062\000\062\000\062\000\062\000\062\000\062\000\062\000\062\000\ + \062\000\062\000\062\000\062\000\062\000\062\000\062\000\062\000\ + \062\000\062\000\062\000\062\000\062\000\062\000\063\000\063\000\ + \063\000\063\000\063\000\063\000\063\000\063\000\063\000\063\000\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\063\000\ + \063\000\063\000\063\000\063\000\063\000\063\000\063\000\063\000\ + \063\000\063\000\063\000\063\000\063\000\063\000\063\000\063\000\ + \063\000\063\000\063\000\063\000\063\000\063\000\063\000\063\000\ + \063\000\255\255\255\255\255\255\255\255\063\000\255\255\063\000\ + \063\000\063\000\063\000\063\000\063\000\063\000\063\000\063\000\ + \063\000\063\000\063\000\063\000\063\000\063\000\063\000\063\000\ + \063\000\063\000\063\000\063\000\063\000\063\000\063\000\063\000\ + \063\000\064\000\064\000\064\000\064\000\064\000\064\000\064\000\ + \064\000\064\000\064\000\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\064\000\064\000\064\000\064\000\064\000\064\000\ + \064\000\064\000\064\000\064\000\064\000\064\000\064\000\064\000\ + \064\000\064\000\064\000\064\000\064\000\064\000\064\000\064\000\ + \064\000\064\000\064\000\064\000\255\255\255\255\255\255\255\255\ + \064\000\255\255\064\000\064\000\064\000\064\000\064\000\064\000\ + \064\000\064\000\064\000\064\000\064\000\064\000\064\000\064\000\ + \064\000\064\000\064\000\064\000\064\000\064\000\064\000\064\000\ + \064\000\064\000\064\000\064\000\065\000\065\000\065\000\065\000\ + \065\000\065\000\065\000\065\000\065\000\065\000\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\065\000\065\000\065\000\ + \065\000\065\000\065\000\065\000\065\000\065\000\065\000\065\000\ + \065\000\065\000\065\000\065\000\065\000\065\000\065\000\065\000\ + \065\000\065\000\065\000\065\000\065\000\065\000\065\000\255\255\ + \255\255\255\255\255\255\065\000\255\255\065\000\065\000\065\000\ + \065\000\065\000\065\000\065\000\065\000\065\000\065\000\065\000\ + \065\000\065\000\065\000\065\000\065\000\065\000\065\000\065\000\ + \065\000\065\000\065\000\065\000\065\000\065\000\065\000\066\000\ + \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\ + \066\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\ + \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\ + \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\ + \066\000\066\000\255\255\255\255\255\255\255\255\066\000\255\255\ + \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\ + \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\ + \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\ + \066\000\066\000\067\000\067\000\067\000\067\000\067\000\067\000\ + \067\000\067\000\067\000\067\000\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\067\000\067\000\067\000\067\000\067\000\ + \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\ + \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\ + \067\000\067\000\067\000\067\000\067\000\255\255\255\255\255\255\ + \255\255\067\000\255\255\067\000\067\000\067\000\067\000\067\000\ + \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\ + \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\ + \067\000\067\000\067\000\067\000\067\000\068\000\068\000\068\000\ + \068\000\068\000\068\000\068\000\068\000\068\000\068\000\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\068\000\068\000\ + \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\ + \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\ + \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\ + \255\255\255\255\255\255\255\255\068\000\255\255\068\000\068\000\ + \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\ + \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\ + \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\ + \069\000\069\000\069\000\069\000\069\000\069\000\069\000\069\000\ + \069\000\069\000\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\069\000\069\000\069\000\069\000\069\000\069\000\069\000\ + \069\000\069\000\069\000\069\000\069\000\069\000\069\000\069\000\ + \069\000\069\000\069\000\069\000\069\000\069\000\069\000\069\000\ + \069\000\069\000\069\000\255\255\255\255\255\255\255\255\069\000\ + \255\255\069\000\069\000\069\000\069\000\069\000\069\000\069\000\ + \069\000\069\000\069\000\069\000\069\000\069\000\069\000\069\000\ + \069\000\069\000\069\000\069\000\069\000\069\000\069\000\069\000\ + \069\000\069\000\069\000\070\000\070\000\070\000\070\000\070\000\ + \070\000\070\000\070\000\070\000\070\000\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\070\000\070\000\070\000\070\000\ + \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\ + \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\ + \070\000\070\000\070\000\070\000\070\000\070\000\255\255\255\255\ + \255\255\255\255\070\000\255\255\070\000\070\000\070\000\070\000\ + \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\ + \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\ + \070\000\070\000\070\000\070\000\070\000\070\000\071\000\071\000\ + \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\071\000\ + \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\ + \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\ + \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\ + \071\000\255\255\255\255\255\255\255\255\071\000\255\255\071\000\ + \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\ + \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\ + \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\ + \071\000\072\000\072\000\072\000\072\000\072\000\072\000\072\000\ + \072\000\072\000\072\000\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\072\000\072\000\072\000\072\000\072\000\072\000\ + \072\000\072\000\072\000\072\000\072\000\072\000\072\000\072\000\ + \072\000\072\000\072\000\072\000\072\000\072\000\072\000\072\000\ + \072\000\072\000\072\000\072\000\255\255\255\255\255\255\255\255\ + \072\000\255\255\072\000\072\000\072\000\072\000\072\000\072\000\ + \072\000\072\000\072\000\072\000\072\000\072\000\072\000\072\000\ + \072\000\072\000\072\000\072\000\072\000\072\000\072\000\072\000\ + \072\000\072\000\072\000\072\000\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255"; + Lexing.lex_base_code = + ""; + Lexing.lex_backtrk_code = + ""; + Lexing.lex_default_code = + ""; + Lexing.lex_trans_code = + ""; + Lexing.lex_check_code = + ""; + Lexing.lex_code = + ""; +} + +let rec main lexbuf = + __ocaml_lex_main_rec lexbuf 0 +and __ocaml_lex_main_rec lexbuf __ocaml_lex_state = + match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with + | 0 -> +# 25 "lexerProcessus.mll" + ( main lexbuf ) +# 1169 "lexerProcessus.ml" + + | 1 -> +# 26 "lexerProcessus.mll" + ( (main lexbuf) ) +# 1174 "lexerProcessus.ml" + + | 2 -> +# 27 "lexerProcessus.mll" + ( PROCESS ) +# 1179 "lexerProcessus.ml" + + | 3 -> +# 28 "lexerProcessus.mll" + ( ACTIVITY ) +# 1184 "lexerProcessus.ml" + + | 4 -> +# 29 "lexerProcessus.mll" + ( STARTS ) +# 1189 "lexerProcessus.ml" + + | 5 -> +# 30 "lexerProcessus.mll" + ( FINISHES ) +# 1194 "lexerProcessus.ml" + + | 6 -> +# 31 "lexerProcessus.mll" + ( IF ) +# 1199 "lexerProcessus.ml" + + | 7 -> +# 32 "lexerProcessus.mll" + ( STARTED ) +# 1204 "lexerProcessus.ml" + + | 8 -> +# 33 "lexerProcessus.mll" + ( FINISHED ) +# 1209 "lexerProcessus.ml" + + | 9 -> +# 34 "lexerProcessus.mll" + ( RESOURCE ) +# 1214 "lexerProcessus.ml" + + | 10 -> +# 35 "lexerProcessus.mll" + ( AMOUNT ) +# 1219 "lexerProcessus.ml" + + | 11 -> +# 36 "lexerProcessus.mll" + ( REQUIRES ) +# 1224 "lexerProcessus.ml" + + | 12 -> +# 37 "lexerProcessus.mll" + ( LEFT_BRACE ) +# 1229 "lexerProcessus.ml" + + | 13 -> +# 38 "lexerProcessus.mll" + ( RIGHT_BRACE ) +# 1234 "lexerProcessus.ml" + + | 14 -> +let +# 39 "lexerProcessus.mll" + texte +# 1240 "lexerProcessus.ml" += Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_curr_pos in +# 39 "lexerProcessus.mll" + ( (NUMBER (int_of_string texte)) ) +# 1244 "lexerProcessus.ml" + + | 15 -> +let +# 40 "lexerProcessus.mll" + texte +# 1250 "lexerProcessus.ml" += Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_curr_pos in +# 40 "lexerProcessus.mll" + ( (IDENTIFIER texte) ) +# 1254 "lexerProcessus.ml" + + | 16 -> +# 41 "lexerProcessus.mll" + ( END ) +# 1259 "lexerProcessus.ml" + + | 17 -> +let +# 42 "lexerProcessus.mll" + texte +# 1265 "lexerProcessus.ml" += Lexing.sub_lexeme_char lexbuf lexbuf.Lexing.lex_start_pos in +# 42 "lexerProcessus.mll" + ( (print_string "Erreur lexicale : ");(print_char texte);(print_newline ()); (main lexbuf) ) +# 1269 "lexerProcessus.ml" + + | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; + __ocaml_lex_main_rec lexbuf __ocaml_lex_state + +;; + +# 44 "lexerProcessus.mll" + + + +# 1280 "lexerProcessus.ml" diff --git a/TP8-9/process-analysis/lexerProcessus.mll b/TP8-9/process-analysis/lexerProcessus.mll new file mode 100755 index 0000000..e241443 --- /dev/null +++ b/TP8-9/process-analysis/lexerProcessus.mll @@ -0,0 +1,46 @@ +{ + +(* Partie recopiée dans le fichier CaML généré. *) +(* Ouverture de modules exploités dans les actions *) +(* Déclarations de types, de constantes, de fonctions, d'exceptions exploités dans les actions *) + + open ParserProcessus + exception LexicalError + +} + +(* Déclaration d'expressions régulières exploitées par la suite *) +let chiffre = ['0' - '9'] +let minuscule = ['a' - 'z'] +let majuscule = ['A' - 'Z'] +let lettre = minuscule | majuscule +let lettre_chiffre = lettre | chiffre | '_' +let commentaire = + (* Commentaire bloc à la C/C++/C#/Java/etc *) + ("/*" [^ '*']* '*'* ([^ '*' '/'] [^ '*']* '*'*)* '/') + (* Commentaire fin de ligne à la C/C++/C#/Java/etc *) + | "//" [^'\n']* + +rule main = parse + | ['\n' '\t' ' ']+ { main lexbuf } + | commentaire { (main lexbuf) } + | "process" { PROCESS } + | "activity" { ACTIVITY } + | "starts" { STARTS } + | "finishes" { FINISHES } + | "if" { IF } + | "started" { STARTED } + | "finished" { FINISHED } + | "resource" { RESOURCE } + | "amount" { AMOUNT } + | "requires" { REQUIRES } + | "{" { LEFT_BRACE } + | "}" { RIGHT_BRACE } + | chiffre+ as texte { (NUMBER (int_of_string texte)) } + | ('_' | lettre) lettre_chiffre* as texte { (IDENTIFIER texte) } + | eof { END } + | _ as texte { (print_string "Erreur lexicale : ");(print_char texte);(print_newline ()); (main lexbuf) } + +{ + +} diff --git a/TP8-9/process-analysis/mainProcessus.ml b/TP8-9/process-analysis/mainProcessus.ml new file mode 100755 index 0000000..6d9b005 --- /dev/null +++ b/TP8-9/process-analysis/mainProcessus.ml @@ -0,0 +1,42 @@ +open ParserProcessus + +(* Fonction d'affichage des unités lexicales et des données qu'elles contiennent *) +let printToken t = + (print_endline + ("token: " ^ (match t with + | PROCESS -> "process" + | IDENTIFIER (texte) -> ("identifier(" ^ texte ^ ")") + | ACTIVITY -> "activity" + | STARTS -> "starts" + | FINISHES -> "finishes" + | IF -> "if" + | STARTED -> "started" + | FINISHED -> "finished" + | RESOURCE -> "resource" + | REQUIRES -> "requires" + | AMOUNT -> "amount" + | LEFT_BRACE -> "{" + | RIGHT_BRACE -> "}" + | NUMBER (texte) -> ("number(" ^ (string_of_int texte) ^ ")") + | END -> "EOF" + )));; + +(* Analyse lexicale du fichier passé en paramètre de la ligne de commande *) +if (Array.length Sys.argv > 1) +then + let lexbuf = (Lexing.from_channel (open_in Sys.argv.(1))) in + let token = ref (LexerProcessus.main lexbuf) in + while ((!token) != END) do + (printToken (!token)); + (token := (LexerProcessus.main lexbuf)) + done +else + (print_endline "MainMuProcessus fichier");; + +(* Analyse lexicale, syntaxique et sémantique du fichier passé en paramètre de la ligne de commande *) +if (Array.length Sys.argv > 1) +then + let lexbuf = (Lexing.from_channel (open_in Sys.argv.(1))) in + (ParserProcessus.fichier LexerProcessus.main lexbuf) +else + (print_endline "MainProcessus fichier");; diff --git a/TP8-9/process-analysis/parserProcessus.ml b/TP8-9/process-analysis/parserProcessus.ml new file mode 100755 index 0000000..b7cb145 --- /dev/null +++ b/TP8-9/process-analysis/parserProcessus.ml @@ -0,0 +1,945 @@ + +module MenhirBasics = struct + + exception Error + + type token = + | STARTS + | STARTED + | RIGHT_BRACE + | RESOURCE + | REQUIRES + | PROCESS + | NUMBER of ( +# 15 "parserProcessus.mly" + (int) +# 17 "parserProcessus.ml" + ) + | LEFT_BRACE + | IF + | IDENTIFIER of ( +# 16 "parserProcessus.mly" + (string) +# 24 "parserProcessus.ml" + ) + | FINISHES + | FINISHED + | END + | AMOUNT + | ACTIVITY + +end + +include MenhirBasics + +let _eRR = + MenhirBasics.Error + +type _menhir_env = { + _menhir_lexer: Lexing.lexbuf -> token; + _menhir_lexbuf: Lexing.lexbuf; + _menhir_token: token; + mutable _menhir_error: bool +} + +and _menhir_state = + | MenhirState30 + | MenhirState21 + | MenhirState19 + | MenhirState17 + | MenhirState14 + | MenhirState9 + | MenhirState3 + +# 1 "parserProcessus.mly" + + +(* Partie recopiee dans le fichier CaML genere. *) +(* Ouverture de modules exploites dans les actions *) +(* Declarations de types, de constantes, de fonctions, d'exceptions exploites dans les actions *) + + +# 63 "parserProcessus.ml" + +let rec _menhir_goto_etat : _menhir_env -> 'ttv_tail -> 'tv_etat -> 'ttv_return = + fun _menhir_env _menhir_stack _v -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : (('freshtv155 * _menhir_state * 'tv_action)) * ( +# 16 "parserProcessus.mly" + (string) +# 71 "parserProcessus.ml" + )) = Obj.magic _menhir_stack in + let (_v : 'tv_etat) = _v in + ((let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : (('freshtv153 * _menhir_state * 'tv_action)) * ( +# 16 "parserProcessus.mly" + (string) +# 78 "parserProcessus.ml" + )) = Obj.magic _menhir_stack in + let ((_4 : 'tv_etat) : 'tv_etat) = _v in + ((let ((_menhir_stack, _menhir_s, (_1 : 'tv_action)), (_3 : ( +# 16 "parserProcessus.mly" + (string) +# 84 "parserProcessus.ml" + ))) = _menhir_stack in + let _2 = () in + let _v : 'tv_contrainte = +# 49 "parserProcessus.mly" + ( (print_endline "contrainte : action if IDENTIFIER etat") ) +# 90 "parserProcessus.ml" + in + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv151) = _menhir_stack in + let (_menhir_s : _menhir_state) = _menhir_s in + let (_v : 'tv_contrainte) = _v in + ((let _menhir_stack = (_menhir_stack, _menhir_s, _v) in + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv149 * _menhir_state * 'tv_contrainte) = Obj.magic _menhir_stack in + ((assert (not _menhir_env._menhir_error); + let _tok = _menhir_env._menhir_token in + match _tok with + | FINISHES -> + _menhir_run18 _menhir_env (Obj.magic _menhir_stack) MenhirState21 + | LEFT_BRACE -> + _menhir_run14 _menhir_env (Obj.magic _menhir_stack) MenhirState21 + | REQUIRES -> + _menhir_run11 _menhir_env (Obj.magic _menhir_stack) MenhirState21 + | STARTS -> + _menhir_run10 _menhir_env (Obj.magic _menhir_stack) MenhirState21 + | ACTIVITY | RESOURCE | RIGHT_BRACE -> + _menhir_reduce5 _menhir_env (Obj.magic _menhir_stack) MenhirState21 + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState21) : 'freshtv150)) : 'freshtv152)) : 'freshtv154)) : 'freshtv156) + +and _menhir_fail : unit -> 'a = + fun () -> + Printf.fprintf stderr "Internal failure -- please contact the parser generator's developers.\n%!"; + assert false + +and _menhir_goto_contraintes : _menhir_env -> 'ttv_tail -> _menhir_state -> 'tv_contraintes -> 'ttv_return = + fun _menhir_env _menhir_stack _menhir_s _v -> + match _menhir_s with + | MenhirState19 -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv129 * _menhir_state * 'tv_requires) = Obj.magic _menhir_stack in + let (_menhir_s : _menhir_state) = _menhir_s in + let (_v : 'tv_contraintes) = _v in + ((let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv127 * _menhir_state * 'tv_requires) = Obj.magic _menhir_stack in + let (_ : _menhir_state) = _menhir_s in + let ((_2 : 'tv_contraintes) : 'tv_contraintes) = _v in + ((let (_menhir_stack, _menhir_s, (_1 : 'tv_requires)) = _menhir_stack in + let _v : 'tv_contraintes = +# 43 "parserProcessus.mly" + ( (print_endline "contraintes : requires contraintes") ) +# 138 "parserProcessus.ml" + in + _menhir_goto_contraintes _menhir_env _menhir_stack _menhir_s _v) : 'freshtv128)) : 'freshtv130) + | MenhirState21 -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv133 * _menhir_state * 'tv_contrainte) = Obj.magic _menhir_stack in + let (_menhir_s : _menhir_state) = _menhir_s in + let (_v : 'tv_contraintes) = _v in + ((let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv131 * _menhir_state * 'tv_contrainte) = Obj.magic _menhir_stack in + let (_ : _menhir_state) = _menhir_s in + let ((_2 : 'tv_contraintes) : 'tv_contraintes) = _v in + ((let (_menhir_stack, _menhir_s, (_1 : 'tv_contrainte)) = _menhir_stack in + let _v : 'tv_contraintes = +# 44 "parserProcessus.mly" + ( (print_endline "contraintes : contrainte contraintes") ) +# 154 "parserProcessus.ml" + in + _menhir_goto_contraintes _menhir_env _menhir_stack _menhir_s _v) : 'freshtv132)) : 'freshtv134) + | MenhirState17 -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : (('freshtv137 * _menhir_state) * _menhir_state * 'tv_elements)) = Obj.magic _menhir_stack in + let (_menhir_s : _menhir_state) = _menhir_s in + let (_v : 'tv_contraintes) = _v in + ((let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : (('freshtv135 * _menhir_state) * _menhir_state * 'tv_elements)) = Obj.magic _menhir_stack in + let (_ : _menhir_state) = _menhir_s in + let ((_4 : 'tv_contraintes) : 'tv_contraintes) = _v in + ((let ((_menhir_stack, _menhir_s), _, (_2 : 'tv_elements)) = _menhir_stack in + let _3 = () in + let _1 = () in + let _v : 'tv_contraintes = +# 45 "parserProcessus.mly" + ( (print_endline "contraintes : { elements } contraintes") ) +# 172 "parserProcessus.ml" + in + _menhir_goto_contraintes _menhir_env _menhir_stack _menhir_s _v) : 'freshtv136)) : 'freshtv138) + | MenhirState9 -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : ('freshtv147 * _menhir_state) * ( +# 16 "parserProcessus.mly" + (string) +# 180 "parserProcessus.ml" + )) = Obj.magic _menhir_stack in + let (_menhir_s : _menhir_state) = _menhir_s in + let (_v : 'tv_contraintes) = _v in + ((let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : ('freshtv145 * _menhir_state) * ( +# 16 "parserProcessus.mly" + (string) +# 188 "parserProcessus.ml" + )) = Obj.magic _menhir_stack in + let (_ : _menhir_state) = _menhir_s in + let ((_3 : 'tv_contraintes) : 'tv_contraintes) = _v in + ((let ((_menhir_stack, _menhir_s), (_2 : ( +# 16 "parserProcessus.mly" + (string) +# 195 "parserProcessus.ml" + ))) = _menhir_stack in + let _1 = () in + let _v : 'tv_activite = +# 40 "parserProcessus.mly" + ( (print_endline "activite : activity IDENTIFIER contraintes") ) +# 201 "parserProcessus.ml" + in + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv143) = _menhir_stack in + let (_menhir_s : _menhir_state) = _menhir_s in + let (_v : 'tv_activite) = _v in + ((let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv141) = Obj.magic _menhir_stack in + let (_menhir_s : _menhir_state) = _menhir_s in + let (_v : 'tv_activite) = _v in + ((let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv139) = Obj.magic _menhir_stack in + let (_menhir_s : _menhir_state) = _menhir_s in + let ((_1 : 'tv_activite) : 'tv_activite) = _v in + ((let _v : 'tv_element = +# 35 "parserProcessus.mly" + ( (print_endline "element : activite") ) +# 218 "parserProcessus.ml" + in + _menhir_goto_element _menhir_env _menhir_stack _menhir_s _v) : 'freshtv140)) : 'freshtv142)) : 'freshtv144)) : 'freshtv146)) : 'freshtv148) + | _ -> + _menhir_fail () + +and _menhir_goto_action : _menhir_env -> 'ttv_tail -> _menhir_state -> 'tv_action -> 'ttv_return = + fun _menhir_env _menhir_stack _menhir_s _v -> + let _menhir_stack = (_menhir_stack, _menhir_s, _v) in + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv125 * _menhir_state * 'tv_action) = Obj.magic _menhir_stack in + ((assert (not _menhir_env._menhir_error); + let _tok = _menhir_env._menhir_token in + match _tok with + | IF -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv121 * _menhir_state * 'tv_action) = Obj.magic _menhir_stack in + ((let _menhir_env = _menhir_discard _menhir_env in + let _tok = _menhir_env._menhir_token in + match _tok with + | IDENTIFIER _v -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : ('freshtv117 * _menhir_state * 'tv_action)) = Obj.magic _menhir_stack in + let (_v : ( +# 16 "parserProcessus.mly" + (string) +# 244 "parserProcessus.ml" + )) = _v in + ((let _menhir_stack = (_menhir_stack, _v) in + let _menhir_env = _menhir_discard _menhir_env in + let _tok = _menhir_env._menhir_token in + match _tok with + | FINISHED -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv109) = Obj.magic _menhir_stack in + ((let _menhir_env = _menhir_discard _menhir_env in + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv107) = Obj.magic _menhir_stack in + ((let _1 = () in + let _v : 'tv_etat = +# 55 "parserProcessus.mly" + ( (print_endline "etat : FINISHED") ) +# 260 "parserProcessus.ml" + in + _menhir_goto_etat _menhir_env _menhir_stack _v) : 'freshtv108)) : 'freshtv110) + | STARTED -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv113) = Obj.magic _menhir_stack in + ((let _menhir_env = _menhir_discard _menhir_env in + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv111) = Obj.magic _menhir_stack in + ((let _1 = () in + let _v : 'tv_etat = +# 54 "parserProcessus.mly" + ( (print_endline "etat : STARTED") ) +# 273 "parserProcessus.ml" + in + _menhir_goto_etat _menhir_env _menhir_stack _v) : 'freshtv112)) : 'freshtv114) + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : (('freshtv115 * _menhir_state * 'tv_action)) * ( +# 16 "parserProcessus.mly" + (string) +# 283 "parserProcessus.ml" + )) = Obj.magic _menhir_stack in + ((let ((_menhir_stack, _menhir_s, _), _) = _menhir_stack in + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s) : 'freshtv116)) : 'freshtv118) + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : ('freshtv119 * _menhir_state * 'tv_action)) = Obj.magic _menhir_stack in + ((let (_menhir_stack, _menhir_s, _) = _menhir_stack in + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s) : 'freshtv120)) : 'freshtv122) + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv123 * _menhir_state * 'tv_action) = Obj.magic _menhir_stack in + ((let (_menhir_stack, _menhir_s, _) = _menhir_stack in + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s) : 'freshtv124)) : 'freshtv126) + +and _menhir_goto_elements : _menhir_env -> 'ttv_tail -> _menhir_state -> 'tv_elements -> 'ttv_return = + fun _menhir_env _menhir_stack _menhir_s _v -> + let _menhir_stack = (_menhir_stack, _menhir_s, _v) in + match _menhir_s with + | MenhirState14 -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : ('freshtv77 * _menhir_state) * _menhir_state * 'tv_elements) = Obj.magic _menhir_stack in + ((assert (not _menhir_env._menhir_error); + let _tok = _menhir_env._menhir_token in + match _tok with + | RIGHT_BRACE -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : ('freshtv73 * _menhir_state) * _menhir_state * 'tv_elements) = Obj.magic _menhir_stack in + ((let _menhir_env = _menhir_discard _menhir_env in + let _tok = _menhir_env._menhir_token in + match _tok with + | FINISHES -> + _menhir_run18 _menhir_env (Obj.magic _menhir_stack) MenhirState17 + | LEFT_BRACE -> + _menhir_run14 _menhir_env (Obj.magic _menhir_stack) MenhirState17 + | REQUIRES -> + _menhir_run11 _menhir_env (Obj.magic _menhir_stack) MenhirState17 + | STARTS -> + _menhir_run10 _menhir_env (Obj.magic _menhir_stack) MenhirState17 + | ACTIVITY | RESOURCE | RIGHT_BRACE -> + _menhir_reduce5 _menhir_env (Obj.magic _menhir_stack) MenhirState17 + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState17) : 'freshtv74) + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : ('freshtv75 * _menhir_state) * _menhir_state * 'tv_elements) = Obj.magic _menhir_stack in + ((let (_menhir_stack, _menhir_s, _) = _menhir_stack in + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s) : 'freshtv76)) : 'freshtv78) + | MenhirState30 -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : ('freshtv81 * _menhir_state * 'tv_element) * _menhir_state * 'tv_elements) = Obj.magic _menhir_stack in + ((let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : ('freshtv79 * _menhir_state * 'tv_element) * _menhir_state * 'tv_elements) = Obj.magic _menhir_stack in + ((let ((_menhir_stack, _menhir_s, (_1 : 'tv_element)), _, (_2 : 'tv_elements)) = _menhir_stack in + let _v : 'tv_elements = +# 33 "parserProcessus.mly" + ( (print_endline "elements : element elements") ) +# 348 "parserProcessus.ml" + in + _menhir_goto_elements _menhir_env _menhir_stack _menhir_s _v) : 'freshtv80)) : 'freshtv82) + | MenhirState3 -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : ((('freshtv105) * ( +# 16 "parserProcessus.mly" + (string) +# 356 "parserProcessus.ml" + ))) * _menhir_state * 'tv_elements) = Obj.magic _menhir_stack in + ((assert (not _menhir_env._menhir_error); + let _tok = _menhir_env._menhir_token in + match _tok with + | RIGHT_BRACE -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : ((('freshtv101) * ( +# 16 "parserProcessus.mly" + (string) +# 366 "parserProcessus.ml" + ))) * _menhir_state * 'tv_elements) = Obj.magic _menhir_stack in + ((let _menhir_env = _menhir_discard _menhir_env in + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : ((('freshtv99) * ( +# 16 "parserProcessus.mly" + (string) +# 373 "parserProcessus.ml" + ))) * _menhir_state * 'tv_elements) = Obj.magic _menhir_stack in + ((let ((_menhir_stack, (_2 : ( +# 16 "parserProcessus.mly" + (string) +# 378 "parserProcessus.ml" + ))), _, (_4 : 'tv_elements)) = _menhir_stack in + let _5 = () in + let _3 = () in + let _1 = () in + let _v : 'tv_processus = +# 30 "parserProcessus.mly" + ( (print_endline "processus : process IDENTIFIER { elements }") ) +# 386 "parserProcessus.ml" + in + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv97) = _menhir_stack in + let (_v : 'tv_processus) = _v in + ((let _menhir_stack = (_menhir_stack, _v) in + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv95 * 'tv_processus) = Obj.magic _menhir_stack in + ((assert (not _menhir_env._menhir_error); + let _tok = _menhir_env._menhir_token in + match _tok with + | END -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv91 * 'tv_processus) = Obj.magic _menhir_stack in + ((let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv89 * 'tv_processus) = Obj.magic _menhir_stack in + ((let (_menhir_stack, (_1 : 'tv_processus)) = _menhir_stack in + let _2 = () in + let _v : ( +# 21 "parserProcessus.mly" + (unit) +# 407 "parserProcessus.ml" + ) = +# 28 "parserProcessus.mly" + ( (print_endline "fichier : processus END") ) +# 411 "parserProcessus.ml" + in + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv87) = _menhir_stack in + let (_v : ( +# 21 "parserProcessus.mly" + (unit) +# 418 "parserProcessus.ml" + )) = _v in + ((let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv85) = Obj.magic _menhir_stack in + let (_v : ( +# 21 "parserProcessus.mly" + (unit) +# 425 "parserProcessus.ml" + )) = _v in + ((let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv83) = Obj.magic _menhir_stack in + let ((_1 : ( +# 21 "parserProcessus.mly" + (unit) +# 432 "parserProcessus.ml" + )) : ( +# 21 "parserProcessus.mly" + (unit) +# 436 "parserProcessus.ml" + )) = _v in + (Obj.magic _1 : 'freshtv84)) : 'freshtv86)) : 'freshtv88)) : 'freshtv90)) : 'freshtv92) + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv93 * 'tv_processus) = Obj.magic _menhir_stack in + (raise _eRR : 'freshtv94)) : 'freshtv96)) : 'freshtv98)) : 'freshtv100)) : 'freshtv102) + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : ((('freshtv103) * ( +# 16 "parserProcessus.mly" + (string) +# 452 "parserProcessus.ml" + ))) * _menhir_state * 'tv_elements) = Obj.magic _menhir_stack in + ((let (_menhir_stack, _menhir_s, _) = _menhir_stack in + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s) : 'freshtv104)) : 'freshtv106) + | _ -> + _menhir_fail () + +and _menhir_goto_element : _menhir_env -> 'ttv_tail -> _menhir_state -> 'tv_element -> 'ttv_return = + fun _menhir_env _menhir_stack _menhir_s _v -> + let _menhir_stack = (_menhir_stack, _menhir_s, _v) in + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv71 * _menhir_state * 'tv_element) = Obj.magic _menhir_stack in + ((assert (not _menhir_env._menhir_error); + let _tok = _menhir_env._menhir_token in + match _tok with + | ACTIVITY -> + _menhir_run8 _menhir_env (Obj.magic _menhir_stack) MenhirState30 + | RESOURCE -> + _menhir_run4 _menhir_env (Obj.magic _menhir_stack) MenhirState30 + | RIGHT_BRACE -> + _menhir_reduce11 _menhir_env (Obj.magic _menhir_stack) MenhirState30 + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState30) : 'freshtv72) + +and _menhir_reduce5 : _menhir_env -> 'ttv_tail -> _menhir_state -> 'ttv_return = + fun _menhir_env _menhir_stack _menhir_s -> + let _v : 'tv_contraintes = +# 42 "parserProcessus.mly" + ( (print_endline "contraintes : /* Lambda, mot vide */") ) +# 483 "parserProcessus.ml" + in + _menhir_goto_contraintes _menhir_env _menhir_stack _menhir_s _v + +and _menhir_run10 : _menhir_env -> 'ttv_tail -> _menhir_state -> 'ttv_return = + fun _menhir_env _menhir_stack _menhir_s -> + let _menhir_env = _menhir_discard _menhir_env in + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv69) = Obj.magic _menhir_stack in + let (_menhir_s : _menhir_state) = _menhir_s in + ((let _1 = () in + let _v : 'tv_action = +# 51 "parserProcessus.mly" + ( (print_endline "action : STARTS") ) +# 497 "parserProcessus.ml" + in + _menhir_goto_action _menhir_env _menhir_stack _menhir_s _v) : 'freshtv70) + +and _menhir_run11 : _menhir_env -> 'ttv_tail -> _menhir_state -> 'ttv_return = + fun _menhir_env _menhir_stack _menhir_s -> + let _menhir_stack = (_menhir_stack, _menhir_s) in + let _menhir_env = _menhir_discard _menhir_env in + let _tok = _menhir_env._menhir_token in + match _tok with + | NUMBER _v -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv65 * _menhir_state) = Obj.magic _menhir_stack in + let (_v : ( +# 15 "parserProcessus.mly" + (int) +# 513 "parserProcessus.ml" + )) = _v in + ((let _menhir_stack = (_menhir_stack, _v) in + let _menhir_env = _menhir_discard _menhir_env in + let _tok = _menhir_env._menhir_token in + match _tok with + | IDENTIFIER _v -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : ('freshtv61 * _menhir_state) * ( +# 15 "parserProcessus.mly" + (int) +# 524 "parserProcessus.ml" + )) = Obj.magic _menhir_stack in + let (_v : ( +# 16 "parserProcessus.mly" + (string) +# 529 "parserProcessus.ml" + )) = _v in + ((let _menhir_env = _menhir_discard _menhir_env in + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : ('freshtv59 * _menhir_state) * ( +# 15 "parserProcessus.mly" + (int) +# 536 "parserProcessus.ml" + )) = Obj.magic _menhir_stack in + let ((_3 : ( +# 16 "parserProcessus.mly" + (string) +# 541 "parserProcessus.ml" + )) : ( +# 16 "parserProcessus.mly" + (string) +# 545 "parserProcessus.ml" + )) = _v in + ((let ((_menhir_stack, _menhir_s), (_2 : ( +# 15 "parserProcessus.mly" + (int) +# 550 "parserProcessus.ml" + ))) = _menhir_stack in + let _1 = () in + let _v : 'tv_requires = +# 47 "parserProcessus.mly" + ( (print_endline "requires : requires NUMBER IDENTIFIER") ) +# 556 "parserProcessus.ml" + in + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv57) = _menhir_stack in + let (_menhir_s : _menhir_state) = _menhir_s in + let (_v : 'tv_requires) = _v in + ((let _menhir_stack = (_menhir_stack, _menhir_s, _v) in + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv55 * _menhir_state * 'tv_requires) = Obj.magic _menhir_stack in + ((assert (not _menhir_env._menhir_error); + let _tok = _menhir_env._menhir_token in + match _tok with + | FINISHES -> + _menhir_run18 _menhir_env (Obj.magic _menhir_stack) MenhirState19 + | LEFT_BRACE -> + _menhir_run14 _menhir_env (Obj.magic _menhir_stack) MenhirState19 + | REQUIRES -> + _menhir_run11 _menhir_env (Obj.magic _menhir_stack) MenhirState19 + | STARTS -> + _menhir_run10 _menhir_env (Obj.magic _menhir_stack) MenhirState19 + | ACTIVITY | RESOURCE | RIGHT_BRACE -> + _menhir_reduce5 _menhir_env (Obj.magic _menhir_stack) MenhirState19 + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState19) : 'freshtv56)) : 'freshtv58)) : 'freshtv60)) : 'freshtv62) + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : ('freshtv63 * _menhir_state) * ( +# 15 "parserProcessus.mly" + (int) +# 589 "parserProcessus.ml" + )) = Obj.magic _menhir_stack in + ((let ((_menhir_stack, _menhir_s), _) = _menhir_stack in + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s) : 'freshtv64)) : 'freshtv66) + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv67 * _menhir_state) = Obj.magic _menhir_stack in + ((let (_menhir_stack, _menhir_s) = _menhir_stack in + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s) : 'freshtv68) + +and _menhir_run14 : _menhir_env -> 'ttv_tail -> _menhir_state -> 'ttv_return = + fun _menhir_env _menhir_stack _menhir_s -> + let _menhir_stack = (_menhir_stack, _menhir_s) in + let _menhir_env = _menhir_discard _menhir_env in + let _tok = _menhir_env._menhir_token in + match _tok with + | ACTIVITY -> + _menhir_run8 _menhir_env (Obj.magic _menhir_stack) MenhirState14 + | RESOURCE -> + _menhir_run4 _menhir_env (Obj.magic _menhir_stack) MenhirState14 + | RIGHT_BRACE -> + _menhir_reduce11 _menhir_env (Obj.magic _menhir_stack) MenhirState14 + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState14 + +and _menhir_run18 : _menhir_env -> 'ttv_tail -> _menhir_state -> 'ttv_return = + fun _menhir_env _menhir_stack _menhir_s -> + let _menhir_env = _menhir_discard _menhir_env in + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv53) = Obj.magic _menhir_stack in + let (_menhir_s : _menhir_state) = _menhir_s in + ((let _1 = () in + let _v : 'tv_action = +# 52 "parserProcessus.mly" + ( (print_endline "action : FINISHES") ) +# 628 "parserProcessus.ml" + in + _menhir_goto_action _menhir_env _menhir_stack _menhir_s _v) : 'freshtv54) + +and _menhir_errorcase : _menhir_env -> 'ttv_tail -> _menhir_state -> 'ttv_return = + fun _menhir_env _menhir_stack _menhir_s -> + match _menhir_s with + | MenhirState30 -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv39 * _menhir_state * 'tv_element) = Obj.magic _menhir_stack in + ((let (_menhir_stack, _menhir_s, _) = _menhir_stack in + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s) : 'freshtv40) + | MenhirState21 -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv41 * _menhir_state * 'tv_contrainte) = Obj.magic _menhir_stack in + ((let (_menhir_stack, _menhir_s, _) = _menhir_stack in + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s) : 'freshtv42) + | MenhirState19 -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv43 * _menhir_state * 'tv_requires) = Obj.magic _menhir_stack in + ((let (_menhir_stack, _menhir_s, _) = _menhir_stack in + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s) : 'freshtv44) + | MenhirState17 -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : (('freshtv45 * _menhir_state) * _menhir_state * 'tv_elements)) = Obj.magic _menhir_stack in + ((let (_menhir_stack, _menhir_s, _) = _menhir_stack in + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s) : 'freshtv46) + | MenhirState14 -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv47 * _menhir_state) = Obj.magic _menhir_stack in + ((let (_menhir_stack, _menhir_s) = _menhir_stack in + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s) : 'freshtv48) + | MenhirState9 -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : ('freshtv49 * _menhir_state) * ( +# 16 "parserProcessus.mly" + (string) +# 665 "parserProcessus.ml" + )) = Obj.magic _menhir_stack in + ((let ((_menhir_stack, _menhir_s), _) = _menhir_stack in + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s) : 'freshtv50) + | MenhirState3 -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : (('freshtv51) * ( +# 16 "parserProcessus.mly" + (string) +# 674 "parserProcessus.ml" + ))) = Obj.magic _menhir_stack in + (raise _eRR : 'freshtv52) + +and _menhir_reduce11 : _menhir_env -> 'ttv_tail -> _menhir_state -> 'ttv_return = + fun _menhir_env _menhir_stack _menhir_s -> + let _v : 'tv_elements = +# 32 "parserProcessus.mly" + ( (print_endline "elements : /* Lambda, mot vide */") ) +# 683 "parserProcessus.ml" + in + _menhir_goto_elements _menhir_env _menhir_stack _menhir_s _v + +and _menhir_run4 : _menhir_env -> 'ttv_tail -> _menhir_state -> 'ttv_return = + fun _menhir_env _menhir_stack _menhir_s -> + let _menhir_stack = (_menhir_stack, _menhir_s) in + let _menhir_env = _menhir_discard _menhir_env in + let _tok = _menhir_env._menhir_token in + match _tok with + | IDENTIFIER _v -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv35 * _menhir_state) = Obj.magic _menhir_stack in + let (_v : ( +# 16 "parserProcessus.mly" + (string) +# 699 "parserProcessus.ml" + )) = _v in + ((let _menhir_stack = (_menhir_stack, _v) in + let _menhir_env = _menhir_discard _menhir_env in + let _tok = _menhir_env._menhir_token in + match _tok with + | AMOUNT -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : ('freshtv31 * _menhir_state) * ( +# 16 "parserProcessus.mly" + (string) +# 710 "parserProcessus.ml" + )) = Obj.magic _menhir_stack in + ((let _menhir_env = _menhir_discard _menhir_env in + let _tok = _menhir_env._menhir_token in + match _tok with + | NUMBER _v -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : (('freshtv27 * _menhir_state) * ( +# 16 "parserProcessus.mly" + (string) +# 720 "parserProcessus.ml" + ))) = Obj.magic _menhir_stack in + let (_v : ( +# 15 "parserProcessus.mly" + (int) +# 725 "parserProcessus.ml" + )) = _v in + ((let _menhir_env = _menhir_discard _menhir_env in + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : (('freshtv25 * _menhir_state) * ( +# 16 "parserProcessus.mly" + (string) +# 732 "parserProcessus.ml" + ))) = Obj.magic _menhir_stack in + let ((_4 : ( +# 15 "parserProcessus.mly" + (int) +# 737 "parserProcessus.ml" + )) : ( +# 15 "parserProcessus.mly" + (int) +# 741 "parserProcessus.ml" + )) = _v in + ((let ((_menhir_stack, _menhir_s), (_2 : ( +# 16 "parserProcessus.mly" + (string) +# 746 "parserProcessus.ml" + ))) = _menhir_stack in + let _3 = () in + let _1 = () in + let _v : 'tv_resource = +# 38 "parserProcessus.mly" + ( (print_endline "resource : resource IDENTIFIER amount NUMBER") ) +# 753 "parserProcessus.ml" + in + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv23) = _menhir_stack in + let (_menhir_s : _menhir_state) = _menhir_s in + let (_v : 'tv_resource) = _v in + ((let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv21) = Obj.magic _menhir_stack in + let (_menhir_s : _menhir_state) = _menhir_s in + let (_v : 'tv_resource) = _v in + ((let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv19) = Obj.magic _menhir_stack in + let (_menhir_s : _menhir_state) = _menhir_s in + let ((_1 : 'tv_resource) : 'tv_resource) = _v in + ((let _v : 'tv_element = +# 36 "parserProcessus.mly" + ( (print_endline "element : resource") ) +# 770 "parserProcessus.ml" + in + _menhir_goto_element _menhir_env _menhir_stack _menhir_s _v) : 'freshtv20)) : 'freshtv22)) : 'freshtv24)) : 'freshtv26)) : 'freshtv28) + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : (('freshtv29 * _menhir_state) * ( +# 16 "parserProcessus.mly" + (string) +# 780 "parserProcessus.ml" + ))) = Obj.magic _menhir_stack in + ((let ((_menhir_stack, _menhir_s), _) = _menhir_stack in + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s) : 'freshtv30)) : 'freshtv32) + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : ('freshtv33 * _menhir_state) * ( +# 16 "parserProcessus.mly" + (string) +# 791 "parserProcessus.ml" + )) = Obj.magic _menhir_stack in + ((let ((_menhir_stack, _menhir_s), _) = _menhir_stack in + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s) : 'freshtv34)) : 'freshtv36) + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv37 * _menhir_state) = Obj.magic _menhir_stack in + ((let (_menhir_stack, _menhir_s) = _menhir_stack in + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s) : 'freshtv38) + +and _menhir_run8 : _menhir_env -> 'ttv_tail -> _menhir_state -> 'ttv_return = + fun _menhir_env _menhir_stack _menhir_s -> + let _menhir_stack = (_menhir_stack, _menhir_s) in + let _menhir_env = _menhir_discard _menhir_env in + let _tok = _menhir_env._menhir_token in + match _tok with + | IDENTIFIER _v -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv15 * _menhir_state) = Obj.magic _menhir_stack in + let (_v : ( +# 16 "parserProcessus.mly" + (string) +# 815 "parserProcessus.ml" + )) = _v in + ((let _menhir_stack = (_menhir_stack, _v) in + let _menhir_env = _menhir_discard _menhir_env in + let _tok = _menhir_env._menhir_token in + match _tok with + | FINISHES -> + _menhir_run18 _menhir_env (Obj.magic _menhir_stack) MenhirState9 + | LEFT_BRACE -> + _menhir_run14 _menhir_env (Obj.magic _menhir_stack) MenhirState9 + | REQUIRES -> + _menhir_run11 _menhir_env (Obj.magic _menhir_stack) MenhirState9 + | STARTS -> + _menhir_run10 _menhir_env (Obj.magic _menhir_stack) MenhirState9 + | ACTIVITY | RESOURCE | RIGHT_BRACE -> + _menhir_reduce5 _menhir_env (Obj.magic _menhir_stack) MenhirState9 + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState9) : 'freshtv16) + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv17 * _menhir_state) = Obj.magic _menhir_stack in + ((let (_menhir_stack, _menhir_s) = _menhir_stack in + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s) : 'freshtv18) + +and _menhir_discard : _menhir_env -> _menhir_env = + fun _menhir_env -> + let lexer = _menhir_env._menhir_lexer in + let lexbuf = _menhir_env._menhir_lexbuf in + let _tok = lexer lexbuf in + { + _menhir_lexer = lexer; + _menhir_lexbuf = lexbuf; + _menhir_token = _tok; + _menhir_error = false; + } + +and fichier : (Lexing.lexbuf -> token) -> Lexing.lexbuf -> ( +# 21 "parserProcessus.mly" + (unit) +# 858 "parserProcessus.ml" +) = + fun lexer lexbuf -> + let _menhir_env = + let (lexer : Lexing.lexbuf -> token) = lexer in + let (lexbuf : Lexing.lexbuf) = lexbuf in + ((let _tok = Obj.magic () in + { + _menhir_lexer = lexer; + _menhir_lexbuf = lexbuf; + _menhir_token = _tok; + _menhir_error = false; + }) : _menhir_env) + in + Obj.magic (let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv13) = ((), _menhir_env._menhir_lexbuf.Lexing.lex_curr_p) in + ((let _menhir_env = _menhir_discard _menhir_env in + let _tok = _menhir_env._menhir_token in + match _tok with + | PROCESS -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv9) = Obj.magic _menhir_stack in + ((let _menhir_env = _menhir_discard _menhir_env in + let _tok = _menhir_env._menhir_token in + match _tok with + | IDENTIFIER _v -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv5) = Obj.magic _menhir_stack in + let (_v : ( +# 16 "parserProcessus.mly" + (string) +# 889 "parserProcessus.ml" + )) = _v in + ((let _menhir_stack = (_menhir_stack, _v) in + let _menhir_env = _menhir_discard _menhir_env in + let _tok = _menhir_env._menhir_token in + match _tok with + | LEFT_BRACE -> + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : ('freshtv1) * ( +# 16 "parserProcessus.mly" + (string) +# 900 "parserProcessus.ml" + )) = Obj.magic _menhir_stack in + ((let _menhir_env = _menhir_discard _menhir_env in + let _tok = _menhir_env._menhir_token in + match _tok with + | ACTIVITY -> + _menhir_run8 _menhir_env (Obj.magic _menhir_stack) MenhirState3 + | RESOURCE -> + _menhir_run4 _menhir_env (Obj.magic _menhir_stack) MenhirState3 + | RIGHT_BRACE -> + _menhir_reduce11 _menhir_env (Obj.magic _menhir_stack) MenhirState3 + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState3) : 'freshtv2) + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : ('freshtv3) * ( +# 16 "parserProcessus.mly" + (string) +# 922 "parserProcessus.ml" + )) = Obj.magic _menhir_stack in + (raise _eRR : 'freshtv4)) : 'freshtv6) + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv7) = Obj.magic _menhir_stack in + (raise _eRR : 'freshtv8)) : 'freshtv10) + | _ -> + assert (not _menhir_env._menhir_error); + _menhir_env._menhir_error <- true; + let (_menhir_env : _menhir_env) = _menhir_env in + let (_menhir_stack : 'freshtv11) = Obj.magic _menhir_stack in + (raise _eRR : 'freshtv12)) : 'freshtv14)) + +# 57 "parserProcessus.mly" + + +# 941 "parserProcessus.ml" + +# 269 "" + + +# 946 "parserProcessus.ml" diff --git a/TP8-9/process-analysis/parserProcessus.mli b/TP8-9/process-analysis/parserProcessus.mli new file mode 100755 index 0000000..a3f43f8 --- /dev/null +++ b/TP8-9/process-analysis/parserProcessus.mli @@ -0,0 +1,27 @@ + +(* The type of tokens. *) + +type token = + | STARTS + | STARTED + | RIGHT_BRACE + | RESOURCE + | REQUIRES + | PROCESS + | NUMBER of (int) + | LEFT_BRACE + | IF + | IDENTIFIER of (string) + | FINISHES + | FINISHED + | END + | AMOUNT + | ACTIVITY + +(* This exception is raised by the monolithic API functions. *) + +exception Error + +(* The monolithic API. *) + +val fichier: (Lexing.lexbuf -> token) -> Lexing.lexbuf -> (unit) diff --git a/TP8-9/process-analysis/parserProcessus.mly b/TP8-9/process-analysis/parserProcessus.mly new file mode 100755 index 0000000..9d27471 --- /dev/null +++ b/TP8-9/process-analysis/parserProcessus.mly @@ -0,0 +1,57 @@ +%{ + +(* Partie recopiee dans le fichier CaML genere. *) +(* Ouverture de modules exploites dans les actions *) +(* Declarations de types, de constantes, de fonctions, d'exceptions exploites dans les actions *) + +%} + +/* Declaration des unites lexicales et de leur type si une valeur particuliere leur est associee */ + +%token PROCESS ACTIVITY STARTS FINISHES IF STARTED FINISHED +%token RESOURCE AMOUNT REQUIRES +%token LEFT_BRACE RIGHT_BRACE +/* Defini le type des donnees associees a l'unite lexicale */ +%token NUMBER +%token IDENTIFIER +/* Unite lexicale particuliere qui represente la fin du fichier */ +%token END + +/* Type renvoye pour le nom terminal fichier */ +%type fichier + +/* Le non terminal fichier est l'axiome */ +%start fichier + +%% /* Regles de productions */ + +fichier : processus END { (print_endline "fichier : processus END") } + +processus : PROCESS IDENTIFIER LEFT_BRACE elements RIGHT_BRACE { (print_endline "processus : process IDENTIFIER { elements }") } + +elements : /* Lambda, mot vide */ { (print_endline "elements : /* Lambda, mot vide */") } + | element elements { (print_endline "elements : element elements") } + +element : activite { (print_endline "element : activite") } + | resource { (print_endline "element : resource") } + +resource : RESOURCE IDENTIFIER AMOUNT NUMBER { (print_endline "resource : resource IDENTIFIER amount NUMBER") } + +activite : ACTIVITY IDENTIFIER contraintes { (print_endline "activite : activity IDENTIFIER contraintes") } + +contraintes : /* Lambda, mot vide */ { (print_endline "contraintes : /* Lambda, mot vide */") } + | requires contraintes { (print_endline "contraintes : requires contraintes") } + | contrainte contraintes { (print_endline "contraintes : contrainte contraintes") } + | LEFT_BRACE elements RIGHT_BRACE contraintes { (print_endline "contraintes : { elements } contraintes") } + +requires : REQUIRES NUMBER IDENTIFIER { (print_endline "requires : requires NUMBER IDENTIFIER") } + +contrainte : action IF IDENTIFIER etat { (print_endline "contrainte : action if IDENTIFIER etat") } + +action : STARTS { (print_endline "action : STARTS") } + | FINISHES { (print_endline "action : FINISHES") } + +etat : STARTED { (print_endline "etat : STARTED") } + | FINISHED { (print_endline "etat : FINISHED") } + +%% diff --git a/TP8-9/process-analysis/tests/test00.processus b/TP8-9/process-analysis/tests/test00.processus new file mode 100755 index 0000000..5ad4150 --- /dev/null +++ b/TP8-9/process-analysis/tests/test00.processus @@ -0,0 +1,8 @@ +/* Un premier exemple de processus */ +process ABC { + activity A + activity B + activity C + starts if A started + finishes if B finished +} \ No newline at end of file diff --git a/TP8-9/process-analysis/tests/test01.processus b/TP8-9/process-analysis/tests/test01.processus new file mode 100755 index 0000000..27c76ff --- /dev/null +++ b/TP8-9/process-analysis/tests/test01.processus @@ -0,0 +1,11 @@ +/* Un deuxième exemple de processus avec des ressources */ +process ABC { + resource R amount 5 + activity A + requires 2 R + activity B + activity C + requires 3 R + starts if A started + finishes if B finished +} diff --git a/TP8-9/process-analysis/tests/test02.processus b/TP8-9/process-analysis/tests/test02.processus new file mode 100755 index 0000000..fda1aa3 --- /dev/null +++ b/TP8-9/process-analysis/tests/test02.processus @@ -0,0 +1,18 @@ +/* Un troisième exemple de processus hiérarchique avec des ressources */ +process ABC { + resource R amount 5 + activity A { + activity A1 { + activity A11 + } + requires 1 R + activity A2 + requires 2 R + starts if A1 finished + } + requires 2 R + activity B + activity C requires 3 R + starts if A started + finishes if B finished +} \ No newline at end of file