Closed NubKel closed 4 years ago
I don't think the issue is related to the files you modified. The Synthesiser.cpp does create unnecessary context in some cases:
For example, in RamExistenceCheck, a context should be created only for partial existence check. However, in special cases, RamExistenceCheck can have an empty or full search signature, which can be simplified to a non-empty check and a full-order search. Both operations actually don't need a context but the synthesiser create it anyway.
We can add an extra check in the synthesiser to avoid unnecessary context creation.
This is related to the synthesizer. We haven't disabled the warnings while compiling.
We use a fairly simple approach to determine which relations are related, and add a context variable for all of them. In some cases this will add an unused variable. This unused variable produces a warning when we compile synthesised code but is harmless. More accurate tests for whether a context variable is relevant are also more complicated, and are not a priority.
It's possible this will be changed in the future as part of some other changes, but we don't plan to change this for now.
This is Kelvin from the 2019 capstone team, we are doing the C++ interface enhancement task. Which we attempted to solve problems such as checking the element before the insertion (related to issue #1075.), using std lib data structure instead of using tuple (in Souffle) in client operation. When we are testing, we get the result we want, however, we also get the issue of "variable set but not used". In generated C++ file, the
rel_1_edge_op_ctxt
inCREATE_OP_CONTEXT(rel_1_edge_op_ctxt,rel_1_edge->createContext());
has never used, which oppositely the relationedge
is the one that used operated in the client code.Can someone explain what
CREATE_OP_CONTEXT(NAME, INIT)
does inParallelUtils.h
and the concept of "context"? Thanks!