# Path: delphin/scope.py
# LEQ = 'leq'              # label equality (label-to-label)
# LHEQ = 'lheq'            # label-handle equality (hole-to-label)
# OUTSCOPES = 'outscopes'  # directly or indirectly takes scope over
# QEQ = 'qeq'              # equality modulo quantifiers (hole-to-label)
# _UNTENSED_VALUES = {
#     '',
#     'untensed',
# }
# class ScopeError(PyDelphinException):
# class ScopingSemanticStructure(SemanticStructure):
#     def __init__(self,
#                  top: Optional[Identifier],
#                  index: Optional[Identifier],
#                  predications: Predications,
#                  lnk: Optional[Lnk],
#                  surface,
#                  identifier):
#     def scopal_arguments(self, scopes=None) -> ScopalArgumentStructure:
#     def scopes(self) -> Tuple[ScopeLabel, ScopeMap]:
# def conjoin(scopes: ScopeMap, leqs: ScopeEqualities) -> ScopeMap:
# def descendants(x: ScopingSemanticStructure,
#                 scopes: ScopeMap = None) -> DescendantMap:
# def _descendants(descs: Dict[Identifier, List[Predication]],
#                  id: Identifier,
#                  scargs: ScopalArgumentStructure,
#                  scopes: ScopeMap) -> None:
# def representatives(x: ScopingSemanticStructure, priority=None) -> ScopeMap:
# def _make_representative_priority(x: ScopingSemanticStructure):
#     def representative_priority(p: Predication):


from delphin import scope



def test_conjoin():
    assert scope.conjoin(
        {'h0': [], 'h1': ['e2']}, []) == {'h0': [], 'h1': ['e2']}
    conj = scope.conjoin({'h0': [], 'h1': ['e2']}, [('h0', 'h1')])
    assert len(conj) == 1 and list(conj.values()) == [['e2']]

# Path: delphin/scope.py
# LEQ = 'leq'              # label equality (label-to-label)
# LHEQ = 'lheq'            # label-handle equality (hole-to-label)
# OUTSCOPES = 'outscopes'  # directly or indirectly takes scope over
# QEQ = 'qeq'              # equality modulo quantifiers (hole-to-label)
# _UNTENSED_VALUES = {
#     '',
#     'untensed',
# }
# class ScopeError(PyDelphinException):
# class ScopingSemanticStructure(SemanticStructure):
#     def __init__(self,
#                  top: Optional[Identifier],
#                  index: Optional[Identifier],
#                  predications: Predications,
#                  lnk: Optional[Lnk],
#                  surface,
#                  identifier):
#     def scopal_arguments(self, scopes=None) -> ScopalArgumentStructure:
#     def scopes(self) -> Tuple[ScopeLabel, ScopeMap]:
# def conjoin(scopes: ScopeMap, leqs: ScopeEqualities) -> ScopeMap:
# def descendants(x: ScopingSemanticStructure,
#                 scopes: ScopeMap = None) -> DescendantMap:
# def _descendants(descs: Dict[Identifier, List[Predication]],
#                  id: Identifier,
#                  scargs: ScopalArgumentStructure,
#                  scopes: ScopeMap) -> None:
# def representatives(x: ScopingSemanticStructure, priority=None) -> ScopeMap:
# def _make_representative_priority(x: ScopingSemanticStructure):
#     def representative_priority(p: Predication):


# Path: tests/scope_test.py
from delphin import scope




def test_conjoin():
    assert scope.conjoin(
        {'h0': [], 'h1': ['e2']}, []) == {'h0': [], 'h1': ['e2']}
    conj = scope.conjoin({'h0': [], 'h1': ['e2']}, [('h0', 'h1')])
    assert len(conj) == 1 and list(conj.values()) == [['e2']]

    conj = scope.conjoin({'h0': [], 'h1': ['e2'], 'h2': ['x4'], 'h3': ['q5']},