# Path: delphin/semi.py
# TOP_TYPE = '*top*'
# STRING_TYPE = 'string'
# _SEMI_SECTIONS = (
#     'variables',
#     'properties',
#     'roles',
#     'predicates',
# )
# class SemIError(PyDelphinException):
# class SemISyntaxError(PyDelphinSyntaxError):
# class SemIWarning(PyDelphinWarning):
# class SynopsisRole(tuple):
# class Synopsis(tuple):
# class SemI(object):
# def load(source, encoding='utf-8'):
# def _read_file(path, basedir, encoding):
# def _incorporate(d, key, val, path):
#     def __new__(cls, name, value, properties=None, optional=False):
#     def __repr__(self):
#     def _to_dict(self):
#     def _from_dict(cls, d):
#     def __repr__(self):
#     def from_dict(cls, d):
#     def to_dict(self):
#     def subsumes(self, args, variables=None):
#     def __init__(self,
#                  variables=None,
#                  properties=None,
#                  roles=None,
#                  predicates=None):
#     def _init_properties(self, properties):
#     def _init_variables(self, variables):
#     def _init_roles(self, roles):
#     def _init_predicates(self, predicates):
#     def _init_synopsis(self, pred, synopsis_data, propcache):
#     def from_dict(cls, d):
#     def to_dict(self):
#         def add_parents(d, ps):
#     def find_synopsis(self, predicate, args=None):
# def _new_hierarchy():


import pytest
from delphin import semi
    from delphin import hierarchy
    assert len(s.variables) == 6
    assert len(s.properties) == 2
    assert len(s.roles) == 5
    assert 'abstract_q' in s.predicates
    assert 'existential_q' in s.predicates
    assert 'can_able' in s.predicates
    assert '_able_a_1' in s.predicates
    assert 'can_able' in s.predicates.parents('_able_a_1')
    assert len(s.predicates['_able_a_1']) == 2
    # redefinition
    a.write_text(
            'variables:\n'
            '  i.\n'
            'include: b.smi\n')
    b.write_text(
            'variables:\n'
            '  i.\n')
    with pytest.warns(semi.SemIWarning):
        semi.load(str(a))


def test_comments(tmp_path):
    p = tmp_path / 'a.smi'
    p.write_text(
            '; comment\n'
            'variables:\n'
            '  ; comment\n'
            '  u.\n'
            '  ; x < u.\n'
            '  i < u.\n'

# Path: delphin/semi.py
# TOP_TYPE = '*top*'
# STRING_TYPE = 'string'
# _SEMI_SECTIONS = (
#     'variables',
#     'properties',
#     'roles',
#     'predicates',
# )
# class SemIError(PyDelphinException):
# class SemISyntaxError(PyDelphinSyntaxError):
# class SemIWarning(PyDelphinWarning):
# class SynopsisRole(tuple):
# class Synopsis(tuple):
# class SemI(object):
# def load(source, encoding='utf-8'):
# def _read_file(path, basedir, encoding):
# def _incorporate(d, key, val, path):
#     def __new__(cls, name, value, properties=None, optional=False):
#     def __repr__(self):
#     def _to_dict(self):
#     def _from_dict(cls, d):
#     def __repr__(self):
#     def from_dict(cls, d):
#     def to_dict(self):
#     def subsumes(self, args, variables=None):
#     def __init__(self,
#                  variables=None,
#                  properties=None,
#                  roles=None,
#                  predicates=None):
#     def _init_properties(self, properties):
#     def _init_variables(self, variables):
#     def _init_roles(self, roles):
#     def _init_predicates(self, predicates):
#     def _init_synopsis(self, pred, synopsis_data, propcache):
#     def from_dict(cls, d):
#     def to_dict(self):
#         def add_parents(d, ps):
#     def find_synopsis(self, predicate, args=None):
# def _new_hierarchy():


# Path: tests/semi_test.py
import pytest
from delphin import semi
    from delphin import hierarchy

    assert len(s.variables) == 6
    assert len(s.properties) == 2
    assert len(s.roles) == 5
    assert 'abstract_q' in s.predicates
    assert 'existential_q' in s.predicates
    assert 'can_able' in s.predicates
    assert '_able_a_1' in s.predicates
    assert 'can_able' in s.predicates.parents('_able_a_1')
    assert len(s.predicates['_able_a_1']) == 2
    # redefinition
    a.write_text(
            'variables:\n'
            '  i.\n'
            'include: b.smi\n')
    b.write_text(
            'variables:\n'
            '  i.\n')
    with pytest.warns(semi.SemIWarning):
        semi.load(str(a))


def test_comments(tmp_path):
    p = tmp_path / 'a.smi'
    p.write_text(
            '; comment\n'
            'variables:\n'
            '  ; comment\n'
            '  u.\n'
            '  ; x < u.\n'
            '  i < u.\n'

            '  e < i.\n')