Dynamic domain implementation for linear algebra purposes
WIP
use dynamic_domain::{Domain, Value};
fn main() {
// [5;10)
let domain = Domain::Domain(
Value::Included(5),
Value::Secluded(10)
);
println("{}", domain.repr());
}
use dynamic_domain::{Domain, Value};
fn main() {
// (3;5]
let mut domain = Domain::new()
.lt(Value::Included(5))
.gt(Value::Secluded(3))
.gt(Value::Secluded(1));
println!("{}", domain.repr());
}
use dynamic_domain::{Domain, Value};
fn main() {
// domain1 = (-∞;5)
// domain2 = [8;100]
let domain = Domain::Union(vec![domain1, domain2]);
println!("{}", domain.repr()); // (-∞;5)⋃[8;100]
}
use dynamic_domain::{Domain, Value};
fn main() {
let domain = Domain::None;
println!("{}", domain.repr()); // ∅
}
use dynamic_domain::{Domain, Value};
fn receiver(i: i32, context: &()) {
println!("{}", i);
}
fn main() {
let domain = Domain::Domain(
Value::Included(5),
Value::Secluded(10)
);
domain.generate(receiver, &());
}
- constraint