Git Product home page Git Product logo

fontoxpath's People

Contributors

abbasi-waqas avatar bwrrp avatar code-factor avatar crodriguezq avatar dependabot[bot] avatar devatwork avatar drrataplan avatar evandervalk avatar fbroy avatar greenkeeper[bot] avatar hectorpeeters avatar hubgit avatar jarivm avatar jcentrena avatar josverburg avatar koltharius avatar luisgallego-fonto avatar maanpalle avatar martinn1996 avatar mehmetscoskun avatar mtesseracttech avatar mtimmerije avatar mvanbutselaar avatar rrthomas avatar thomasbrekelmans avatar thomasgravekamp avatar wvbe avatar ymor avatar yuanzexiong avatar

Stargazers

 avatar  avatar

fontoxpath's Issues

Assignment 7: Progress Presentation (group)

In TW Session 3 you give a presentation as a group in which you show your TW lecturer the progress you have made for the report so far. Please use the skills you have learnt in the Oral Presentations course part of Software Engineering Methods, Q2 (or part of OOP Project).

Upload the slides for this presentation.

  • As a group, give a presentation about the progress of the report. Use slides.
  • Use the TU Write modules about ToC, Introduction, Chapters, Paragraphs, Visualisation, References etc.
  • 12 minutes presentation, 8 minutes questions/discussion (each group member will present a few minutes).
    • Give three examples where you used literature references.
    • Show your old ToC and the improved ToC. What have you changed after the feedback?
    • Show what is in your Introduction.
    • Give three examples of paragraphs with a clear topic sentences.
    • Give three example of how you have thought about readers with little time. We are all busy: how can you make it easy for readers to find information quickly?
    • Give one example of how you have used visuals in your report.

VarRef Type Annotation

Description

Create annotations for VarRef expressions and integrate them into the AST
These are currently locked behind some changes to the static context and the scoping

Sub-tasks

  • Implement Type Annotation for the VarRef expression
  • Integrate them into the AST
  • Create Tests to make sure coverage does not drop

Speedup Subtype Check

Description

The isSubtypeOf check is currently a recursive function that's not the fastest. This can be sped up a bit (making it O(1)) by taking the current types, calling isSubtypeOf over all pairs of types and adding the true pairs into a set. This set could then be checked against with O(1) complexity.

Potentially this set can be cached to reduce overhead on application start, as the set should be a relatively small subset of all type combinations and the set creation is O(n^2)

This task is quite low priority and should only be implemented when we have time after implementing the rest, as it's nicely separated (it only requires changes within the isSubtypeOf function) and not fundamental for our project.

Sub-tasks

  • Create a set that contains all type tuples (a,b) for which isSubtypeOf returns true.
  • Replace the original isSubtypeOf function with a query on this set.
  • (Optional) Caching the set to the disk, to avoid the intial set creation.
  • Benchmarking to see if there is a noticeable performance improvement.

Failing XML tests

Description

Since the structure of the IAST has been changed, tests that assert the intermediate AST will fail. This can be fixed by either changing the test assertions, or by not executing the type inference step when running these tests.

Sub-tasks

  • Add a flag to to parseExpression which determines if the AST should be annotated
  • Propagate this change through the rest of the codebase
  • Make the tests which assert the AST structure not use type-inference

Cleanup raw array accesses in annotateAst

Description

The earlier expressions still use raw array accessing instead of functions from astHelper.ts.

Sub-tasks

  • Replace all array accesses with astHelper calls

Annotation Cast Operator and Castable Operator

Description

Cast operators need to be converted in roughly the same style as the binary operator.

Sub-tasks

  • Lookup the casts
  • Copy the ruleset of each cast
  • Paste them in annotation
  • Tests (for new behaviour)

Add Tests to Newly Created Code

Description

At the moment with each new commit our overall coverage goes down. To bring it up again we should add some extra testing to make sure code paths that are not covered yet end up getting covered.

Sub-tasks

  • Create tests for newly written code (primarily from #58)
  • Check if they actually improve coverage

Definition of Done

Coverage percentage should be 96% or higher.

Split ruleMap of binary operator in 2

Description

The ruleMap for binaryOperator is at the moment a map to retrieve both the type and function. This should be split up in 2 different maps.

Sub-tasks

  • Split up the ruleMap

Implement Missing Annotations

Description

Some annotations are still missing, which at the moment we assume to be undefined, while they should be item()*.
These should therefore be implemented and the reliant classes should keep this type in mind properly.

Sub-tasks

  • Add the item()* annotation to the untyped stuff.
  • Change reliant classes to adapt to this change.

Attach binop function to AST

Description

Some binary operators need a special function to get evaluated. This will need to get attached to the AST.

Sub-tasks

  • Make binop use a special function
  • Make annotateAst attach the function to the ast

Fix Bundlemon

Description

Bundlemon is complaining since it's not setup properly. With the correct configuration, this can be fixed.

Integrate Type Inference into Binary Operator

Issue

Description

We have to integrate the type inference into the binary operator. This is done by taking out the type checks from the binaryoperator class and moving them to a separate function that embeds the types directly into the AST.

Sub-tasks

  • Modify the AST after parsing with type annotations.
  • (Re)move type checking logic from the BinaryOperator class
  • Make sure tests still run

Speed up Expression Evaluation

Description

Now that we have the additional type information, we should use this to make sure all expressions have an early return if the type data is known. This will drastically speed up the whole execution.

Subtasks

  • Identifying all early returns/shortcuts that can be based on static typing.
  • Implementing these shortcuts.

Nodes

  • Binop
  • Unop
  • ...

Convert annotateAst to visitor pattern

Description

Right now, the AST gets traversed manually using recursive switch statements and this happens multiple times throughout the codebase, it would probably be cleaner if we make a single AstVisitor class which can be used in both annotateAst and compileAstToExpression.

Sub-tasks

  • Construct an AstVisitor class
  • Convert annotateAst to use this class
  • Potentially also convert compileAstToExpression

Make annotateAst recursive

Description

If we encounter an AST node which isn't supported while annotating, we don't descend down that branch. Due to this problem, some nodes which we can annotate don't get annotated.

Sub-tasks

  • Make sure all supported AST nodes get annotated

Change add-op to common module

Description

Change the addOpannotation method to be a common module that can be used by other operators.

Sub-tasks

  • rename method
  • add new addopannotation method

Changing the Type Annotations to an Attribute

Description

The type annotations are now directly inserted into the AST as a separate XML node, however, they should ideally be attributes.

Sub-tasks

  • Changing the annotation code to insert the type annotations as attributes.
  • Changing the code that reads them out to also read the attributes.

Move Binary Type Checks to Annotations

Description

The type checking of the binary operators should be moved to the annotation phase, so that in most cases this does not need to happen during runtime.
In case no type could be inferred, dynamic type checking should be used as a fallback, so the original type checking code should not be removed completely.

Sub-tasks

Addition (a+b)

  • Move type checks to annotion step.
  • Make sure that corresponding tests pass.

Subtraction (a-b)

  • Move type checks to annotion step.
  • Make sure that corresponding tests pass.

Multiplication (a*b)

  • Move type checks to annotion step.
  • Make sure that corresponding tests pass.

Division (a/b)

  • Move type checks to annotion step.
  • Make sure that corresponding tests pass.

Integer division (a idiv b)

  • Move type checks to annotion step.
  • Make sure that corresponding tests pass.

Modulus (a % b)

  • Move type checks to annotion step.
  • Make sure that corresponding tests pass.

General:

  • Insert early return path to binaryOperators file if type inference was successful.

Create/Fix Built in Function Call Annotation

Description

Built in Functions are not getting annotated, that needs to be fixed.

Sub-tasks

  • Make sure function calls get annotated appropriately.
  • Make sure arrow expressions get annotated appropriately.
  • Make sure Path Expressions get annotated appropriately.

Split up binary generateBinaryOperatorFunction in 2 different functions

Description

At the moment we have 2 different maps but they still are used in the same place we need to split up functions so they only return relevant information

Sub-tasks

  • split up generateBinaryOperatorFunction
  • Go over everything and use the relevant functions
  • Fix the tests
  • Move the BinaryEvaluationFunction type definition out of it's own file, it feels a bit lonely there

Annotate XQuery nodes

Description

At the end of the project, we should have the type annotation implemented for many of the AST nodes as possible.

  • elementConstructor
  • attributeConstructor
  • computedAttributeConstructor
  • computedCommentConstructor
  • computedTextConstructor
  • computedElementConstructor
  • computerdPIConstructor
  • CDataSection
  • deleteExpr
  • insertExpr
  • renameExpr
  • replaceExpr
  • transformExpr

Fix the bininary Operator annotation

Description

Fix the bininary Operator annotation by using the checks made by fonto in binaryoperator.ts

Sub-tasks

Atomized tasks that cannot be broken down further.

  • Copy the code
  • Trefactor to the point it works with our implementation
  • Fix the non-working tests

Implement ast flagging

Description

We need to traverse the ast multiple times while annotating because of the way the prolog works. Find a way to implement flagging so parts of the ast that have been annotated aren't traversed multiple times.

Sub-tasks

  • Find a way to implement this flagging
  • implement it

Cleanup QName parsing

Description

Right now, some of the annotation code manually parses QNames form the AST. This can be cleaned up by using the existing helper functions.

Sub-tasks

  • Cleanup QName parsing

Assignment 6: Midterm reflection (individual)

Instructions

Once you have given and received feedback from the BuddyCheck system, we would like you to write a reflection. For this assignment we expect you to reflect on this feedback from several different perspectives.

  • Reflect on one of the skills you rated yourself highest on. Why did you rate yourself this high for that particular skill or contribution? Did your teammates rate you high for this skill as well? If not, how do you think this difference between the ratings can be explained?
  • Reflect on one of the skills you rated yourself lowest on in the same way. Next to this think about how you can improve this skill in the future. (i.e. if you have rated yourself low on taking initiative, how do you plan on taking more initiative in the second half of the project? How can your teammates help you achieve this?)
  • Finally, reflect on how well your group has been cooperating as a team and discuss what you (as a group) can change to improve the efficiency/quality of your group’s work in the second half of the project.

Your reflection should be between 500 and 1000 words in total.

During the meeting with the TA in week 6 all team members will be asked to discuss which skill they want to work on, this way the team can take each other’s goals in mind and help everyone improve their performance during the remaining weeks of the project.

Move Unary Type Check to Annotation

Description

The unary type now does a dynamic check for its type, this can be done during the AST annotation phase, so it should be moved there.

Sub-tasks

Plus

  • Migrate type check to annotation and embed it into the AST
  • In the original Unary file, check the annotation and fall back on doing it dynamically if there is no annotation.

Minus (negation)

  • Migrate type check to annotation and embed it into the AST
  • In the original Unary file, check the annotation and fall back on doing it dynamically if there is no annotation.

Implement type inference in comparison operator

Description

Implement type inference in comparison operator, the same way we did in binary operator. Only start when we are happy with binary operator as they are the same principle in implementation.

Sub-tasks

  • Implement type inference in annotate comparison operator.
  • Integrate this method in the system

Cleanup duplicate code

Description

Make sure that the duplicate code in binary operator unary operator is gone

Changes

  • fix binary operator
  • unary operator

Move binop functions in AST

Description

During annotation time, we place the evaluation function for binary operators in the AST. This is not ideal since the AST should easily be serializable which is not possible with functions. Thus the we should postpone this function attaching until we construct the actual expression.

Sub-tasks

  • Move the binop eval function to Expression construction

Resolve TODOs

Description

Resolve the different TODOs around the code base.

some of the TODOs can be searched using keyword TODO: Annotation not yet implemented

Sub-tasks

  • annotateContextItemExpr.ts
  • annotateBinaryOperator.ts
  • annotateUnaryLookup.ts
  • annotateTypeswitchOperator.ts
  • annotateTypeSwitchOperator.ts
  • SequenceOperator.ts
  • Unary.ts
  • valueCompare.ts
  • builtInFunctions_dataTypeConstructors.ts

Create Coverage Metric to Measure Annotation

Description

We want to know how well our implementation covers the queries, we want to keep track of how many annotations are made for a given query. A simple metric would be: annotations/nodes for a query.

Sub-tasks

  • Keep track of the annotation number as well as the total nodes in an AST
  • Get a way to get the metric after annotating
  • Find a way to properly display the metric

Cleanup binary operator

Description

The binary operator annotation at this moment is code copied straight out of binary operator this needs to be fixed.

Sub-tasks

  • Find a better way to make it more compact
  • Make it beautiful
  • Fix the tests

FLWOR Expression Type Annotation

Description

Create annotations for FLWOR (For Let While Order Return) expressions and integrate them into the AST.
These are currently locked behind some changes to the static context and the scoping

Sub-tasks

  • Implement Type Annotation for the FLWOR expression
  • Integrate them into the AST
  • Create Tests to make sure coverage does not drop

Add tests for the newly created code

Description

At the moment there aren't that many tests for the annotation of the code, this should be fixed.

Sub-tasks

  • Create tests for the annotation code
  • Create tests for any other newly created code (if there is any)

Find a Way to Implement Scoping

Description

Make sure variables and functions can have different scopings but still function correctly.

Sub-tasks

  • Implement different scopings for variables
  • Implement different scopings for functions

Add type annotation for all the AST nodes

Description

At the end of the project, we should have the type annotation implemented for many of the AST nodes as possible.

Sub-tasks

  • andOp
  • orOp
  • unaryPlusOp
  • unaryMinusOp
  • addOp
  • subtractOp
  • multiplyOp
  • divOp
  • idivOp
  • modOp
  • sequenceExpr
  • unionOp
  • exceptOp
  • intersectOp
  • stringConcatenateOp
  • rangeSequenceExpr
  • equalOp
  • notEqualOp
  • lessThanOrEqualOp
  • lessThanOp
  • greaterThanOrEqualOp
  • greaterThanOp
  • eqOp
  • neOp
  • ltOp
  • leOp
  • gtOp
  • geOp
  • isOp
  • nodeBeforeOp
  • nodeAfterOp
  • pathExpr
  • contextItemExpr
  • functionCallExpr
  • inlineFunctionExpr (Halted by scope / static context)
  • arrowExpr (Halted by scope / static context)
  • dynamicFunctionInvocationExpr (undefined: Cannot be determined, needs to run XPath)
  • namedFunctionRef (Halted by scope)
  • intergerConstantExpr
  • stringConstantExpr
  • decimalConstantExpr
  • doubleConstantExpr
  • quantifiedExpr
  • ifThenElseExpr
  • instanceOfExpr
  • castExpr
  • castableExpr
  • simpleMapExpr
  • mapConstructor
  • arrayConstructor
  • unaryLookup
  • typeswitchExpr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.