示例#1
0
文件: test_core.py 项目: jaberg/logpy
def test_lany():
    x = var("x")
    assert len(tuple(lany(eq(x, 2), eq(x, 3))({}))) == 2
    assert len(tuple(lany((eq, x, 2), (eq, x, 3))({}))) == 2
示例#2
0
文件: test_core.py 项目: jaberg/logpy
def test_lany_is_early_safe():
    x = var()
    y = var()
    assert run(0, x, lany((membero, x, y), (eq, x, 2))) == (2,)
示例#3
0
def test_lany():
    x = var('x')
    assert len(tuple(lany(eq(x, 2), eq(x, 3))({}))) == 2
    assert len(tuple(lany((eq, x, 2), (eq, x, 3))({}))) == 2
示例#4
0
def test_lany_is_early_safe():
    x = var()
    y = var()
    assert run(0, x, lany((membero, x, y), (eq, x, 2))) == (2, )
示例#5
0
文件: arith.py 项目: cherry-wb/logpy
 def goal(*args):
     return lany(*[gc(*args) for gc in goalconsts])
示例#6
0
 def goal(*args):
     return lany(*[gc(*args) for gc in goalconsts])