asdi 0.2.5

Another Simplistic Datalog Implementation (in Rust)
Documentation
@startuml

!include options.plantuml

interface asdi::AttributeName
hide "asdi::AttributeName" members

interface asdi::Labeled
hide "asdi::Labeled" members

interface asdi::MaybeAnonymous
hide "asdi::MaybeAnonymous" members

interface asdi::MaybePositive
hide "asdi::MaybePositive" members

interface asdi::edb::Constant
hide "asdi::edb::Constant" members

interface asdi::edb::PredicateRef
hide "asdi::edb::PredicateRef" members

namespace asdi::idb {
    interface MaybeGround

    class Atom
    class Comparison
    class Literal {
        negative: bool
    }
    class Rule
    class RuleSet
    class Variable

    enum ComparisonOperator {
        Equal
        NotEqual
        LessThan
        LessThanOrEqual
        GreaterThan
        GreaterThanOrEqual
    }
    enum LiteralInner {
        Relational : Atom
        Arithmetic : Comparison
    }
    enum RuleForm {
        Pure
        Constraint
        Disjunctive
    }
    enum Term {
        Anonymous
        Variable : VariableRef
        Constant : Constant
    }

    class VariableRef << (T,#ADD1B2) type >>

    Atom o-> "label" asdi::edb::PredicateRef
    Atom *-> "terms *" Term
    Atom ..|> asdi::Labeled
    Atom ..|> MaybeGround

    Comparison *-> "lhs" Term
    Comparison *-> "rhs" Term
    Comparison *-down-> ComparisonOperator
    Comparison ..|> MaybeGround

    Rule *-> "head *" Atom
    Rule *-> "body *" Literal
    Rule ..> RuleForm
    Rule ..|> MaybeGround
    Rule ..|> asdi::MaybePositive

    RuleSet *-> "*" Rule

    Literal *-> LiteralInner
    Literal ..|> MaybeGround
    Literal ..|> asdi::MaybePositive

    LiteralInner o-> Atom
    LiteralInner o-down-> Comparison
    LiteralInner ..|> MaybeGround

    Term o-> VariableRef
    Term o-> asdi::edb::Constant
    Term ..|> asdi::MaybeAnonymous

    VariableRef o--> Variable
    Variable ..|> asdi::AttributeName
}

@enduml