Struct test_generation::transitions::Subst
source · pub struct Subst {
pub subst: HashMap<usize, SignatureToken>,
}
Expand description
A substitution is a mapping from type formal index to the SignatureToken
representing the
type instantiation for that index.
Fields§
§subst: HashMap<usize, SignatureToken>
Implementations§
source§impl Subst
impl Subst
pub fn new() -> Self
sourcepub fn check_and_add(
&mut self,
state: &AbstractState,
stack_sig: SignatureToken,
instr_sig: SignatureToken
) -> bool
pub fn check_and_add( &mut self, state: &AbstractState, stack_sig: SignatureToken, instr_sig: SignatureToken ) -> bool
NB that the position of arguments here matters. We can build a substitution if the instr_sig
is a type parameter, and the stack_sig
is a concrete type. But, if the instruction signature is a
concrete type, but the stack signature is a type parameter, they cannot unify and no
substitution is created.
sourcepub fn instantiation(self) -> Vec<SignatureToken> ⓘ
pub fn instantiation(self) -> Vec<SignatureToken> ⓘ
Return the instantiation from the substitution that has been built.