Skip to content

Commit

Permalink
more cleanup of docs
Browse files Browse the repository at this point in the history
  • Loading branch information
oflatt committed Aug 20, 2024
1 parent 3bd82dc commit 539a02a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/egraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ impl<L: Language, N: Analysis<L>> EGraph<L, N> {
}

/// Like `add_expr_uncanonical` but with an existence reason.
/// When the `reason` is `None`, this method panics when the added expression
/// When the `reason` is [`ExistenceReason::ExpectExists`], this method panics when the added expression
/// is not already represented by the egraph.
fn add_expr_uncanonical_with_reason(
&mut self,
Expand Down Expand Up @@ -907,7 +907,7 @@ impl<L: Language, N: Analysis<L>> EGraph<L, N> {
/// Calling [`id_to_expr`](EGraph::id_to_expr) on this `Id` return an correspond to the
/// instantiation of the pattern.
///
/// When `existence` is `None`, this method panics when the instantiated pattern
/// When `existence` is [`ExistenceReason::ExpectExists`], this method panics when the instantiated pattern
/// is not by congruence to another term.
pub(crate) fn add_instantiation_noncanonical(
&mut self,
Expand Down
4 changes: 4 additions & 0 deletions src/explain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ pub(crate) enum ExistenceReason {
Unset,
}

/// When explaining the existence of a term,
/// this enum is used to specify whether the term is
/// 1) Expected to already be represented by the egraph (is equal to some other term via congruence)
/// or 2) Should be inserted with a particular reason
pub enum ExistsOrReason {
ExpectExists,
Reason(ExistenceReason),
Expand Down

0 comments on commit 539a02a

Please sign in to comment.