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

Fix solver logic to QF_LIA #648

Merged
merged 1 commit into from
Apr 26, 2021
Merged

Fix solver logic to QF_LIA #648

merged 1 commit into from
Apr 26, 2021

Conversation

senier
Copy link
Member

@senier senier commented Apr 22, 2021

Description

This just fixes the solver logic to QF_LIA without changing types bit vectors as planned originally. For checking all example specifications we observe a 50-fold speedup. I have an initial conversion to bitvectors, but there were still thirty failing tests. I don't think this big change is justified given the speedup we get by just fixing the logic.

EDIT: I forgot to clean the cache. We also need QF_NIA, as QF_LIA does not support *, /, mod etc. The actual speedup is between 3% and 11%. Consequently, the BV changes in #612 and #625 may still be useful.

@treiher Please try with your DHCP example.

@senier senier requested a review from treiher April 22, 2021 20:42
@treiher
Copy link
Collaborator

treiher commented Apr 23, 2021

I get a long list of errors for DHCP after this change:

specs/dhcp.rflx:163:18: model: error: unreachable field "Len" in "DHCP::Option"
specs/dhcp.rflx:163:18: model: info: path 0 (Code -> Len):
specs/dhcp.rflx:180:18: model: error: unreachable field "Cookie_Servers" in "DHCP::Option"
specs/dhcp.rflx:180:18: model: info: path 0 (Code -> Len -> Cookie_Servers):
specs/dhcp.rflx:176:18: model: error: unreachable field "Domain_Name_Servers" in "DHCP::Option"
specs/dhcp.rflx:176:18: model: info: path 0 (Code -> Len -> Domain_Name_Servers):
specs/dhcp.rflx:184:18: model: error: unreachable field "Impress_Servers" in "DHCP::Option"
specs/dhcp.rflx:184:18: model: info: path 0 (Code -> Len -> Impress_Servers):
specs/dhcp.rflx:182:18: model: error: unreachable field "LPR_Servers" in "DHCP::Option"
specs/dhcp.rflx:182:18: model: info: path 0 (Code -> Len -> LPR_Servers):
specs/dhcp.rflx:178:18: model: error: unreachable field "Log_Servers" in "DHCP::Option"
specs/dhcp.rflx:178:18: model: info: path 0 (Code -> Len -> Log_Servers):
specs/dhcp.rflx:174:18: model: error: unreachable field "Name_Servers" in "DHCP::Option"
specs/dhcp.rflx:174:18: model: info: path 0 (Code -> Len -> Name_Servers):
specs/dhcp.rflx:256:18: model: error: unreachable field "NetBIOS_Over_TCP_IP_Datagram_Distribution_Servers" in "DHCP::Option"
specs/dhcp.rflx:256:18: model: info: path 0 (Code -> Len -> NetBIOS_Over_TCP_IP_Datagram_Distribution_Servers):
specs/dhcp.rflx:254:18: model: error: unreachable field "NetBIOS_Over_TCP_IP_Name_Servers" in "DHCP::Option"
specs/dhcp.rflx:254:18: model: info: path 0 (Code -> Len -> NetBIOS_Over_TCP_IP_Name_Servers):
specs/dhcp.rflx:248:18: model: error: unreachable field "Network_Information_Servers" in "DHCP::Option"
specs/dhcp.rflx:248:18: model: info: path 0 (Code -> Len -> Network_Information_Servers):
specs/dhcp.rflx:250:18: model: error: unreachable field "Network_Time_Protocol_Servers" in "DHCP::Option"
specs/dhcp.rflx:250:18: model: info: path 0 (Code -> Len -> Network_Time_Protocol_Servers):
specs/dhcp.rflx:214:18: model: error: unreachable field "Path_MTU_Plateau_Table" in "DHCP::Option"
specs/dhcp.rflx:214:18: model: info: path 0 (Code -> Len -> Path_MTU_Plateau_Table):
specs/dhcp.rflx:206:18: model: error: unreachable field "Policy_Filter" in "DHCP::Option"
specs/dhcp.rflx:206:18: model: info: path 0 (Code -> Len -> Policy_Filter):
specs/dhcp.rflx:186:18: model: error: unreachable field "Resource_Location_Servers" in "DHCP::Option"
specs/dhcp.rflx:186:18: model: info: path 0 (Code -> Len -> Resource_Location_Servers):
specs/dhcp.rflx:170:18: model: error: unreachable field "Routers" in "DHCP::Option"
specs/dhcp.rflx:170:18: model: info: path 0 (Code -> Len -> Routers):
specs/dhcp.rflx:230:18: model: error: unreachable field "Static_Routes" in "DHCP::Option"
specs/dhcp.rflx:230:18: model: info: path 0 (Code -> Len -> Static_Routes):
specs/dhcp.rflx:172:18: model: error: unreachable field "Time_Servers" in "DHCP::Option"
specs/dhcp.rflx:172:18: model: info: path 0 (Code -> Len -> Time_Servers):
specs/dhcp.rflx:457:29: parser: error: undefined element type "DHCP::Option"
specs/dhcp.rflx:480:10: model: error: missing type for field "Options" in "DHCP::Message"

The specification can be found here.

@senier
Copy link
Member Author

senier commented Apr 23, 2021

I get a long list of errors for DHCP after this change:

This was due to using the wrong logic. I changed this in 73431da. I also added slightly more useful error messages in those cases in e2ef93c. See the updated PR description - the performance improvement is not at all as impressive as I thought.

@treiher
Copy link
Collaborator

treiher commented Apr 23, 2021

Consequently, the BV changes in #612 and #625 may still be useful.

The commit message of 73431da still closes both issues. Is that intended?

rflx/expression.py Outdated Show resolved Hide resolved
rflx/expression.py Show resolved Hide resolved
rflx/expression.py Outdated Show resolved Hide resolved
@senier
Copy link
Member Author

senier commented Apr 23, 2021

Consequently, the BV changes in #612 and #625 may still be useful.

The commit message of 73431da still closes both issues. Is that intended?

No, changed in d246337.

@senier senier force-pushed the issue_612 branch 2 times, most recently from 8e7c88e to 6c49048 Compare April 23, 2021 14:35
rflx/expression.py Outdated Show resolved Hide resolved
@senier senier force-pushed the issue_612 branch 2 times, most recently from dc85d72 to ea507e4 Compare April 24, 2021 22:39
@senier
Copy link
Member Author

senier commented Apr 26, 2021

@treiher I had to refactor the PR a bit to achieve test coverage. The logic became a parameter to the constructor of the Proof class so we can set it to an unsuitable logic in the tests and trigger the UNKNOWN issue.

treiher
treiher previously approved these changes Apr 26, 2021
@senier
Copy link
Member Author

senier commented Apr 26, 2021

@treiher Rebased to current main.

@senier senier merged commit fd29cb3 into main Apr 26, 2021
@senier senier deleted the issue_612 branch April 26, 2021 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants