import re


def get_variables(fname):
    """
    Infer variables from SMT formula.
    Args:
        fname (str): file name of SMT formula
    Returns:
        list: variables
    """

    formula = open(fname, 'r').read()
    variables = []

    for dtype in ['String', 'Int']:
        pattern = 'declare-const ([A-Za-z0-9\.]+) {}'.format(dtype)
        variables += re.findall(pattern, formula)

    return variables