Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (7.6%) to scientific vocabulary
Last synced: 8 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: alfiemd
  • License: unlicense
  • Language: Rust
  • Default Branch: main
  • Size: 12.7 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 1 year ago · Last pushed over 1 year ago
Metadata Files
Readme Contributing Citation

README.md

poset

A simple implementation of posets.

Rust already provides some tools to analyse posets; we can define partial order on a type T by implementing PartialOrd. Doing so affords us the ability to use operators as we naturally would, writing things like a >= b.

But implementing PartialOrd is not ideal when we wish to consider multiple partial orders on a type. For example, what if we wanted to consider the natural numbers (i.e. u32) with the divisbility relation: a >= b if and only if a % b == 0.

The purpose of this crate is to provide both an ergonomic way to work with various partial orders, and also helpful tools to study those associated posets (by generating things like Hasse diagrams). It is within the future scope of this crate to provide such things for more general relations, too.

If you want the crate to be finished quicker, then you could consider contributing. :)

Example

```rust use poset::{Poset, PartialOrder, PartialOrderBehaviour}; use std::error::Error;

fn main() -> Result<(), Box> { // a >= b if and only if b divides a let divis = PartialOrder::new(|a: &i32, b: &i32| a % b == 0);

// 3 is *comparable* with 6
assert!(divis.cp(&3, &6));
// 4 is *incomparable* with 6
assert!(divis.ip(&4, &6));
// 3 divides 15
assert!(divis.lt(&3, &15));

let pos = Poset::with_elements(1..16, divis);
let chain_decomp = pos.chain_decomposition()?;

let antichains = pos.antichains(chain_decomp);

// c.f. [OEIS A051026](https://oeis.org/A051026)
assert_eq!(antichains.count(), 1133);

// if you want to generate Hasse diagrams
#[cfg(feature = "graff")]
{
    use graff::{Graph, GraphBehaviour};

    let g = pos.hasse()?;
    assert_eq!(g.edge_count(), 19);
}

Ok(())

} ```

License

This project is released under The Unlicense, dedicated to the public domain.

Contributing

Contributions welcome! :)

By submitting a pull request or otherwise contributing to this project, you agree to dedicate your contribution to the public domain under the terms of The Unlicense, and you certify that you have the right to do so.

Owner

  • Name: alfie
  • Login: alfiemd
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you found this software useful, you can cite it using the metadata from this file."
title: "poset"
abstract: "This is software for research in order theory."
authors:
  - family-names: Davies
    given-names: Alfie
    orcid: "https://orcid.org/0000-0002-4215-7343"
version: 0.1.0
date-released: "2024-09-25"
keywords:
  - "order theory"
  - posets
  - mathematics
license: Unlicense
type: software
repository-code: "https://github.com/alfiemd/poset"
contact:
  - email: research@alfied.xyz
  - family-names: Davies
  - given-names: Alfie

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Dependencies

Cargo.lock cargo
  • byteorder 1.5.0
  • cfg-if 1.0.0
  • getrandom 0.2.15
  • graff 0.1.0
  • libc 0.2.158
  • ppv-lite86 0.2.20
  • proc-macro2 1.0.86
  • quote 1.0.37
  • rand 0.8.5
  • rand_chacha 0.3.1
  • rand_core 0.6.4
  • serde 1.0.210
  • serde_derive 1.0.210
  • syn 2.0.77
  • unicode-ident 1.0.13
  • wasi 0.11.0+wasi-snapshot-preview1
  • zerocopy 0.7.35
  • zerocopy-derive 0.7.35
Cargo.toml cargo