-
Notifications
You must be signed in to change notification settings - Fork 10
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
Some unused variables #4
Comments
It seems also that Line 67 is superfluous, that is, the bloc
can be replaced by
Also: typos within comments: |
I modified the code on my local fork (https://github.com/benjub/mmverify.py/tree/streamline). In particular:
As a result, performance (speed) improved by 6%--10% on set.mm and iset.mm. @david-a-wheeler : should I do a PR ? |
Definitely do a PR. If it seems likely the variable will be used later, documenting how to get it later in a comment might be appropriate. |
@david-a-wheeler : or maybe you want to go directly for the 4 times faster (!!!) version: https://github.com/benjub/mmverify.py/tree/faster ? (which still needs some checking and testing) |
Closing since fixed in #7. |
Speed is good, but correctness is more important :-). |
As noted in What does stat_type do? #1,
stat_type
is unused. It is initialized to the type of the statement whose proof is being verified, so in (i)set.mm it will always be"|-"
(but it could take multiple values in a given database). The verification of a proof does not involve the typecode of the statement by itself. I think that variable could be removed.As mentioned in Frame in make_assertion appears to be unused. #3, the variable
frame
in the functionmake_assertion
is unused. It makes sense since the latest frame (the "present scope") is not particularly relevant to the functionmake_statement
: what is relevant is the "union of the framestack", which is why in that function,self
only appears asin self
. I think that variable could be removed.The function
verify
has an unused argumentstat_label
. The functionverify (stat, proof)
verifies thatproof
is a correct proof ofstat
, and the label of the statement has nothing to do with it. I think that argument could be removed.The use of autopep8 formatting changes indentations slightly. Should this be adopted ?
In the three functions
lookup_c/v/d
, thereversed
seems to be superfluous ? Inlookup_e/f
, it seems correct to havereversed
since this will return the label of the latest active e/f hypothesis with given statement. Similarly correct for both uses inmake_assertion
.(letting @raphlinus and @sctfn know)
The text was updated successfully, but these errors were encountered: