1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//! Convenience macros for creating symbolic variables, plus the public
//! rewrite-engine and simplification option types.
//!
//! These macros reduce boilerplate when declaring multiple symbols or
//! symbols with assumptions.
//!
//! The type re-exports at the bottom of this module ([`Rule`],
//! [`RuleSet`], [`Bindings`], [`RewriteOpts`], [`RewriteStrategy`],
//! [`Step`], [`ExpandOpts`]) make the rewrite-rule engine reachable from
//! a stable public path; the prelude re-exports them as well.
// ── Rewrite-engine / simplification option types ───────────────────────
pub use crate;
pub use crateExpandOpts;
/// Declare multiple symbolic variables at once.
///
/// Each identifier becomes a `let` binding of type [`Ex`](crate::api::expr::Ex)
/// in the current scope.
///
/// # Examples
///
/// ```
/// use symplex::prelude::*;
/// use symplex::syms;
///
/// let ctx = Context::new();
/// syms!(ctx; x, y, z);
/// let expr = &x + &y + &z;
/// assert_eq!(format!("{expr}"), "x + y + z");
/// ```
/// Declare multiple symbolic variables at once (alias of [`syms!`]).
///
/// # Examples
///
/// ```
/// use symplex::prelude::*;
/// use symplex::vars;
///
/// let ctx = Context::new();
/// vars!(ctx; a, b);
/// assert_eq!(format!("{}", &a * &b), "a*b");
/// ```
/// 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));
/// ```