Skip to content

Commit

Permalink
Make absint public
Browse files Browse the repository at this point in the history
Closes: #10071
  • Loading branch information
lxfind authored and bors-libra committed Dec 21, 2021
1 parent 2dc491d commit e80a475
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions language/move-bytecode-verifier/src/absint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ use std::collections::BTreeMap;

/// Trait for finite-height abstract domains. Infinite height domains would require a more complex
/// trait with widening and a partial order.
pub(crate) trait AbstractDomain: Clone + Sized {
pub trait AbstractDomain: Clone + Sized {
fn join(&mut self, other: &Self) -> JoinResult;
}

#[derive(Debug)]
pub(crate) enum JoinResult {
pub enum JoinResult {
Changed,
Unchanged,
}

#[derive(Clone)]
pub(crate) enum BlockPostcondition<AnalysisError> {
pub enum BlockPostcondition<AnalysisError> {
/// Block not yet analyzed
Unprocessed,
/// Analyzing block was successful
Expand All @@ -33,21 +33,21 @@ pub(crate) enum BlockPostcondition<AnalysisError> {

#[allow(dead_code)]
#[derive(Clone)]
pub(crate) struct BlockInvariant<State, AnalysisError> {
pub struct BlockInvariant<State, AnalysisError> {
/// Precondition of the block
pub(crate) pre: State,
pub pre: State,
/// Postcondition of the block
pub(crate) post: BlockPostcondition<AnalysisError>,
pub post: BlockPostcondition<AnalysisError>,
}

/// A map from block id's to the pre/post of each block after a fixed point is reached.
#[allow(dead_code)]
pub(crate) type InvariantMap<State, AnalysisError> =
pub type InvariantMap<State, AnalysisError> =
BTreeMap<BlockId, BlockInvariant<State, AnalysisError>>;

/// Take a pre-state + instruction and mutate it to produce a post-state
/// Auxiliary data can be stored in self.
pub(crate) trait TransferFunctions {
pub trait TransferFunctions {
type State: AbstractDomain;
type AnalysisError: Clone;

Expand All @@ -70,7 +70,7 @@ pub(crate) trait TransferFunctions {
) -> Result<(), Self::AnalysisError>;
}

pub(crate) trait AbstractInterpreter: TransferFunctions {
pub trait AbstractInterpreter: TransferFunctions {
/// Analyze procedure local@function_view starting from pre-state local@initial_state.
fn analyze_function(
&mut self,
Expand Down
2 changes: 1 addition & 1 deletion language/move-bytecode-verifier/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// Bounds checks are implemented in the `vm` crate.
pub mod ability_field_requirements;
pub mod absint;
pub mod check_duplication;
pub mod code_unit_verifier;
pub mod constants;
Expand All @@ -28,7 +29,6 @@ pub use signature::SignatureChecker;
pub use struct_defs::RecursiveStructDefChecker;
pub use verifier::{verify_module, verify_script};

mod absint;
mod acquires_list_verifier;
mod locals_safety;
mod reference_safety;
Expand Down

0 comments on commit e80a475

Please sign in to comment.