-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into req-placements
- Loading branch information
Showing
28 changed files
with
80 additions
and
70,957 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
222 changes: 0 additions & 222 deletions
222
tilescopethree/strategies/verification_strategies/012_depth_4_database.txt
This file was deleted.
Oops, something went wrong.
444 changes: 0 additions & 444 deletions
444
tilescopethree/strategies/verification_strategies/012_depth_4_database_symmetry.txt
This file was deleted.
Oops, something went wrong.
684 changes: 0 additions & 684 deletions
684
tilescopethree/strategies/verification_strategies/012_depth_4_database_twisted.txt
This file was deleted.
Oops, something went wrong.
2,453 changes: 0 additions & 2,453 deletions
2,453
tilescopethree/strategies/verification_strategies/012_depth_5_database.txt
This file was deleted.
Oops, something went wrong.
4,906 changes: 0 additions & 4,906 deletions
4,906
tilescopethree/strategies/verification_strategies/012_depth_5_database_symmetry.txt
This file was deleted.
Oops, something went wrong.
9,326 changes: 0 additions & 9,326 deletions
9,326
tilescopethree/strategies/verification_strategies/012_depth_5_database_twisted.txt
This file was deleted.
Oops, something went wrong.
10,115 changes: 0 additions & 10,115 deletions
10,115
tilescopethree/strategies/verification_strategies/1302_depth_5_database.txt
This file was deleted.
Oops, something went wrong.
20,230 changes: 0 additions & 20,230 deletions
20,230
tilescopethree/strategies/verification_strategies/1302_depth_5_database_symmetry.txt
This file was deleted.
Oops, something went wrong.
20,230 changes: 0 additions & 20,230 deletions
20,230
tilescopethree/strategies/verification_strategies/1302_depth_5_database_twisted.txt
This file was deleted.
Oops, something went wrong.
7 changes: 2 additions & 5 deletions
7
tilescopethree/strategies/verification_strategies/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
from .database_verification import database_verified | ||
from .globally_verified import elementary_verified, globally_verified | ||
from .miner_verification import miner_verified | ||
from .subclass_verified import subclass_verified | ||
from .subset_verified import one_by_one_verification, subset_verified | ||
from .verify_points import verify_points | ||
from .verify_short_obs import verify_short_obstructions | ||
from .subset_verified import one_by_one_verified, subset_verified | ||
from .verify_atoms import verify_atoms |
142 changes: 0 additions & 142 deletions
142
tilescopethree/strategies/verification_strategies/create_twists.py
This file was deleted.
Oops, something went wrong.
26 changes: 2 additions & 24 deletions
26
tilescopethree/strategies/verification_strategies/database_verification.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,5 @@ | ||
"""A strategy for checking if a tiling is a subset of the class.""" | ||
import os | ||
from base64 import b64decode, b64encode | ||
|
||
from logzero import logger | ||
|
||
from comb_spec_searcher import VerificationRule | ||
from tilings import Tiling | ||
|
||
dir_path = os.path.dirname(os.path.realpath(__file__)) | ||
filenames = ["012_depth_5_database_twisted.txt"] | ||
database = set() | ||
from tilings.algorithms.enumeration import DatabaseEnumeration | ||
|
||
|
||
def database_verified(tiling, **kwargs): | ||
if not database and filenames: | ||
for filename in filenames: | ||
logger.info("Importing database from '{}'.".format(filename), | ||
extra=kwargs['logger']) | ||
f = open(dir_path + "/" + filename, 'r') | ||
for line in f.readlines(): | ||
compression = b64decode(line.encode()) | ||
dbtiling = Tiling.decompress(compression) | ||
database.add(dbtiling) | ||
f.close() | ||
if tiling in database: | ||
return VerificationRule("Already in database!") | ||
return DatabaseEnumeration(tiling).verification_rule() |
42 changes: 10 additions & 32 deletions
42
tilescopethree/strategies/verification_strategies/globally_verified.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,20 @@ | ||
from comb_spec_searcher import VerificationRule | ||
|
||
from .subset_verified import subset_verified | ||
from tilings.algorithms.enumeration import (ElementaryEnumeration, | ||
LocallyFactorableEnumeration) | ||
|
||
|
||
def globally_verified(tiling, **kwargs): | ||
"""The globally verified strategy. | ||
""" | ||
The globally verified strategy. | ||
A tiling is globally verified if every requirement and obstruction is | ||
non-interleaving. | ||
""" | ||
if not tiling.dimensions == (1, 1): | ||
if all(not ob.is_interleaving() for ob in tiling.obstructions): | ||
if (all(all(not r.is_interleaving() for r in req) | ||
for req in tiling.requirements) and | ||
not possible_tautology(tiling)): | ||
return VerificationRule(formal_step="Globally verified.") | ||
else: | ||
return subset_verified(tiling, **kwargs) | ||
|
||
|
||
def possible_tautology(tiling): | ||
"""Return True if possibly equivalent to a 1x1 tiling through empty cell | ||
inferral. (It just checks if two cells are non-empty - nothing exciting)""" | ||
if len(tiling.positive_cells) > 1: | ||
return False | ||
cells = set() | ||
maxlen = max(tiling.maximum_length_of_minimum_gridded_perm(), 1) + 1 | ||
for gp in tiling.gridded_perms(maxlen=maxlen): | ||
cells.update(gp.pos) | ||
if len(cells) > 1: | ||
return False | ||
return True | ||
return LocallyFactorableEnumeration(tiling).verification_rule() | ||
|
||
|
||
def elementary_verified(tiling, **kwargs): | ||
"""A tiling is elementary verified if it is globally verified and has no | ||
interleaving cells.""" | ||
if tiling.fully_isolated(): | ||
if tiling.dimensions == (1, 1): | ||
return subset_verified(tiling, **kwargs) | ||
return globally_verified(tiling, **kwargs) | ||
""" | ||
A tiling is elementary verified if it is globally verified and has no | ||
interleaving cells. | ||
""" | ||
return ElementaryEnumeration(tiling).verification_rule() |
74 changes: 0 additions & 74 deletions
74
tilescopethree/strategies/verification_strategies/miner_verification.py
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.