This commit is contained in:
Reid 'arrdem' McKenzie 2021-09-19 18:05:22 -06:00
commit 3bedbf7f05
28 changed files with 195 additions and 57 deletions
projects/datalog/src/python/datalog

View file

@ -8,9 +8,18 @@ Easy because it's closer to hand, but no simpler.
from typing import Sequence, Tuple
from datalog.evaluator import join as __join, select as __select
from datalog.evaluator import (
join as __join,
select as __select,
)
from datalog.reader import read as __read
from datalog.types import Constant, Dataset, LTuple, LVar, PartlyIndexedDataset
from datalog.types import (
Constant,
Dataset,
LTuple,
LVar,
PartlyIndexedDataset,
)
def read(text: str, db_cls=PartlyIndexedDataset):

View file

@ -4,7 +4,13 @@ A datalog engine.
from functools import reduce
from datalog.types import CachedDataset, Constant, Dataset, LVar, TableIndexedDataset
from datalog.types import (
CachedDataset,
Constant,
Dataset,
LVar,
TableIndexedDataset,
)
def match(tuple, expr, bindings=None):

View file

@ -4,8 +4,17 @@ A datalog reader.
from collections import defaultdict
from datalog.parser import FAILURE, Grammar, ParseError
from datalog.types import Constant, Dataset, LVar, Rule
from datalog.parser import (
FAILURE,
Grammar,
ParseError,
)
from datalog.types import (
Constant,
Dataset,
LVar,
Rule,
)
class Actions(object):