-
Notifications
You must be signed in to change notification settings - Fork 9
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
Construct an appropriate is_mergable
heuristic for merging nodes and composable verification.
#703
Comments
Merging Effect: Reduce the number of generated rules through anti-unification and minimize the splits caused by these rules. Intuitive Understanding and Explanation: Automatically obtain a specification for a function from an external call perspective, thereby omitting the detailed implementation steps. For this purpose, each generated rule should ideally encompass as much depth as possible. Merging can combine the split edges to increase the depth density of each generated rule. |
Initial Heuristic provided by @ehildenb : def is_mergable(ct1: CTerm, ct2: CTerm) -> bool:
status_code_1 = ct1.cell('STATUSCODE_CELL')
status_code_2 = ct2.cell('STATUSCODE_CELL')
program_1 = ct1.cell('PROGRAM_CELL')
program_2 = ct2.cell('PROGRAM_CELL')
if type(status_code_1) is KApply and type(status_code_2) is KApply and type(program_1) is KToken and type(program_2) is KToken:
return status_code_1 == status_code_2 and program_1 == program_2:
raise ValueError(f'Attempted to merge nodes with non-concrete <statusCode> or <program>: {(ct1, ct2)}') |
Heuristic Validation: Case: Validation Steps:
Further Exploration:
|
Check Heuristic: Randomly select two branches (270 -> 67 and 271 -> 63) and examine the and of their respective source and target. 67:
63:
270
271
|
Check Result: I do not believe these are the nodes we want to merge for the following reasons:
Additionally, the and for 270 and 271 are fixed values and identical. This further prevents the generated rules from being usable. |
To make summarization and minimize_proof more useful, we need to ensure that the generated rules can be reused across contracts. This means that the generated rules should correspond to the functions of a contract, serving as either a mock or a specification for the contract. For example, a summarized kcfg should be either a summary of contracts%DualGovernance or a specific function within contracts%DualGovernance, rather than a summary of the test-suite. For instance, for dualGovernance.activateNextState(), we should:
The method to obtain the rule in step 1 is as follows:
|
Currently, we have implemented a language-agnostic
merge_node
(K#4425). However, applying it to practical scenarios and solving problems like Kontrol#448 still requires addressing the following challenges:Some answers to the above issues:
Here are some small steps/tasks that I plan to complete next:
is_mergeable
heuristic evm-semantics#2627; Update dependency: deps/k_release evm-semantics#2626merge_node
Support #829The text was updated successfully, but these errors were encountered: