Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/advancedresearch/pocket_prover-set
A base logical system for PocketProver to reason about set properties
https://github.com/advancedresearch/pocket_prover-set
Last synced: 3 months ago
JSON representation
A base logical system for PocketProver to reason about set properties
- Host: GitHub
- URL: https://github.com/advancedresearch/pocket_prover-set
- Owner: advancedresearch
- License: mit
- Created: 2018-02-23T09:43:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-10-07T21:46:59.000Z (about 2 years ago)
- Last Synced: 2024-05-22T20:33:27.095Z (6 months ago)
- Language: Rust
- Size: 13.7 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-rust-formalized-reasoning - pocket_prover-set - set) - base logical system for PocketProver to reason about set properties. (Projects / Verification)
README
# pocket_prover-set
A base logical system for PocketProver to reason about set properties```rust
extern crate pocket_prover;
extern crate pocket_prover_set;use pocket_prover::*;
use pocket_prover_set::*;fn main() {
println!("Result {}", Set::imply(
|s| s.fin_many,
|s| not(s.inf_many)
));
}
```There are 4 bits of information, used to derive all other properties:
- `any` - All types, including those not defined
- `uniq` - A unique value
- `fin_many` - Many but finite number of values
- `inf_many` - Many but infinite number of valuesA set is empty (`.none()`) when all bits are set to 0.
A set is non-empty (`.some()`) when at least bit is set to 1.
A set is undefined when it is `any` but neither unique, finite or infinite.
Here is an example of a proof of 8 sets:
```rust
extern crate pocket_prover;
extern crate pocket_prover_set;use pocket_prover::*;
use pocket_prover_set::*;fn main() {
println!("Result {}", <(Set, Set, Set, Set, Set, Set, Set, Set)>::imply(
|sets| and(sets.uniqs(|xs| xorn(xs)), sets.0.uniq),
|sets| not(sets.7.uniq)
));
}
```