def do_make_property(viewer_property, cbmc_property, srcdir):
    """The implementation of make-property."""

    if viewer_property:
        if filet.all_json_files(viewer_property):
            return PropertyFromJson(viewer_property)
        fail("Expected json files: {}".format(viewer_property))

    if cbmc_property and srcdir:
        if filet.all_json_files(cbmc_property):
            return PropertyFromCbmcJson(cbmc_property, srcdir)
        if filet.all_xml_files(cbmc_property):
            return PropertyFromCbmcXml(cbmc_property, srcdir)
        fail("Expected json files or xml files, not both: {}".format(
            cbmc_property))

    fail("Expected --viewer-property or --srcdir and cbmc property output.")
def do_make_coverage(viewer_coverage, srcdir, cbmc_coverage):
    """The implementation of make-coverage."""

    if viewer_coverage:
        if filet.all_json_files(viewer_coverage):
            return CoverageFromJson(viewer_coverage)
        fail("Expected json files: {}".format(viewer_coverage))

    if cbmc_coverage and srcdir:
        if filet.all_json_files(cbmc_coverage):
            return CoverageFromCbmcJson(cbmc_coverage, srcdir)
        if filet.all_xml_files(cbmc_coverage):
            return CoverageFromCbmcXml(cbmc_coverage, srcdir)
        fail("Expected json files or xml files, not both: {}"
             .format(cbmc_coverage))

    fail("Expected --viewer-coverage or --srcdir and cbmc coverage results.")
def do_make_result(viewer_result, cbmc_result):
    """Implementation of make-result."""

    if viewer_result:
        if filet.all_json_files(viewer_result):
            return ResultFromJson(viewer_result)
        fail("Expected json files: {}".format(viewer_result))

    if cbmc_result:
        if filet.all_text_files(cbmc_result):
            return ResultFromCbmcText(cbmc_result)
        if filet.all_json_files(cbmc_result):
            return ResultFromCbmcJson(cbmc_result)
        if filet.all_xml_files(cbmc_result):
            return ResultFromCbmcXml(cbmc_result)
        fail("Expected text files json files or xml files, not both: {}"
             .format(cbmc_result))

    fail("Expected --viewer-result or cbmc property checking results.")
Exemple #4
0
def do_make_loop(viewer_loop, cbmc_loop, srcdir, goto):
    """The implementation of make-loop"""

    if viewer_loop:
        if filet.all_json_files(viewer_loop):
            return LoopFromJson(viewer_loop)
        fail("Expected json files: {}".format(viewer_loop))

    if cbmc_loop and srcdir:
        if filet.all_json_files(cbmc_loop):
            return LoopFromCbmcJson(cbmc_loop, srcdir)
        if filet.all_xml_files(cbmc_loop):
            return LoopFromCbmcXml(cbmc_loop, srcdir)
        fail(
            "Expected json files or xml files, not both: {}".format(cbmc_loop))

    if goto and srcdir:
        return LoopFromGoto(goto, srcdir)

    fail("Expected --make-loop, or --srcdir and --goto, "
         "or --srcdir and cbmc loop output.")
Exemple #5
0
def do_make_trace(viewer_trace, cbmc_trace, srcdir, wkdir):
    """Implementation of make-trace"""

    if viewer_trace:
        if filet.all_json_files(viewer_trace):
            return TraceFromJson(viewer_trace)
        fail("Expected json files: {}".format(viewer_trace))

    if cbmc_trace and srcdir:
        if filet.all_text_files(cbmc_trace):
            if wkdir:
                return TraceFromCbmcText(cbmc_trace, srcdir, wkdir)
            fail("Expected --srcdir, --wkdir, and cbmc trace output.")
        if filet.all_json_files(cbmc_trace):
            return TraceFromCbmcJson(cbmc_trace, srcdir)
        if filet.all_xml_files(cbmc_trace):
            return TraceFromCbmcXml(cbmc_trace, srcdir)
        fail("Expected json files or xml files, not both: {}".format(
            cbmc_trace))

    fail("Expected --make-trace or --srcdir, --wkdir, and "
         "cbmc trace output.")
Exemple #6
0
def do_make_reachable(viewer_reachable, cbmc_reachable, srcdir, goto):
    """The implementation of make-reachable."""

    if viewer_reachable:
        if filet.all_json_files(viewer_reachable):
            return ReachableFromJson(viewer_reachable)
        fail("Expected json files: {}".format(viewer_reachable))

    if cbmc_reachable and srcdir:
        if filet.all_json_files(cbmc_reachable):
            return ReachableFromCbmcJson(cbmc_reachable, srcdir)
        if filet.all_xml_files(cbmc_reachable):
            return ReachableFromCbmcXml(cbmc_reachable, srcdir)
        fail("Expected json files or xml files, not both: {}".format(
            cbmc_reachable))

    if goto and srcdir:
        return ReachableFromGoto(goto, srcdir)

    fail("Expected --viewer-reachable, "
         "or --srcdir and --goto, "
         "or --srcdir and cbmc reachable functions output.")