https://github.com/coastalwhite/rustlogic

RustLogic is a crate for parsing and handling simple logical expressings with rust.

https://github.com/coastalwhite/rustlogic

Science Score: 26.0%

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

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (6.8%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

RustLogic is a crate for parsing and handling simple logical expressings with rust.

Basic Info
  • Host: GitHub
  • Owner: coastalwhite
  • Language: Rust
  • Default Branch: master
  • Size: 47.9 KB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 6 years ago · Last pushed over 3 years ago
Metadata Files
Readme

README.md

Hello fellow Rustacians! RustLogic is a crate for parsing and handling simple logical expressings.

Description

This crate provides a fast way of parsing logical strings into a tree object. Furthermore, one can insert variables into this equation for single parsing-multiple outputs.

Examples

4-1 Multiplexer

``` use std::collections::HashMap; let multiplexer4to_1 = rustlogic::parse( "([a]&~[x]&~[y])|([b]&~[x]&[y])|([c]&[x]&~[y])|([d]&[x]&[y])" ) .expect("Failed to parse 4-1 multiplexer");

let mut variable_map = HashMap::new();

// Input: 1001 variablemap.insert("a", true); variablemap.insert("b", false); variablemap.insert("c", false); variablemap.insert("d", true);

// Selector: 11 variablemap.insert("x", true); variablemap.insert("y", true);

// Should select fourth item from bus so true let value = multiplexer4to1.getvaluefromvariables(&variable_map).unwrap(); println!("{}", value); // Will print true! ```

Evaluating a logical string with variables and custom logical operators

``` use rustlogic::operators; use std::collections::HashMap;

// Define the set let operatorset = operators::commonsets::worded();

let parsed = rustlogic::customparse("(NOT $[A] AND TRUE) OR $[B]", &operatorset);

// We assign the variables to their values let mut hm = HashMap::new(); hm.insert("A", false); hm.insert("B", false);

// Now contains the value of the logical expression let value = parsed.unwrap().getvaluefrom_variables(&hm).unwrap(); ```

Issues

If you want to want to submit an issue or a pull request, please visit the GitHub page.

Thanks for your time and enjoy this crate!

Owner

  • Name: Gijs Burghoorn
  • Login: coastalwhite
  • Kind: user
  • Location: Netherlands
  • Company: Polars

Rusty Hardware and Security Guy 🦀

GitHub Events

Total
Last Year

Committers

Last synced: about 3 years ago

All Time
  • Total Commits: 25
  • Total Committers: 2
  • Avg Commits per committer: 12.5
  • Development Distribution Score (DDS): 0.04
Past Year
  • Commits: 4
  • Committers: 1
  • Avg Commits per committer: 4.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Gijs Burghoorn g****n@g****m 24
coastalwhite g****d@g****m 1

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 3
  • Total pull requests: 1
  • Average time to close issues: 26 days
  • Average time to close pull requests: less than a minute
  • Total issue authors: 3
  • Total pull request authors: 1
  • Average comments per issue: 3.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Emily3403 (1)
  • Rose1917 (1)
  • dpc (1)
Pull Request Authors
  • coastalwhite (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • cargo 10,336 total
  • Total dependent packages: 2
    (may contain duplicates)
  • Total dependent repositories: 2
    (may contain duplicates)
  • Total versions: 7
  • Total maintainers: 2
crates.io: rustlogic

A Rust Library for basic parsing and handling of logical formulas

  • Versions: 6
  • Dependent Packages: 1
  • Dependent Repositories: 2
  • Downloads: 8,559 Total
Rankings
Dependent repos count: 13.1%
Dependent packages count: 18.2%
Forks count: 26.3%
Average: 27.2%
Downloads: 36.4%
Stargazers count: 42.1%
Maintainers (1)
Last synced: 11 months ago
crates.io: rustlogic-march1917

A Rust Library for basic parsing and handling of logical formulas(forked from coastalwhite)

  • Versions: 1
  • Dependent Packages: 1
  • Dependent Repositories: 0
  • Downloads: 1,777 Total
Rankings
Forks count: 24.8%
Dependent repos count: 29.3%
Dependent packages count: 33.8%
Stargazers count: 39.2%
Average: 44.8%
Downloads: 96.7%
Maintainers (1)
Last synced: 11 months ago

Dependencies

Cargo.toml cargo