@@ -83,7 +83,7 @@ Ltac compute_bv_funs_tac H t compute_bv_binrel compute_bv_binop
83
83
84
84
Ltac unfold_bv_funs := unfold bvNat, bvultWithProof, bvuleWithProof,
85
85
bvsge, bvsgt, bvuge, bvugt, bvSCarry, bvSBorrow,
86
- xor, xorb.
86
+ xorb.
87
87
88
88
Tactic Notation "compute_bv_funs" :=
89
89
unfold_bv_funs;
@@ -354,15 +354,15 @@ Proof. holds_for_bits_up_to_3. Qed.
354
354
(** Lemmas about bitvector xor * *)
355
355
356
356
Lemma bvXor_same n x :
357
- SAWCorePrelude.bvXor n x x = SAWCorePrelude.replicate n Bool false.
357
+ SAWCorePrelude.bvXor n x x = SAWCorePrelude.replicate n bool false.
358
358
Proof .
359
359
unfold SAWCorePrelude.bvXor, SAWCorePrelude.bvZipWith, SAWCorePrelude.zipWith, SAWCorePrelude.replicate.
360
360
induction x; auto; simpl; f_equal; auto.
361
361
rewrite SAWCorePrelude.xor_same; auto.
362
362
Qed .
363
363
364
364
Lemma bvXor_zero n x :
365
- SAWCorePrelude.bvXor n x (SAWCorePrelude.replicate n Bool false) = x.
365
+ SAWCorePrelude.bvXor n x (SAWCorePrelude.replicate n bool false) = x.
366
366
Proof .
367
367
unfold SAWCorePrelude.bvXor, SAWCorePrelude.bvZipWith, SAWCorePrelude.zipWith, SAWCorePrelude.replicate.
368
368
induction x; auto; simpl. f_equal; auto; cbn.
@@ -375,7 +375,7 @@ Lemma bvXor_assoc n x y z :
375
375
Proof .
376
376
unfold SAWCorePrelude.bvXor, SAWCorePrelude.bvZipWith, SAWCorePrelude.zipWith.
377
377
induction n; auto; simpl. f_equal; auto; cbn.
378
- unfold xor. rewrite Bool.xorb_assoc_reverse. reflexivity.
378
+ rewrite Bool.xorb_assoc_reverse. reflexivity.
379
379
remember (S n).
380
380
destruct x; try solve [inversion Heqn0; clear Heqn0; subst]. injection Heqn0.
381
381
destruct y; try solve [inversion Heqn0; clear Heqn0; subst]. injection Heqn0.
@@ -388,7 +388,7 @@ Lemma bvXor_comm n x y :
388
388
Proof .
389
389
unfold SAWCorePrelude.bvXor, SAWCorePrelude.bvZipWith, SAWCorePrelude.zipWith.
390
390
induction n; auto; simpl. f_equal; auto; cbn.
391
- unfold xor. apply Bool.xorb_comm.
391
+ apply Bool.xorb_comm.
392
392
remember (S n).
393
393
destruct x; try solve [inversion Heqn0; clear Heqn0; subst]. injection Heqn0.
394
394
destruct y; try solve [inversion Heqn0; clear Heqn0; subst]. injection Heqn0.
@@ -407,46 +407,46 @@ Proof. split; destruct a, b; easy. Qed.
407
407
Lemma boolEq_refl a : boolEq a a = true.
408
408
Proof . destruct a; easy. Qed .
409
409
410
- Lemma and_bool_eq_true b c : and b c = true <-> (b = true) /\ (c = true).
410
+ Lemma and_bool_eq_true b c : andb b c = true <-> (b = true) /\ (c = true).
411
411
Proof .
412
412
split.
413
413
- destruct b, c; auto.
414
414
- intro; destruct H; destruct b, c; auto.
415
415
Qed .
416
416
417
- Lemma and_bool_eq_false b c : and b c = false <-> (b = false) \/ (c = false).
417
+ Lemma and_bool_eq_false b c : andb b c = false <-> (b = false) \/ (c = false).
418
418
Proof .
419
419
split.
420
420
- destruct b, c; auto.
421
421
- intro; destruct H; destruct b, c; auto.
422
422
Qed .
423
423
424
- Lemma or_bool_eq_true b c : or b c = true <-> (b = true) \/ (c = true).
424
+ Lemma or_bool_eq_true b c : orb b c = true <-> (b = true) \/ (c = true).
425
425
Proof .
426
426
split.
427
427
- destruct b, c; auto.
428
428
- intro; destruct H; destruct b, c; auto.
429
429
Qed .
430
430
431
- Lemma or_bool_eq_false b c : or b c = false <-> (b = false) /\ (c = false).
431
+ Lemma or_bool_eq_false b c : orb b c = false <-> (b = false) /\ (c = false).
432
432
Proof .
433
433
split.
434
434
- destruct b, c; auto.
435
435
- intro; destruct H; destruct b, c; auto.
436
436
Qed .
437
437
438
- Lemma not_bool_eq_true b : not b = true <-> b = false.
438
+ Lemma not_bool_eq_true b : negb b = true <-> b = false.
439
439
Proof . split; destruct b; auto. Qed .
440
440
441
- Lemma not_bool_eq_false b : not b = false <-> b = true.
441
+ Lemma not_bool_eq_false b : negb b = false <-> b = true.
442
442
Proof . split; destruct b; auto. Qed .
443
443
444
444
445
445
(** Lemmas about bitvector equality * *)
446
446
447
447
Lemma bvEq_cons w h0 h1 a0 a1 :
448
448
bvEq (S w) (VectorDef.cons _ h0 w a0) (VectorDef.cons _ h1 w a1) =
449
- and (boolEq h0 h1) (bvEq w a0 a1).
449
+ andb (boolEq h0 h1) (bvEq w a0 a1).
450
450
Proof . reflexivity. Qed .
451
451
452
452
Lemma bvEq_refl w a : bvEq w a a = true.
@@ -485,13 +485,6 @@ Qed.
485
485
486
486
Hint Extern 1 (StartAutomation _) => progress compute_bv_funs: refinesFun.
487
487
488
- Lemma true_eq_scaffolding_true : Datatypes.true = SAWCoreScaffolding.true.
489
- Proof . reflexivity. Qed .
490
- Lemma false_eq_scaffolding_false : Datatypes.false = SAWCoreScaffolding.false.
491
- Proof . reflexivity. Qed .
492
-
493
- Hint Rewrite true_eq_scaffolding_true false_eq_scaffolding_false : SAWCoreBitvectors_eqs.
494
-
495
488
Ltac FreshIntroArg_bv_eq T :=
496
489
let e := fresh in
497
490
IntroArg_intro e;
@@ -551,14 +544,14 @@ Proof. intros H eq; apply H; destruct b; easy. Qed.
551
544
552
545
Lemma IntroArg_and_bool_eq_true n (b c : bool) goal :
553
546
IntroArg n (b = true) (fun _ => FreshIntroArg n (c = true) (fun _ => goal)) ->
554
- IntroArg n (and b c = true) (fun _ => goal).
547
+ IntroArg n (andb b c = true) (fun _ => goal).
555
548
Proof .
556
549
intros H eq; apply H; apply and_bool_eq_true in eq; destruct eq; eauto.
557
550
Qed .
558
551
Lemma IntroArg_and_bool_eq_false n (b c : bool) goal :
559
552
IntroArg n (b = false) (fun _ => goal) ->
560
553
IntroArg n (c = false) (fun _ => goal) ->
561
- IntroArg n (and b c = false) (fun _ => goal).
554
+ IntroArg n (andb b c = false) (fun _ => goal).
562
555
Proof .
563
556
intros Hl Hr eq; apply and_bool_eq_false in eq.
564
557
destruct eq; [ apply Hl | apply Hr ]; eauto.
@@ -572,14 +565,14 @@ Qed.
572
565
Lemma IntroArg_or_bool_eq_true n (b c : bool) goal :
573
566
IntroArg n (b = true) (fun _ => goal) ->
574
567
IntroArg n (c = true) (fun _ => goal) ->
575
- IntroArg n (or b c = true) (fun _ => goal).
568
+ IntroArg n (orb b c = true) (fun _ => goal).
576
569
Proof .
577
570
intros Hl Hr eq; apply or_bool_eq_true in eq.
578
571
destruct eq; [ apply Hl | apply Hr ]; eauto.
579
572
Qed .
580
573
Lemma IntroArg_or_bool_eq_false n (b c : bool) goal :
581
574
IntroArg n (b = false) (fun _ => FreshIntroArg n (c = false) (fun _ => goal)) ->
582
- IntroArg n (or b c = false) (fun _ => goal).
575
+ IntroArg n (orb b c = false) (fun _ => goal).
583
576
Proof .
584
577
intros H eq; apply H; apply or_bool_eq_false in eq; destruct eq; eauto.
585
578
Qed .
@@ -591,11 +584,11 @@ Qed.
591
584
592
585
Lemma IntroArg_not_bool_eq_true n (b : bool) goal :
593
586
IntroArg n (b = false) (fun _ => goal) ->
594
- IntroArg n (not b = true) (fun _ => goal).
587
+ IntroArg n (negb b = true) (fun _ => goal).
595
588
Proof . intros H eq; apply H, not_bool_eq_true; eauto. Qed .
596
589
Lemma IntroArg_not_bool_eq_false n (b : bool) goal :
597
590
IntroArg n (b = true) (fun _ => goal) ->
598
- IntroArg n (not b = false) (fun _ => goal).
591
+ IntroArg n (negb b = false) (fun _ => goal).
599
592
Proof . intros H eq; apply H, not_bool_eq_false; eauto. Qed .
600
593
601
594
(* Hint Extern 1 (IntroArg _ (not _ = true) _) => *)
@@ -647,9 +640,9 @@ Hint Extern 1 (IntroArg _ (@eq bool ?x ?y) _) =>
647
640
lazymatch y with
648
641
| true => lazymatch x with
649
642
| SAWCorePrelude.bvEq _ _ _ => simple apply IntroArg_bvEq_eq
650
- | and _ _ => simple apply IntroArg_and_bool_eq_true
651
- | or _ _ => simple apply IntroArg_or_bool_eq_true
652
- | not _ => simple apply IntroArg_not_bool_eq_true
643
+ | andb _ _ => simple apply IntroArg_and_bool_eq_true
644
+ | orb _ _ => simple apply IntroArg_or_bool_eq_true
645
+ | negb _ => simple apply IntroArg_not_bool_eq_true
653
646
| boolEq _ _ => simple apply IntroArg_boolEq_eq
654
647
| if _ then true else false => simple apply IntroArg_bool_eq_if_true
655
648
| if _ then 1%bool else 0%bool => simple apply IntroArg_bool_eq_if_true
@@ -658,9 +651,9 @@ Hint Extern 1 (IntroArg _ (@eq bool ?x ?y) _) =>
658
651
end
659
652
| false => lazymatch x with
660
653
| SAWCorePrelude.bvEq _ _ _ => simple apply IntroArg_bvEq_neq
661
- | and _ _ => simple apply IntroArg_and_bool_eq_false
662
- | or _ _ => simple apply IntroArg_or_bool_eq_false
663
- | not _ => simple apply IntroArg_not_bool_eq_false
654
+ | andb _ _ => simple apply IntroArg_and_bool_eq_false
655
+ | orb _ _ => simple apply IntroArg_or_bool_eq_false
656
+ | negb _ => simple apply IntroArg_not_bool_eq_false
664
657
| boolEq _ _ => simple apply IntroArg_boolEq_neq
665
658
| if _ then true else false => simple apply IntroArg_bool_eq_if_false
666
659
| if _ then 1%bool else 0%bool => simple apply IntroArg_bool_eq_if_false
@@ -694,10 +687,6 @@ Proof. intros H eq; apply H; eauto. Qed.
694
687
Hint Extern 1 (IntroArg _ (iteDep (fun _ => Maybe (Eq _ _ _)) true _ _ = _) _) =>
695
688
simple apply IntroArg_iteDep_Maybe_Eq_true : refinesFun.
696
689
Hint Extern 1 (IntroArg _ (iteDep (fun _ => Maybe (Eq _ _ _)) false _ _ = _) _) =>
697
- simple apply IntroArg_iteDep_Maybe_Eq_false : refinesFun.
698
- Hint Extern 1 (IntroArg _ (iteDep (fun _ => Maybe (Eq _ _ _)) Datatypes.true _ _ = _) _) =>
699
- simple apply IntroArg_iteDep_Maybe_Eq_true : refinesFun.
700
- Hint Extern 1 (IntroArg _ (iteDep (fun _ => Maybe (Eq _ _ _)) Datatypes.false _ _ = _) _) =>
701
690
simple apply IntroArg_iteDep_Maybe_Eq_false : refinesFun.
702
691
703
692
Lemma IntroArg_isBvsle_def n w a b goal
0 commit comments