Beispiel #1
0
def test_series_sll_and_bt() -> None:
    graphs = list(map(lambda f: MemoryGraph.fromFile(f), [
        f'{EXAMPLES_PROLOG}/series-sll-and-bt/sll-and-bt-0.pl',
        f'{EXAMPLES_PROLOG}/series-sll-and-bt/sll-and-bt-1.pl',
        f'{EXAMPLES_PROLOG}/series-sll-and-bt/sll-and-bt-2.pl'
    ]))
    composition.composition(graphs)
Beispiel #2
0
def test_series_bt() -> None:
    graphs = list(map(lambda f: MemoryGraph.fromFile(f), [
        f'{EXAMPLES_PROLOG}/series-bt/bt-null-1.pl',
        f'{EXAMPLES_PROLOG}/series-bt/bt-null-2.pl',
        f'{EXAMPLES_PROLOG}/series-bt/bt-null-3.pl',
    ]))
    learn.learn(graphs)
Beispiel #3
0
def test_series_bt() -> None:
    graphs = list(
        map(lambda f: MemoryGraph.fromFile(f), [
            f'{EXAMPLES_PROLOG}/series-bt/bt-null-1.pl',
            f'{EXAMPLES_PROLOG}/series-bt/bt-null-2.pl',
            f'{EXAMPLES_PROLOG}/series-bt/bt-null-3.pl',
        ]))
    predicate = match.match_repository(graphs)
    verifast.check_witness(verifast.construct_witness(predicate, graphs))
Beispiel #4
0
def test_wrapper_sll_bt() -> None:
    graphs = list(map(lambda f: MemoryGraph.fromFile(f), [
        f'{EXAMPLES_PROLOG}/wrapper-sll-bt.pl'
    ]))
    composition.composition(graphs)
Beispiel #5
0
def test_fromPLFile():
    for file_ in glob(f'{FOLDER_EXAMPLES}/*.pl'):
        MemoryGraph.fromPLFile(file_)
Beispiel #6
0
def test_dll_stable_this() -> None:
    graphs = list(
        map(lambda f: MemoryGraph.fromFile(f),
            [f'{EXAMPLES_PROLOG}/dll-stable-this.pl']))
    predicate = match.match_repository(graphs)
    verifast.check_witness(verifast.construct_witness(predicate, graphs))
Beispiel #7
0
def test_bt_null() -> None:
    graphs = list(map(lambda f: MemoryGraph.fromFile(f), [
        f'{EXAMPLES_PROLOG}/bt-null.pl'
    ]))
    learn.learn(graphs)
Beispiel #8
0
def examples_prolog(example: str) -> str:
    fname = f'{EXAMPLES_PROLOG}/{example}'
    return MemoryGraph.fromPLFile(fname)
Beispiel #9
0
def test_dll_stable_this() -> None:
    graphs = list(map(lambda f: MemoryGraph.fromFile(f), [
        f'{EXAMPLES_PROLOG}/dll-stable-this.pl'
    ]))
    learn.learn(graphs)
Beispiel #10
0
def test_sll_tailptr() -> None:
    graphs = list(map(lambda f: MemoryGraph.fromFile(f), [
        f'{EXAMPLES_PROLOG}/sll-tailPtr.pl'
    ]))
    learn.learn(graphs)
Beispiel #11
0
def test_bt_root_ptr() -> None:
    graphs = list(map(lambda f: MemoryGraph.fromFile(f), [
        f'{EXAMPLES_PROLOG}/bt-root-ptr.pl'
    ]))
    learn.learn(graphs)
Beispiel #12
0
def test_binary_trees_debian() -> None:
    graphs = list(map(lambda f: MemoryGraph.fromFile(f), [
        f'{EXAMPLES_DSI}/binary-trees-debian.dot'
    ]))
    learn.learn(graphs)
Beispiel #13
0
def test_sll_9() -> None:
    graphs = list(map(lambda f: MemoryGraph.fromFile(f), [
        f'{EXAMPLES_DSI}/sll_9.dot'
    ]))
    learn.learn(graphs)
Beispiel #14
0
def test_nesting_bt_sll() -> None:
    graphs = list(map(lambda f: MemoryGraph.fromFile(f), [
        f'{EXAMPLES_PROLOG}/nesting-bt-sll.pl'
    ]))
    composition.composition(graphs)
Beispiel #15
0
def test_dll_stable_null_inner_ep() -> None:
    graphs = list(
        map(lambda f: MemoryGraph.fromFile(f),
            [f'{EXAMPLES_PROLOG}/dll-stable-null-inner-ep.pl']))
    match.match_repository(graphs)
Beispiel #16
0
def test_SHN_sll_sll() -> None:
    graphs = list(map(lambda f: MemoryGraph.fromFile(f), [
        f'{EXAMPLES_PROLOG}/SHN-sll-sll.pl'
    ]))
    composition.composition(graphs)
Beispiel #17
0
def test_sll_head_tail() -> None:
    graphs = list(
        map(lambda f: MemoryGraph.fromFile(f), [f'{EXAMPLES_PROLOG}/lseg.pl']))
    match.match_repository(graphs)
Beispiel #18
0
def examples_dsi(example: str) -> str:
    fname = f'{EXAMPLES_DSI}/{example}'
    return MemoryGraph.fromDOTFile(fname)
Beispiel #19
0
def test_dll_stable_this() -> None:
    graphs = list(
        map(lambda f: MemoryGraph.fromFile(f),
            [f'{EXAMPLES_PROLOG}/dll-stable-this.pl']))
    match.match_repository(graphs)
Beispiel #20
0
def test_bt_null_all() -> None:
    graphs = list(
        map(lambda f: MemoryGraph.fromFile(f),
            [f'{EXAMPLES_PROLOG}/bt-null-all.pl']))
    predicate = match.match_repository(graphs)
    verifast.check_witness(verifast.construct_witness(predicate, graphs))
Beispiel #21
0
def test_sll_tailptr() -> None:
    graphs = list(
        map(lambda f: MemoryGraph.fromFile(f),
            [f'{EXAMPLES_PROLOG}/sll-tailPtr.pl']))
    match.match_repository(graphs)
Beispiel #22
0
def test_sll_headptr() -> None:
    graphs = list(
        map(lambda f: MemoryGraph.fromFile(f),
            [f'{EXAMPLES_PROLOG}/sll-headPtr.pl']))
    predicate = match.match_repository(graphs)
    verifast.check_witness(verifast.construct_witness(predicate, graphs))
Beispiel #23
0
def test_bt_null() -> None:
    graphs = list(
        map(lambda f: MemoryGraph.fromFile(f),
            [f'{EXAMPLES_PROLOG}/bt-null.pl']))
    match.match_repository(graphs)
Beispiel #24
0
def test_constructDot():
    for file_ in glob(f'{FOLDER_EXAMPLES}/*.json'):
        MemoryGraph.fromJSONFile(file_).constructDot()
Beispiel #25
0
def test_sll_head_tail() -> None:
    graphs = list(map(lambda f: MemoryGraph.fromFile(f), [
        f'{EXAMPLES_PROLOG}/lseg.pl'
    ]))
    learn.learn(graphs)