logical-expressions

Crates.iological-expressions
lib.rslogical-expressions
version
sourcesrc
created_at2025-02-22 19:02:27.704512+00
updated_at2025-03-17 17:13:42.475262+00
descriptionA library for working with logical expressions
homepage
repositoryhttps://gitlab.com/porky11/logical-expressions
max_upload_size
id1565666
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Fabio Krapohl (porky11)

documentation

README

Logical Expressions

A library for working with logical expressions in Rust.

Features

  • Representing logical expressions using the LogicalExpression enum (supports And lists, Or lists and single conditions)
  • Support for custom types to represent conditions
  • Parsing logical expressions from strings with proper error handling
  • Expanding logical expressions into a list of lists, where the inner lists represent AND conditions and the outer lists represent OR conditions (DNF)

Quickstart

Here's an example of how to use the library:

use logical_expressions::LogicalExpression;

let expression: LogicalExpression<String> = LogicalExpression::parse("a & (b | c)").unwrap();
let expanded = expression.expand();
println!("{expanded:?}");

This will output:

[["a", "b"], ["a", "c"]]

Documentation

For more detailed information and examples, please refer to the API documentation.

Commit count: 0

cargo fmt