Skip to main content

ReprDomainLevel

Trait ReprDomainLevel 

Source
pub trait ReprDomainLevel {
    type Assignment: ReprAssignment;
    type DeclLevel: ReprDeclLevel<DomainLevel = Self, Assignment = Self::Assignment>;

    const RULE: &'static dyn ReprRuleStored;

    // Required methods
    fn init(dom: Moo<Domain>) -> Result<Self, ReprInitError>
       where Self: Sized;
    fn compactness_score(&self) -> usize;
    fn instantiate(
        self,
        decl: DeclarationPtr,
    ) -> Result<(Self::DeclLevel, SymbolTable, Vec<Expression>), ReprInstantiateError>;
    fn down(&self, value: Literal) -> Result<Self::Assignment, ReprDownError>;
}

Required Associated Constants§

Source

const RULE: &'static dyn ReprRuleStored

Required Associated Types§

Source

type Assignment: ReprAssignment

Source

type DeclLevel: ReprDeclLevel<DomainLevel = Self, Assignment = Self::Assignment>

Required Methods§

Source

fn init(dom: Moo<Domain>) -> Result<Self, ReprInitError>
where Self: Sized,

Initialise this representation at the domain level. Returns Err if it is not applicable to the given domain.

Source

fn compactness_score(&self) -> usize

Number of assignments admitted by the domains introduced by this representation. Multiple representation-variable domains are combined as a Cartesian product.

Source

fn instantiate( self, decl: DeclarationPtr, ) -> Result<(Self::DeclLevel, SymbolTable, Vec<Expression>), ReprInstantiateError>

Construct a concrete instance of this representation Returns:

  • The declaration-level representation
  • Representation variables to add to the symbol table
  • List of structural constraints
Source

fn down(&self, value: Literal) -> Result<Self::Assignment, ReprDownError>

Given an instance of this representation for some domain, and a value in that domain, construct the corresponding assignment of representation variables.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§