def __init__(self, property_lists):
        """Load CBMC properties from lists of properties."""
        def handle_duplicates(name, defn1, defn2):
            logging.warning(
                "Found duplicate property definition: "
                "%s: %s %s <- %s %s", name, defn1["location"]["file"],
                defn1["location"]["line"], defn2["location"]["file"],
                defn2["location"]["line"])

        self.properties = util.merge_dicts(property_lists, handle_duplicates)
        self.validate()
Esempio n. 2
0
    def __init__(self, loop_maps):
        """Load CBMC loop map from a lists of loop maps."""
        def handle_duplicates(name, srcloc1, srcloc2):
            logging.warning(
                "Found duplicate loop definition: "
                "%s: %s %s <- %s %s", name, srcloc1["file"], srcloc1["line"],
                srcloc2["file"], srcloc2["line"])

        self.loops = util.merge_dicts(loop_maps, handle_duplicates)
        self.loops = self.unmangle_loop_names(self.loops)
        self.validate()
Esempio n. 3
0
    def merge(trace_lists):
        """Merge trace lists."""
        def handle_duplicate(key, val1, val2):
            """Handle different traces for the same assertion."""
            _, _ = val1, val2
            logging.warning("Found duplicate traces for property %s", key)

        traces = util.merge_dicts(trace_lists, handle_duplicate)
        return {
            name: close_function_stack_frames(trace)
            for name, trace in traces.items()
        }
Esempio n. 4
0
 def merge(tables):
     return util.merge_dicts(tables)