<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _collect_memory_descriptors(program: Program) -> Dict[str, ParameterSpec]: """Collect Declare instructions that are important for building the patch table. This is secretly stored on BinaryExecutableResponse. We're careful to make sure these objects are json serializable. :return: A dictionary of variable names to specs about the declared region. """

    return {
        instr.name: ParameterSpec(type=instr.memory_type, length=instr.memory_size)
        for instr in program if isinstance(instr, Declare)
    }