Beispiel #1
0
        rv = RunCode.SUCCESS

        # parameter order matters! k must come first
        # use --verbose for verbose printing
        params = [self.tool_path, "-k", "0", self.model_path, "--verbose", "--visualize"]

        print "Calling dreach with params:", params

        if not run_check_stderr(params):
            rv = RunCode.ERROR

        return rv

    def _copy_model(self, temp_folder):
        '''copy the model to the temp folder and sets self.model_path
        overriden to ensure .drh extension
        '''
        model_name = os.path.basename(self.original_model_path)

        if not model_name.endswith(".drh"):
            model_name += ".drh"

        self.model_path = os.path.join(temp_folder, model_name)
        shutil.copyfile(self.original_model_path, self.model_path)

if __name__ == "__main__":
    print "Starting dReach. If you kill the tool early, be sure to kill any spawned " \
      "subprocesses ('killall dReal')."

    tool_main(DReachTool())
Beispiel #2
0
            if proc.returncode != 0:
                print "Error Running HyCreate (java return code was " + str(proc.returncode) + ")"

                if proc.returncode == 1:
                    print "Did you assign HYCREATE_BIN?"

                rv = RunCode.ERROR
        except OSError as e:
            print "Exception while trying to run HyCreate2: " + str(e)
            rv = RunCode.ERROR

        return rv

    def _make_image(self):
        """makes the image after the tool runs, returns True on success"""
        rv = True

        from_path = "result/reachability.png"
        to_path = self.image_path

        try:
            shutil.copyfile(from_path, to_path)
        except IOError:
            rv = False

        return rv


if __name__ == "__main__":
    tool_main(HyCreateTool())
Beispiel #3
0
        cur_mode = None

        for (line, _) in self.output_obj['lines']:
            if next_mode_string in line or end_string in line:
                if cur_mode is not None:
                    mode_times.append((cur_mode, step_total))

                cur_mode = None
                step_total = 0.0
            else:
                # not a jump, check if it's a step statement
                res = step_regexp.match(line)

                if res is not None:
                    (cur_mode, time) = res.groups()
                    step_total += float(time)
                else:
                    # try to match step without mode name
                    res = step_nomode_regexp.match(line)

                    if res is not None:
                        time = res.group(1)
                        cur_mode = ""
                        step_total += float(time)

        self.output_obj['mode_times'] = mode_times


if __name__ == "__main__":
    tool_main(FlowstarTool())
Beispiel #4
0
        cur_mode = None
        
        for (line, _) in self.output_obj['lines']:
            if next_mode_string in line or end_string in line:
                if cur_mode is not None:
                    mode_times.append((cur_mode, step_total))

                cur_mode = None
                step_total = 0.0
            else:
                # not a jump, check if it's a step statement
                res = step_regexp.match(line)

                if res is not None:
                    (cur_mode, time) = res.groups()
                    step_total += float(time)
                else:
                    # try to match step without mode name
                    res = step_nomode_regexp.match(line)

                    if res is not None:
                        time = res.group(1)
                        cur_mode = ""
                        step_total += float(time)
        
        self.output_obj['mode_times'] = mode_times
                
if __name__ == "__main__":
    tool_main(FlowstarTool())

Beispiel #5
0
def _main():
    '''main func for running SpaceEx'''

    extra_args = [('-cfg', 'cfg file')]
    tool_main(SpaceExTool(), extra_args)
Beispiel #6
0
def _main():
    '''main func for running SpaceEx'''
    
    extra_args = [('-cfg', 'cfg file')]
    tool_main(SpaceExTool(), extra_args)
Beispiel #7
0
            proc.wait()

            if proc.returncode != 0:
                print "Error Running HyCreate (java return code was " + str(
                    proc.returncode) + ")"
                print "Did you assign HYCREATE_BIN?"
                rv = RunCode.ERROR
        except OSError as e:
            print "Exception while trying to run HyCreate2: " + str(e)
            rv = RunCode.ERROR

        return rv

    def _make_image(self):
        '''makes the image after the tool runs, returns True on success'''
        rv = True

        from_path = "result/reachability.png"
        to_path = self.image_path

        try:
            shutil.copyfile(from_path, to_path)
        except IOError:
            rv = False

        return rv


if __name__ == "__main__":
    tool_main(HyCreateTool())