Debian Codegraph @

test-suite/success/paralleltac.v

raw
1 Lemma test_nofail_like_all1 :
2 True /\ False.
3 Proof.
4 split.
5 all: trivial.
6 Admitted.
7
8 Lemma test_nofail_like_all2 :
9 True /\ False.
10 Proof.
11 split.
12 par: trivial.
13 Admitted.
14
15 Fixpoint fib n := match n with
16 | O => 1
17 | S m => match m with
18 | O => 1
19 | S o => fib o + fib m end end.
20 Ltac sleep n :=
21 try (assert (fib n = S (fib n)) by reflexivity).
22 (* Tune that depending on your PC *)
23 #[local] Definition time := 18.
24
25 Axiom P : nat -> Prop.
26 Axiom P_triv : Type -> forall x, P x.
27 Ltac solve_P :=
28 match goal with |- P (S ?X) =>
29 sleep time; exact (P_triv Type _)
30 end.
31
32 Lemma test_old x : P (S x) /\ P (S x) /\ P (S x) /\ P (S x).
33 Proof.
34 repeat split.
35 idtac "T1: linear".
36 Time all: solve [solve_P].
37 Qed.
38
39 Lemma test_ok x : P (S x) /\ P (S x) /\ P (S x) /\ P (S x).
40 Proof.
41 repeat split.
42 idtac "T2: parallel".
43 Time par: solve [solve_P].
44 Qed.
45
46 Lemma test_fail x : P (S x) /\ P x /\ P (S x) /\ P (S x).
47 Proof.
48 repeat split.
49 idtac "T3: linear failure".
50 Fail Time all: solve solve_P.
51 all: solve [apply (P_triv Type)].
52 Qed.
53
54 Lemma test_fail2 x : P (S x) /\ P x /\ P (S x) /\ P (S x).
55 Proof.
56 repeat split.
57 idtac "T4: parallel failure".
58 Fail Time par: solve [solve_P].
59 all: solve [apply (P_triv Type)].
60 Qed.