TASK 2.4 Implement the missing code for the method specialize(specialization_map) of class InferenceRule, which returns the specialization of the inference rule according to the given specialization map. #: A mapping from variable names to formulas. SpecializationMap = Mapping[str, Formula] ... class InferenceRule: ... def specialize(self, specialization_map: SpecializationMap) -> \ InferenceRule: """Specializes the current inference rule by simultaneously substituting each variable name `v` that is a key in `specialization_map` with the formula `specialization_map[v]`. Parameters: specialization_map: mapping defining the specialization to be performed. Returns: The resulting inference rule. """ for variable in specialization_map: assert is_variable(variable) # Task 4.4
TASK 2.4 |
|
Implement the missing code for the method specialize(specialization_map)
#: A mapping from variable names to formulas.
|
Step by step
Solved in 2 steps