Skip to content

Commit

Permalink
Merge pull request #3199 from chandradeepdey/subset
Browse files Browse the repository at this point in the history
Add a subset_mem lemma to make mem_subset more complete
  • Loading branch information
aseemr authored Feb 19, 2024
2 parents cd5b7bc + 6cfe3be commit 1998265
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ulib/FStar.List.Tot.Properties.fst
Original file line number Diff line number Diff line change
Expand Up @@ -595,14 +595,15 @@ let rec partition_count_forall #a f l= match l with
(** Properties about subset **)

let rec mem_subset (#a: eqtype) (la lb: list a)
: Lemma (requires (forall x. mem x la ==> mem x lb))
(ensures (subset la lb)) =
: Lemma (subset la lb <==> (forall x. mem x la ==> mem x lb))
[SMTPat (subset la lb)] =
match la with
| [] -> ()
| hd :: tl -> mem_subset tl lb

(* NOTE: This is implied by mem_subset above, kept for compatibility *)
let subset_reflexive (#a: eqtype) (l: list a)
: Lemma (subset l l) [SMTPat (subset l l)] = mem_subset l l
: Lemma (subset l l) = ()

(** Correctness of quicksort **)

Expand Down

0 comments on commit 1998265

Please sign in to comment.