1#![cfg_attr(not(creusot), allow(unused_imports))]
6use crate::prelude::*;
7
8pub mod fmap;
9mod fset;
10mod id;
11mod int;
12mod mapping;
13pub mod ops;
14pub mod ord;
15pub mod ra;
16pub mod real;
17pub mod seq;
18mod set;
19mod well_founded;
20
21pub use self::{
22 fmap::FMap,
23 fset::FSet,
24 id::Id,
25 int::{Int, Nat, Positive},
26 mapping::Mapping,
27 ord::{OrdLogic, PartialOrdLogic},
28 seq::Seq,
29 set::Set,
30 well_founded::WellFounded,
31};
32
33#[trusted]
38#[logic(opaque)]
39#[requires(exists<x: T> p[x])]
40#[ensures(p[result])]
41pub fn such_that<T>(p: Mapping<T, bool>) -> T {
42 dead
43}
44
45#[logic]
48#[ensures(match result {
49 Some(v) => p[v],
50 None => forall<x: T> !p[x],
51})]
52pub fn try_such_that<T>(p: Mapping<T, bool>) -> Option<T> {
53 pearlite! {
54 if exists<x: T> p[x] {
55 Some(such_that(p))
56 } else {
57 None
58 }
59 }
60}
61
62#[logic]
64pub fn any<T>() -> T {
65 such_that(|_| true)
66}