-
Notifications
You must be signed in to change notification settings - Fork 150
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
Node merging to reduce branching for CSE #4425
Comments
@palinatolmach can you assign the correct people to this, please? |
Will assign to @Stevengre once he's added to the org, thanks @Baltoli! |
Hi @palinatolmach! Thank you for reminding me about joining the org. I just realized that I had only enabled 2FA on my account a few days ago, but I didn't actually join the organization. Sorry for the delay, and I'll make sure to join the org now. |
…ait for future refactoring when needed
MERGING: BLOCKED:
MERGED:
|
I want to optimize Thought:
References: |
More PRs for this issue: |
Currently we have the
minimize_kcfg
routine, which pulls branches up to the top of a the KCFG, and unions edges together. That can improve performance of a transition system by reducing the amount of rules that are injected into the definition, but does not reduce overall branching factor of the function. Here is a link to a diagram for references: https://docs.google.com/drawings/d/1l8i_aUMcL8E7WyxHmk2cqRIY74fQ-yvMdhhdDNcOUp0/edit.In this diagram, on the left, we've already run the existing KCFG minimization routine which lifts splits to the top and collapses subsequent edges into a single edge. We want to transform it into the diagram on the right, which has pushed the split forward through the edges that come after it. In order to make this transformation preserve information, we make the following adjustments:
Edge
s now store a list of tuples(depth, rules, condition)
, which means that "fromsource
node, givencondition
, you will reachtarget
node usingrules
atdepth
". Current edges in the KCFG just store a singledepth, rules
, withcondition
always being#Top
.merge_nodes(CTerm, CTerm) -> bool
on the nodes following the edges. In the case of the diagram, we pairwise run it on all ofB
,C
,D
(or do it iteratively for each pair and do smaller mergings). If two nodes (such asB
andC
) havemerge_nodes
returnTrue
, we do the following:B \/ C
, which has fresh variables in places where the configurations differ, and the specific assignments to the fresh variables conditioned on the path-condition from teh split node leading to each node. So for example, ifE
represents the more abstract configuration, we would computeE #And { PC1 #Implies SUBST1 } #And { PC2 #Implies SUBST2 }
, whereSUBST1
instantiatesE
toB
, andSUBST2
instantiatesE
toC
.A1
andA2
from the graph, and insert new nodeB \/ C
, and insert an edge fromA
toB \/ C
with edge data[(d1, PC1), (d2, PC2)]
, and insert a split fromB \/ C
toB
andC
with conditionsPC1
,PC2
.This effectively "pushes splits down", allowing us to reduce the overall branching factor of the proof if we can push them all the way down to the target node of the proof.
The text was updated successfully, but these errors were encountered: