Very fast and flexible string searching using a DAG (Directed Acyclic Graph)
dtree is a powerful C++ header-only library that enables very fast and flexible searching of strings based on multiple criteria using a directed acyclic graph (DAG) structure. It combines interval arithmetic with three-valued logic to provide sophisticated query capabilities.
Utilizes directed acyclic graphs for efficient and flexible string searching across multiple criteria.
Advanced interval arithmetic with support for projective infinity and three-valued comparison logic.
Build and evaluate complex expression trees with support for arithmetic and logical operators.
Implements Kleene logic (True/False/Maybe) for sophisticated query predicates.
Toy SQL parser that translates simple SQL queries into native dtree queries.
Custom string and number types that maintain memcmp ordering for optimal performance.
A string type similar to std::string_view that can contain any std::string while maintaining memcmp ordering.
Can also contain out-of-band separator tokens.
Contains values from arithmetic types or decimal float, stored with memcmp ordering. Supports range E−6176 to E+6144 (IEEE decimal128 range).
Three-valued logic implementation: True/False/Maybe. Based on Kleene logic.
Interval arithmetic with trinary logic comparisons. Intervals may contain the projective infinity, allowing sensible division by intervals containing zero.
Expression trees supporting arithmetic and logical operators. Parse strings into expression trees and evaluate them with interval arithmetic.
Database abstraction using interval arithmetic and trinary logic to query data with expression predicates.
sudo apt-get update
sudo apt install clang
sudo apt install make
# Install Boost 1.70+
wget -c 'http://sourceforge.net/projects/boost/files/boost/1.70.0/boost_1_70_0.tar.bz2'
bunzip2 boost_1_70_0.tar.bz2
tar -xvof boost_1_70_0.tar
cd boost_1_70_0/
./bootstrap.sh --with-toolset=clang
./b2 headers
sudo ./b2 install
# Clone the repository
git clone https://github.com/questrel/dtree.git
cd dtree
make
# Build the Docker image
sudo docker build --tag dtree:0.1 .
# Run the container
sudo docker run -it dtree:0.1
# Inside the container, run tests
bash test.bash
dtree is a header-only library. To use it, include the appropriate header in your C++ code:
#define TEST_H "qtl/module.h"
#include TEST_H
# Make all test executables
make
# Build with debug diagnostics
make CXX='clang++ -DDEBUG'
# Run fuzz testing
make module.fuzz.out
AFL_NO_ARITH=1 AFL_EXIT_WHEN_DONE=1 /usr/local/bin/afl/afl-fuzz \
-i- -x fuzz/module.dict -o fuzz/module.out -- ./module.fuzz.out
After running bash test.bash, you can test queries:
SELECT ASCII_word, NUMERIC_TO_STRING(letter_product,letter_sum)
FROM word
WHERE letter_product*letter_sum<=letter_product+letter_sum
# Output: "A"_s,"1, 1"_s,
# Test basic query
SELECT * FROM word
For detailed information about the concepts and architecture:
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
All contributors are expected to abide by the code of conduct.