Skip to main content

sym

Macro sym 

Source
macro_rules! sym {
    ($ctx:expr; $name:ident $(, $prop:ident)*) => { ... };
}
Expand description

Declare a symbol with mathematical assumptions.

The first argument is the context, the second is the symbol name, and any additional identifiers are assumption variants applied to the symbol.

ยงExamples

use symplex::prelude::*;
use symplex::sym;

let ctx = Context::new();
sym!(ctx; t, Positive, Real);
assert_eq!(ctx.query(&t, Props::POSITIVE), Some(true));
assert_eq!(ctx.query(&t, Props::REAL), Some(true));
// Inferred:
assert_eq!(ctx.query(&t, Props::COMPLEX), Some(true));