Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Commit

Permalink
--amend
Browse files Browse the repository at this point in the history
  • Loading branch information
christofsteel committed Jun 28, 2023
1 parent 44728ef commit 3462c3d
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 222 deletions.
6 changes: 2 additions & 4 deletions tests/benchmark_labyrinth.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
import timeit
from dataclasses import dataclass, field

from bcls import (
from cls import (
Type,
Constructor,
Product,
Omega,
Arrow,
Intersection,
BooleanTerm,
Var,
FiniteCombinatoryLogic,
enumerate_terms,
interpret_term,
Expand Down Expand Up @@ -117,7 +115,7 @@ def test():
start = timeit.default_timer()

# target: BooleanTerm[Type] = Var(pos(SIZE - 1, SIZE - 1)) & ~(Var(seen(1, 1)))
target: BooleanTerm[Type] = Var(pos(SIZE - 1, SIZE - 1))
target = pos(SIZE - 1, SIZE - 1)
# target: BooleanTerm[Type] = Var(seen(1, 1))

results = gamma.inhabit(target)
Expand Down
6 changes: 2 additions & 4 deletions tests/benchmark_labyrinth_single_movements.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
import itertools
import timeit

from bcls import (
from cls import (
Type,
Constructor,
Product,
Omega,
Arrow,
Intersection,
BooleanTerm,
Var,
FiniteCombinatoryLogic,
enumerate_terms,
interpret_term,
Expand Down Expand Up @@ -150,7 +148,7 @@ def test():
start = timeit.default_timer()

# target: BooleanTerm[Type] = Var(pos(SIZE - 1, SIZE - 1)) & ~(Var(seen(1, 1)))
target: BooleanTerm[Type] = Var(pos(SIZE - 1, SIZE - 1))
target = pos(SIZE - 1, SIZE - 1)

results = gamma.inhabit(target)
print("Time (Inhabitation): ", timeit.default_timer() - start)
Expand Down
140 changes: 0 additions & 140 deletions tests/boolean.py

This file was deleted.

7 changes: 3 additions & 4 deletions tests/example_1.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
from collections.abc import Callable
from bcls import (
from cls import (
Type,
Constructor,
Arrow,
Intersection,
Var,
FiniteCombinatoryLogic,
enumerate_terms,
Subtypes,
)
from bcls.enumeration import interpret_term
from cls.enumeration import interpret_term


def test() -> None:
Expand All @@ -32,7 +31,7 @@ def test() -> None:
environment: dict[str, set[str]] = dict()
subtypes = Subtypes(environment)

target = Var(a) & ~(Var(b) & Var(c))
target = Intersection(c, b)
# target = Var(b)

fcl = FiniteCombinatoryLogic(repository, subtypes)
Expand Down
48 changes: 0 additions & 48 deletions tests/example_CC.py

This file was deleted.

7 changes: 3 additions & 4 deletions tests/example_K.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
from collections.abc import Callable
from bcls import (
from cls import (
Type,
Constructor,
Arrow,
Intersection,
Var,
FiniteCombinatoryLogic,
enumerate_terms,
Subtypes,
)
from bcls.enumeration import interpret_term
from cls.enumeration import interpret_term


def test() -> None:
Expand Down Expand Up @@ -43,7 +42,7 @@ def MAP2(x, f):
environment: dict[str, set[str]] = dict()
subtypes = Subtypes(environment)

target = Var(c)
target = c
# target = Var(Arrow(b, c))

fcl = FiniteCombinatoryLogic(repository, subtypes)
Expand Down
7 changes: 1 addition & 6 deletions tests/example_intersection.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
from collections.abc import Callable
from bcls import (
from cls import (
Type,
Constructor,
Arrow,
Intersection,
Var,
FiniteCombinatoryLogic,
enumerate_terms,
Subtypes,
inhabit_and_interpret,
)
from bcls.enumeration import interpret_term


def test() -> None:
Expand Down
4 changes: 2 additions & 2 deletions tests/example_list.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from bcls import inhabit_and_interpret
from bcls.types import Arrow, Constructor
from cls import inhabit_and_interpret
from cls.types import Arrow, Constructor


def nil():
Expand Down
2 changes: 1 addition & 1 deletion tests/example_multiargs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
MultiArgsComponent) or default values (See DefaultArgComponent).
"""
from bcls import (
from cls import (
Constructor,
Arrow,
Intersection,
Expand Down
5 changes: 2 additions & 3 deletions tests/example_var_args.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from collections.abc import Callable
from bcls import Type, Constructor, Arrow, Intersection, Var, inhabit_and_interpret
from cls import Type, Constructor, Arrow, inhabit_and_interpret


def F(*x):
Expand All @@ -17,7 +16,7 @@ def test() -> None:

repository = dict({X: a, Y: b, F: Arrow(a, (Arrow(b, (Arrow(b, c)))))})

for real_result in inhabit_and_interpret(repository, Var(c)):
for real_result in inhabit_and_interpret(repository, c):
print(real_result)


Expand Down
2 changes: 1 addition & 1 deletion tests/set_cover.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from bcls.combinatorics import minimal_covers, maximal_elements
from cls.combinatorics import minimal_covers, maximal_elements
from itertools import combinations
from collections import deque
from random import randrange
Expand Down
2 changes: 1 addition & 1 deletion tests/types.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import unittest

from bcls import *
from cls import *

a = Constructor("a")
b = Constructor("b")
Expand Down
4 changes: 2 additions & 2 deletions tests/wrong_spec.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from collections.abc import Callable
from bcls import Type, Constructor, Arrow, Intersection, Var, inhabit_and_interpret
from cls import Type, Constructor, Arrow, Intersection, inhabit_and_interpret


def test() -> None:
Expand All @@ -20,7 +20,7 @@ def test() -> None:
}
)

for real_result in inhabit_and_interpret(repository, Var(b)):
for real_result in inhabit_and_interpret(repository, b):
print(real_result)


Expand Down
4 changes: 2 additions & 2 deletions tests/wrong_spec2.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from collections.abc import Callable
from bcls import Type, Constructor, Arrow, Intersection, Var, inhabit_and_interpret
from cls import Type, Constructor, Arrow, Intersection, inhabit_and_interpret


def test() -> None:
Expand All @@ -20,7 +20,7 @@ def test() -> None:
}
)

for real_result in inhabit_and_interpret(repository, Var(b)):
for real_result in inhabit_and_interpret(repository, b):
print(real_result)


Expand Down

0 comments on commit 3462c3d

Please sign in to comment.