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
Added limitsize directive #1599
Conversation
src/ram/RelationSize.h
Outdated
@@ -0,0 +1,79 @@ | |||
/* | |||
* Souffle - A Datalog Compiler | |||
* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update date/organisation.
src/ram/RelationSize.h
Outdated
#pragma once | ||
|
||
#include "ram/Expression.h" | ||
#include "ram/NodeMapper.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't look like all these includes are needed. Remove the unused ones.
src/parser/parser.yy
Outdated
@@ -884,6 +885,7 @@ io_head_decl | |||
: INPUT_DECL { $$ = AstIoType::input; } | |||
| OUTPUT_DECL { $$ = AstIoType::output; } | |||
| PRINTSIZE_DECL { $$ = AstIoType::printsize; } | |||
| LIMITSIZE_DECL { $$ = AstIoType::limitsize; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not seem to be at all related to I/O. Could it instead be a new AST type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Longterm we should rename io-directives to relation-directives.
The reason is that we should not build two different directive infrastructures, i.e., one for IO and the other one for computation like limitsize.
src/parser/ParserDriver.cpp
Outdated
@@ -137,6 +137,18 @@ void ParserDriver::addIO(std::unique_ptr<AstIO> d) { | |||
return; | |||
} | |||
} | |||
} else if (d->getType() == AstIoType::limitsize) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
d
? This should be refactored to be a useful name. This can wait for another PR, though, since it was not introduced by this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed - this should be directive.
Codecov Report
@@ Coverage Diff @@
## master #1599 +/- ##
==========================================
- Coverage 70.36% 70.34% -0.02%
==========================================
Files 219 220 +1
Lines 12163 12176 +13
==========================================
+ Hits 8558 8565 +7
- Misses 3605 3611 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
I have renamed IO Directives to directives for most of the ast. In future, we can use the directive mechanism for other aspects including data-structure representations etc. |
This is a very basic implementation for the
limitsize
directive that stops evaluating a stratum when one or more of the specified relation have reached their specified cardinalities in thelimitsize
directive. Note thatlimitsize
is a very rough measure and is mainly useful for debugging purposes. This is related to issue #637.The syntax of the limitsize is
Here is an example,
that terminates the evaluation when A reaches the cardinality of 47.