View lts_to_spot.py
from itertools import chain
from typing import Union
import spot
import buddy
from interfaces.automata import Label
from interfaces.lts import LTS
from synthesis.funcs_args_types_names import ARG_MODEL_STATE
View gen_edges_fun_smt.py
# the main function
def get_edges_as_smt(function_name:str, a1:str, a2:str, node_type:str, graph):
or_components = []
for s, d_list in graph.items():
for d in d_list:
or_components.append('(and (= {a1} {s}) (= {a2} {d}))'.format(a1=a1,a2=a2,s=node_type+str(s),d=node_type+str(d)))
or_smt = '(or %s)' % (' '.join(or_components))
return '(define-fun {function_name} (({a1} {node_type}) ({a2} {node_type})) Bool {body})'.format(
a1=a1, a2=a2, node_type=node_type, function_name=function_name, body=or_smt)
View parse_buddy.py
import spot
import buddy
from typing import Set
from helpers.str_utils import remove_from_str
from interfaces.automata import Label, LABEL_TRUE
from interfaces.expr import Signal
def parse_bdd(bdd:buddy.bdd, d:spot.bdd_dict) -> Set[Label]:
View bdd_to_smt.py
class Function(object):
def __init__(self, name, input_args, body):
self.body = body
self.input_args = input_args
self.name = name
def smt_call(self, val_by_arg=None):
args_ = ' '.join(val_by_arg[a] if val_by_arg else a
for a in self.input_args)
return '({name} {args})'.format(name=self.name, args=args_)
View shell.py
import subprocess
import sys
if sys.version_info < (3, 0):
# python2.7 version
def execute_shell(cmd, input=''):
"""
:param cmd:
:param input: sent to sdtin
View remove_pass_from_cert.sh
#!/bin/bash
# the source: http://serverfault.com/questions/515833/how-to-remove-private-key-password-from-pkcs12-container
if [ $# -ne 2 ]
then
echo "Usage: `basename $0` YourPKCSFile YourPKCSPassword"
exit $E_BADARGS
fi
View smt2.vim
" Vim syntax file
" Language: SMT-LIB
" Maintainer: Roberto Vigo
" Latest Revision: 23 Jan 2012
if exists("b:current_syntax")
finish
endif
" Keywords