Expand description
Reflects the DCG engine, including both the effects of the
programs running in it, and the internal effects of the engine
cleaning and dirtying the DCG. For the latter effects, see the
trace
module.
Reflected Values. Notably, the values in the engine
(including the values of mutable and compute nodes, and the values
stored on edges between them) are reflected here into a special Val
type. Primarily, the distinction between actual Rust values and
this reflected Val
type is what makes the DCG engine “reflected”
by the definitions in this module, and not identical to them.
This module provides an interface used by Adapton Lab to produce
HTML visualizations of these internal structures, for
experimentation and debugging (namely, the dcg_reflect_begin
and
dcg_reflect_end
functions). For the purposes of debugging,
visualization and design/exploration, we exploit the reflected
version of values to “walk” them, finding their articulations, and
walking their values, recursively.
Re-exports§
pub use crate::engine::reflect_dcg::*;
Modules§
- trace
- Gives effects and traces for cleaning and dirtying, the engine’s
internal DCG traversal/processing. By contrast, the enclosing
module (
reflect
) only gives reflected versions of the DCG itself, not changes that the engine makes to it.
Structs§
- Comp
Node - Reflected version of
engine::CompNode
. Stores a reflected value of typeOption<Val>
, which isNone
when the node has not yet been executed, andSome(_)
otherwise. - DCG
- Reflected version of
engine::DCG
. - Frame
- Reflected version of
engine::Frame
. - Loc
- Reflected version of
engine::Loc
ALoc
is a particular template for aName
: It is a path (a possibly-empty list ofName
s), followed by a distinguishedName
. ALoc
can be thought of roughly like a file path in UNIX (but Adapton has nothing to do with files, or with UNIX, directly). - Pred
- Reflected version of
engine::Pred
- Pure
Node - Reflected version of
engine::PureNode
. Stores a reflected value of typeVal
. - RefNode
- Reflected version of
engine::MutNode
. Stores a reflected value of typeVal
. - Succ
- Reflected version of
engine::Succ
. Unlike the real engine’sSucc
type, this version stores a reflected value (of typeVal
).
Enums§
- ArtContent
- The content of an articulation: Either a cell holding a value, or a thunk that has optionally produced a value.
- Const
- Primitive constants
- Effect
- Reflected version of
engine::Effect
- Node
- Reflected version of
engine::Node
. Unlike the real engine, these nodes are not parameterized by a value type. Instead, their values are all reflected into typeVal
. - Val
- Reflected value; Gives a syntax for inductive data type
constructors (
Constr
), named articulations (Art
) and primitive data (Data
). All values in the engine (including the values of nodes, and the values stored on edges) are represented with this reflectedVal
type. Primarily, this distinction between actual Rust values and this type is what makes the DCG engine “reflected” by the definitions in this module, and not identical to them.
Traits§
- Reflect
- This trait consists of the ability for a reference to
Self
to produce aT
. Conceptually, that value of type T is the “reflection” ofSelf
. A large set of types inengine
implement this trait for a particular type in this module, which represents its reflection. The documentation of this module makes this correspondance clear.
Functions§
- preds_
of_ node - Get the
Pred
s of aNode
, if they are defined. - reflect_
val - Wrapper for
parse_val::parse_val
. Transforms most Rust data that derivesDebug
into a reflectedVal
. - succs_
of_ node - Get the
Succ
s of aNode
, if they are defined.
Type Aliases§
- Path
- A
Path
here is just aVec
ofName
s