Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce expressions and computed value variables #260

Commits on May 26, 2023

  1. First attempt at grammar

    WIP: Filling in parser
    
    WIP: Filled in all(?) parser functions
    
    expand * import
    
    Adapt to Variable/Pattern architecture
    
    Try to write a test; Exception: Assignment has no namedVariable
    
    Use $ for EvaluableVariables too
    
    Simplify grammar - Remove atom
    
    Add temporary test showing thing-type duality is not handled by the parser
    
    Fix grammar & add parser tests
    
    Add accessor for EvaluableConstriant.expression
    
    Refine EvaluableConstraint constants
    
    Add accessors for EvaluableExpression
    
    Introduce safe-casting methods for EvaluableVariable and EvaluableConstraint
    
    Expressions hold UnboundVariables; EvaluableConstraint inputs are ConceptVariables
    
    Fix EvaluableConstraint::variables
    
    Make the symbol field for OP enum accessible
    
    Remove comment
    
    Use '?' for Value variables.
    
    Introduce special syntax for value variables; Remove assignment in favour of overloading equality predicate
    
    Reintroduce assignment as easy mid-point
    
    Some more changes for re-introducing assign
    
    Temporarily disable expressions in valueconstraint; tests still fail
    
    Make predicate a common construct used by EvaluableVarables and ThingVariables
    
    1/2: Pull up UnboundVariable, Replace with UnboundDollarVariable class
    
    2/2 - Finish & unify predicates so ValueConstraints don't duplicate
    
    Add some more EvaluableExpression.Constant builder functions; Fix formatting
    
    Fix checkstyle
    
    Split Reference.Name into Name.NamedDollar and Name.NamedVal
    
    Fix another checkstyle
    
    1/2: Rename {Thing,Evaluable}Constraint.Value to Predicate
    
    2/2 Rename Evaluable -> Value
    
    Rename EvaluableExpression -> Expression
    
    Rename Predicate.Variable to Predicate.ThingVariable
    
    Resolve TODOs
    
    Replace NamedVal with NamedValue
    
    Small refactor of grammar
    
    Update equality check to '=='; assignment to '='
    
    Add static import for pattern.expression.Predicate in TypeQL.java
    
    Rename UnboundValueVariable.namedValue -> UnboundValueVariable.named; Static import in ParserTest
    
    Static import for pattern.expression.Predicate in ThingVariableBuilder
    
    Point typedb-behaviour to myfork
    
    Better usages to differentiate between UnboundDollar and UnboundValue
    
    Update Match query conjunction bound test to include value variables
    
    Improve Named variable methods in TypeQLInsert and TypeQL Delete
    
    Allow aggregation on value variables
    
    Extend ThingConstraint.has to return attribute identity variables
    
    Changes for sorting on value variable
    
    Rename grammar symbol from EVAR_ to VALVAR_; Fix formatting
    
    Rearrange new grammar rules
    
    Fix Formatting till and including pattern.constraint
    
    Remove Type Parameter for {Thing,Value}Constraint.Predicate
    
    Work through warnings
    
    Fix more warnings & formatting
    
    Rearrange grammar & parser
    
    Introduce modulo-remainder operator; Make POW right-associative; Rearrange grammar;
    
    Dissolve pattern.expression package - move predicate up, Expression into ValueConstraint
    
    Create ValueVariableBuilder interface; Make UnboundValueVariable implement that
    
    simplify a bit
    
     Simplify query/
    
    Refactor grammar a bit more
    
    Enable grouping on value variables in grammar
    
    Refactor grammar a little more
    
    Change only the grammar
    
    implement changes to parser
    
    Revert ThingVariable TypeVariable to not extend ConceptVariable
    
    Rename UnboundConceptVariable to UnboundThingTypeVariable
    
    Reflect renaming UnboundConceptVariable -> UnboundThingTypeVariable in grammar
    
    Unecessary cast in bound contains
    
    Remove ThingVariableBuilder.Root, before re-introducing it
    
    Rename ThingType to concept; Revert grammar to Concept and value
    
    Disable  ?y; Explicitly enable  has age ?a;
    
    Incorporate PR comments in grammar, TypeQLToken
    
    Incorporate changes to Parser, builder methods
    
    Incorporate more review comments
    
    Refactor Reference: Introduce Value class as sibling to Name; Use Variable.isNamed to check if Named or Value
    
    Incorporate more PR comments
    
    More comments incorporated
    
    Incorporate more PR feedback
    
    Simplify ThingConstraint.Has.variables()
    
    Some more comments
    
    Introduce ExpressionBuilder interface; Update builder methods to use them
    
    Add license to header in ExpressionBuilder
    
    Revert ConceptConstraint to the simpler signature
    
    Explicitly declare available functions in the grammar
    
    Add license header to ValueVariableBuilder
    
    Move PredicateBuilder implementation from ValueVariableBuilder to UnboundValueVariable
    
    Make the ParserTest for functions make more sense
    
    Incorporate comments
    
    Add ExpressionBuilder.plus, .minus, ...  methods
    
    Rename arglist to args
    
    Rename expression function rules
    
    reintroduce variable name APIs for modifiers & aggregatables; only to remove them again
    
    Remove string api for modifier_vars
    
    Spacing in grammar
    
    More spacing
    
    Rename modifier_vars to var_referable
    
    Rename var to cVar and valueVar to vVar
    
    Checkstyle
    
    Typo in grammar
    
    unary operators are no longer handled in lexer, allowing spaceless ?x = 5+2;
    
    Move var_referable rule to VAR_* tokens section
    
    replace var_referable with VAR_CONCEPT_ | VAR_VALUE_
    
    Align section separator endings (// ... ===) to 80 characters
    
    Align (VAR_CONCEPT_ | VAR_REFERABLE_ ) better
    
    Replace var_referable to VAR_CONCEPT_|VAR_VALUE_;Expand short rule names - expr*->expression* ; func -> function*
    
    Replace PAREN_OPEN/CLOSE in favour literal ( )
    
    Replace rogue replace expresses -> expressionesses
    
    Replace redundant Operation enum in AssignmentConstraint with TypeQLToken Operation
    
    Use Function Enum in ValueConstraint.Expression
    
    PR refactor: remove needless qualifications
    
    Collapse all expression non-terminals to a single rule
    
    Fix Expression.Constant.String.toString; Introduce TypeQLStep for exceptions containing
    
    Backward compatibility for '=' in ThingVariable predicates
    
    Update missing var -> cVar
    
    Update arithmetic parser tests to reflect new rule synatx
    
    Refactor Reference.Refereable into Reference.Name
    
    Move Concept and Value into Reference.Name
    
    Fix equality function
    krishnangovindraj authored and flyingsilverfin committed May 26, 2023
    Configuration menu
    Copy the full SHA
    d9ce296 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3092689 View commit details
    Browse the repository at this point in the history
  3. Ensure that variable names are unique

    Add parser test
    
    Fix recursion
    
    Test and fix variable name clash
    flyingsilverfin committed May 26, 2023
    Configuration menu
    Copy the full SHA
    b71deb9 View commit details
    Browse the repository at this point in the history
  4. WIP working on centralising Expressions, repeat for Predicates

    Simplifying expressions, rename bracket to parenthesis
    
    Predicate constraints extract variables and convert to bound
    flyingsilverfin committed May 26, 2023
    Configuration menu
    Copy the full SHA
    e012ed4 View commit details
    Browse the repository at this point in the history
  5. Fix import

    flyingsilverfin committed May 26, 2023
    Configuration menu
    Copy the full SHA
    b0fb81f View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    83d7459 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    411c3fa View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    afdd187 View commit details
    Browse the repository at this point in the history
  9. Cleanup

    flyingsilverfin committed May 26, 2023
    Configuration menu
    Copy the full SHA
    ac45176 View commit details
    Browse the repository at this point in the history
  10. Final cleanup

    flyingsilverfin committed May 26, 2023
    Configuration menu
    Copy the full SHA
    db52b37 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    b9697d5 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    82b2067 View commit details
    Browse the repository at this point in the history
  13. Update behaviour

    flyingsilverfin committed May 26, 2023
    Configuration menu
    Copy the full SHA
    1691194 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    dc18b73 View commit details
    Browse the repository at this point in the history