pub struct QuadBody {
pub form: Quad2,
pub vars: Vec<u32>,
pub src: Range<usize>,
pub depth: u32,
}Expand description
A body the parser recognized as an already-expanded quadratic.
Fields§
§form: Quad2The recognized form. Bit-for-bit what
crate::nl_quadratic::recognize_expr returns for the tree these
same bytes parse to — asserted directly, over the whole corpus, by
pounce-cli/tests/quad_parse_differential.rs.
vars: Vec<u32>Every variable the body’s token stream mentions, ascending and
deduplicated — exactly the set collect_vars reports for the tree,
including variables whose coefficient cancelled to zero (which
form necessarily drops). Structural consumers want this one; the
linearity contract is over-stating-is-safe, and a support taken from
form would under-state.
src: Range<usize>Byte range of this body’s token stream inside NlProblem::src.
depth: u32Nesting depth of the tree these tokens would have built, on the same convention as a leaf counting 1.
Recorded because the streaming recognizer is iterative and the tree
parser is not: a body deep enough to overflow the parser’s stack now
loads, and the depth guard that used to be enforced implicitly by
the parse failing has to be enforced by something. pounce-py’s
checked_depth reads it (pounce #472). Rebuilding such a body with
NlProblem::con_expr would still recurse, which is the same
ceiling Q3 recorded and Q5 does not lift.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QuadBody
impl RefUnwindSafe for QuadBody
impl Send for QuadBody
impl Sync for QuadBody
impl Unpin for QuadBody
impl UnsafeUnpin for QuadBody
impl UnwindSafe for QuadBody
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T, U> Imply<T> for U
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more