Universal Scalability in Declarative Program Analysis (with Choice-Based Combination Pruning)
Listen
Radio episode about this paper
Transcript
Introduction to the show: ident: Computer Science. The day in computer science: software, systems and theory on arXiv.
Tom: I'm Tom.
Jane: And I'm Jane, here with Lu, Meng and our in-house large language model, Lalam.
Tom: We're looking at the paper: "Universal Scalability in Declarative Program Analysis (with Choice-Based Combination Pruning)".
Title and authors: Tom: So we’re starting with the title and authors of this paper, Universal Scalability in Declarative Program Analysis with Choice-Based Combination Pruning, and I want to set the stage for what this is about.
Jane: This paper is written by Anastasios Antoniadis from the University of Athens, Ilias Tsatiris from Dedaub, Neville Grech from Dedaub and the University of Malta, and Yannis Smaragdakis also from Dedaub and the University of Athens.
Lu: The title itself points to a universal solution for scalability in declarative program analysis using this specific technique called Choice-Based Combination Pruning.
Meng: So what does that mean for us when we are looking at massive program analyses where the bottom-up evaluation causes everything to compute everything?
Tom: It means they are addressing the problem where Datalog evaluations, because they start from input facts and compute all possible inferences recursively until no more inferences can be made, become completely unscalable for some inputs.
Jane: They are proposing a simple, uniform solution to this problem that works across different Datalog engines and major analysis frameworks with stunning practical effectiveness.
Lu: The core idea is to introduce Choice-Bound as a way to easily make any pre-existing Datalog based program analysis implementation significantly more scalable by bounding the evaluation of predicates adaptively.
Meng: So, it’s not just a theoretical fix; it’s meant to be applied directly to existing tools, which is good because we don't want to build everything from scratch every time.
Tom: That's right, they show that this approach has been applied successfully to several pre-existing Datalog analyses with minimal change and it achieves speedups of over an order of magnitude on challenging benchmarks like Doop.
Jane: They even show metrics for completeness, so they aren't just sacrificing accuracy without any measurable downside when you use Choice-Bound.
Lu: The contributions listed in the paper are key, including introducing this Choice-Bound method and identifying the design space behind it with a vocabulary for expressing the analysis designer’s choices.
Meng: That vocabulary sounds useful because it gives us a framework to actually understand what parameters we can tune—the bound variables, the limit, and those counting variables that generate the identifier.
Tom: So this isn't just one fixed solution; it opens up a large design space for parameterizing a Datalog computation based on how much control you want over the analysis.
Jane: And they show that this design space allows for very powerful tuning to find sweet spots in the performance versus completeness trade-off.
The paper's summary: Tom: We talked about what Choice-Bound is, and now we need to get into a deeper look at the actual mechanism described in Universal Scalability in Declarative Program Analysis with Choice-Based Combination Pruning.
Jane: This section explains the core technique, which is lifting the choice construct from just expressing functional dependencies to expressing multiplicity dependencies.
Lu: The goal is to relax this constraint from saying a combination of x and y can only appear once to saying that a combination of x and y can only appear up to some number N times, where N is determined by our control.
Meng: So how do they actually manage that relaxation in the computation? Is it just adding a field or something simple?
Tom: They achieve this by adding an extra field to the relation that’s choice bound, which denotes a unique identifier of the “choice” that needs to be made.
Jane: And they show how this is used: if we have a relation like R with x, y and z, it becomes R with x, y, z and an extra field i that is choice bound based on x and y and some other variables.
Lu: That identifier i can then be computed by using a hash function over the values of z projected modulo N.
Meng: So if we use that hash function idea, it means for any combination of x, y, and the identifier i, there will be up to N different z values in the relation.
Tom: That’s exactly right; R with x, y and i is computed to have a single instance of each unique combination of x and y and i.
Jane: And this way you've effectively bound the number of z values for every combination of x and y, which is the desired guarantee.
The paper's improvements: Tom: Now let’s talk about what they actually improved, because they didn't just introduce a concept; they showed how much better it is in practice.
Jane: They demonstrate that the most important aspect of Choice-Bound implementation is its direct impact on analysis performance, which we saw by looking at the benchmarks.
Lu: They run nine benchmarks and all of them terminated in under one hour, and typically under thirty minutes, which they say is a dramatic speedup over what you’d expect from a slow bottom-up computation.
Meng: I need to know the specifics on that speedup; are we talking about a factor of ten, or something more aggressive?
Tom: The average speedup across those benchmarks is twenty four times, ranging from a four point seven times speedup for batik up to fifty point six eight times for alfresco.
Jane: And they stress that in more realistic terms, an analysis terminating in under an hour is arguably immeasurably better than one that just keeps running and eventually times out.
Lu: They also show several metrics of completeness, showing things like coverage and the ability to detect bugs, proving that the trade-off with Choice-Bound is excellent in practice when compared to what we've seen in previous work.
Meng: So they’re not just claiming speed; they's providing evidence that this is a solid trade-off for real world deployment, which is exactly what I need to hear before I sign off on anything.
Tom: The overall message here is that this technique applies to virtually any demanding Datalog analysis and its expressiveness permits very powerful tuning to find those sweet spots in the performance versus completeness trade-off.
Conclusion: Jane: We've covered what Choice-Bound is, how it works mechanically, and the improvements they’s shown across different benchmarks.
Tom: So we’re wrapping up by summarizing the main points of Universal Scalability in Declarative Program Analysis with Choice-Based Combination Pruning.
Lu: The paper concludes that this technique leverages the choice construct in a novel way to bound the evaluation of predicates adaptively, providing a simple and effective solution to scalability problems.
Meng: From an engineering standpoint, it’s transparent because it requires only local changes to a Datalog program modulo some global search and replace.
Tom: It’s simple enough that it doesn't require intrusive changes to the original analysis specification, which is great for adoption because it’s transparent and virtually automatic.
Jane: So, in the end, this technique offers an excellent trade-off where the completeness loss is typically minimal compared to the gains you get in speedup.
Lu: And with potential speedups of over an order of magnitude, and cases where a normally non-terminating analysis becomes a very realistic sub-hour task.
Meng: I just want to make sure we understand that it’s not a magic fix for every single problem, but rather a tool for the analysis designer to customize and obtain results even for highly complex analyses and large inputs.
Tom: Exactly, it’s a powerful tool in the hands of an analysis designer permitting customization and obtaining results even for highly complex analyses and large inputs with this paper.
Jane: That's all we have today regarding Universal Scalability in Declarative Program Analysis with Choice-Based Combination Pruning.
University of Athens · Dedaub
cs.SE
Submitted: 2025-03-07
Updated: 2025-03-07
Journal ref: Proc. ACM Program. Lang. 9, OOPSLA2 (2025)
DOI: 10.1145/3763129
Code: https://github.com/souffle-lang/souffle
License: http://creativecommons.org/licenses/by/4.0/
Importance score: 89/100
The gist: Universal Scalability in Declarative Program Analysis (with Choice-Based Combination Pruning) presents Choice-Bound as a simple…
Key concepts
- Choice Construct
- This is a feature in Datalog that allows expressing functional dependencies, meaning a combination of variables can only appear once. Choice-Bound modifies this construct to express multiplicity dependencies, allowing designers to limit how many times a specific combination of variables can appear (up to N times).
- Choice-Bound
- This is the core technique that lifts the choice construct from expressing functional dependencies to expressing multiplicity dependencies. It achieves this by adding a unique identifier field and using a hash function over bounded domains to ensure that combinations are limited up to N instances.
- Design Space Parameterization
- Choice-Bound introduces three main parameters for tuning: bound variables (the fields being limited), the limit (the numeric bound N), and counting variables (fields used in the hash function). This gives designers a large space to choose specific constraints tailored to their analysis needs, balancing precision and computation cost.
- Multiplicity Dependencies
- Instead of enforcing that a combination of variables appears only once (functional dependency), Choice-Bound allows for 'N' instances. This is achieved by adding a choice-bound field and using it as an identifier computed from a bounded domain, effectively bounding the number of times specific combinations can occur.
Terminology
Summary
Universal Scalability in Declarative Program Analysis (with Choice-Based Combination Pruning) presents Choice-Bound as a simple, universal technique to significantly increase the scalability of Datalog-based program analyses by adaptively pruning evaluation results based on a programmer-controlled projection of a relation exceeding a desired cardinality. p. 2 Universal Scalability in Declarative Program Analysis
(with Choice-Based Combination Pruning) 3
Bounding the number of combinations of key variables directly addresses the worst-case behavior
of the analysis. Choice-Bound effectively solves the problem of scalability of Datalog-based analyses,
at the expense of introducing some analysis incompleteness and non-determinism. In this work, we present a simple, uniform, and elegant solution to the problem, with stunning practical
effectiveness and application to virtually any Datalog-based analysis. The approach consists of leveraging
the choice construct, supported natively in modern Datalog engines like Soufflé. We apply the technique to probably the largest, pre-existing Datalog analysis frameworks in existence:
Doop (for Java bytecode) and the main client analyses from the Gigahorse framework (for Ethereum smart
contracts). Without needing to understand the existing analysis logic and with minimal, local-only changes, the
performance of each framework increases dramatically, by over 20x for the hardest inputs, with near-negligible
sacrifice in completeness. p. 0 We apply the technique to probably the largest, pre-existing Datalog analysis frameworks in existence:
Doop (for Java bytecode) and the main client analyses from the Gigahorse framework (for Ethereum smart
contracts). Without needing to understand the existing analysis logic and with minimal, local-only changes, the
performance of each framework increases dramatically, by over 20x for the hardest inputs, with near-negligible
sacrifice in completeness.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
The Core Technique of Choice-Bound
The main idea of Choice-Bound is straightforward: it lifts the choice construct from expressing functional dependencies to expressing multiplicity dependencies.<ref:2503.05945#pg6, "The goal of Choice-Bound is to relax this constraint from “a combination of x, y can only appear once” to “a combination of x, y can only appear up to N times. p. 5 If, without the choice construct,
many combinations of x and y were to appear in the final contents of R, there is no guarantee
as to which will be kept: the implementation can make an arbitrary choice, and it is up to the
programmer to ensure that any such choice yields an acceptable output. The goal of Choice-Bound is to relax this constraint from “a combination of x, y can only appear
once” to “a combination of x, y can only appear up to 𝑁 times. The choice will be arbitrary, based on the
evaluation order that the implementation chooses. This relaxation is achieved by adding an extra field to the relation that is choice-bound, denoting
a unique identifier of the “choice” that needs to be made. The choice will be arbitrary, based on the
evaluation order that the implementation chooses. This relaxation is achieved by adding an extra field to the relation that is choice-bound, denoting
a unique identifier of the “choice” that needs to be made. The choice will be arbitrary, based on the
evaluation order that the implementation chooses. This relaxation is achieved by adding an extra field to the relation that is choice-bound, denoting
a unique identifier of the “choice” that needs to be made. This relaxation is achieved by adding an extra field to the relation that is choice-bound, denoting
a unique identifier of the “choice” that needs to be made. If these identifiers are then computed
from a bounded domain of size 𝑁, we have the desired guarantee. This relaxation is achieved by adding an extra field to the relation that is choice-bound, denoting
a unique identifier of the “choice” that needs to be made. If these identifiers are then computed
from a bounded domain of size 𝑁, we have the desired guarantee. If these identifiers are then computed
from a bounded domain of size 𝑁, we have the desired guarantee. Specifically, in our example:
• relation R(x,y,z) becomes R(x,y,z,i) with choice-domain (in the standard “functional” sense)
x,y,i. Specifically, in our example:
• relation R(x,y,z) becomes R(x,y,z,i) with choice-domain (in the standard “functional” sense)
x,y,i. • Field i can then be computed via a hash function over the values of z, projected modulo 𝑁. • Field i can then be computed via a hash function over the values of z, projected modulo 𝑁. • In this way, R(x,y,z,i) is computed to have a single instance of each unique combination of
x,y,i, i. • In this way, R(x,y,z,i) is computed to have a single instance of each unique combination of
x,y,i, i. , up to 𝑁 different z values for each combination of x,y values. • In this way, R(x,y,z,i) is computed to have a single instance of each unique combination of
x,y,i, i. , up to 𝑁 different z values for each combination of x,y values. • Field i can then be computed via a hash function over the values of z, projected modulo 𝑁. • In this way, R(x,y,z,i) is computed to have a single instance of each unique combination of
x,y,i, i.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Design Space and Parameterization
Choice-Bound opens up a large design space for parameterizing a Datalog computation.<ref:2503.05945#pg8>. This vocabulary admits three parameters: the bound variables, i. p. 7 To encode the design space available to the programmer, we introduce a vocabulary for describing choice-domain decisions under the Choice-Bound technique. The vocabulary admits three
parameters:
• The bound variables, i. The vocabulary admits three
parameters:
• The bound variables, i. , the dimensions/fields of a predicate whose combinations will be
limited;
• the limit, i. The vocabulary admits three
parameters:
• The bound variables, i. , the dimensions/fields of a predicate whose combinations will be
limited;
• the limit, i. , the dimensions/fields of a predicate whose combinations will be
limited;
• the limit, i. , the numeric bound;
• the counting variables, i. , the dimensions/fields of a predicate whose combinations will be
limited;
• the limit, i. , the numeric bound;
• the counting variables, i. , the numeric bound;
• the counting variables, i. , the dimensions/fields of the predicate that participate in the
hash function, getting mapped to a unique identifier. To encode the design space available to the programmer, we introduce a vocabulary for describing choice-domain decisions under the Choice-Bound technique. The vocabulary admits three
parameters:
• The bound variables, i. , the numeric bound;
• the counting variables, i. , the dimensions/fields of the predicate that participate in the
hash function, getting mapped to a unique identifier. )
We use the notation Relation::{bound vars}𝑙𝑖𝑚𝑖𝑡 [[counting vars]] to capture this design space. For illustration, let us consider predicate VarPointsTo, the main relation of a context-sensitive
points-to analysis. )
We consider several design choices over the same relation (and even the same underlying hash
function). All of the design choices yield different performance/completeness profiles for the exact
same core analysis. For concreteness, we
use specific numbers for the limit parameter, but changing this limit is an obvious parameterization
choice, which can be guided by observation, so we do not discuss it further in conceptual terms. • VarPointsTo::{var}541 [[ctx,hobj,hctx]]: This is a straightforward “cost-conscious” design
choice.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
VarPointsTo:: var 541 [[ctx,hobj,hctx]]: This is a straightforward “cost-conscious” design choice.
>
Performance and Scalability Gains
The most important aspect of Choice-Bound implementation is its impact on analysis performance.<ref:2503.05945#pg12, "The most important aspect of Choice-Bound implementation is its impact on analysis performance. p. 5 2 Discussion of Impact
Before we delve into the technical specifics of Choice-Bound, it is worth understanding its costbenefit proposition. In substance, Choice-Bound enables an analysis designer to:
• express their code declaratively, as before, with virtually no changes to the rules;
• tune performance by adding extra constraints of the form “relation R shall never have more
than 𝑁 instances with the same values for fields x,y”. Even worse, the boundary of
unscalability can remain entirely unpredictable. In this work, we introduce Choice-Bound: a simple, universal technique for Datalog analysis
scalability, achieving dramatic results—often outperforming past analysis innovations by more
than an order of magnitude, for the most challenging benchmarks. It would require computing the unconstrained relation, ordering its tuples through
an arbitrary ordering, and iterating over the ordered tuples to only pick one per functional domain. In experiments with just a single application of choice-domain to compute a spanning tree, the
speedup is typically over 5 orders of magnitude [11]. Consider two such relations, AssignHeapAllocation(var, obj)
and Assign(to, from). (We follow the convention of capitalizing the first letter of relation names,
while writing variable names in lower case. nnnnnnn
, Vol. 1, Article . 1, Article . Publication date: March 2025. The question remaining is one of the extent of the sacrifice, which is an
engineering trade-off question, answered experimentally. As we shall see in Section 5, analysis
incompleteness is very minor, whereas the performance benefits are dramatic. Much of the program analysis literature has been about addressing analysis scalability issues,
by producing better algorithms. However, the state of the art remains unscalable for precise
context-sensitive analysis of large inputs (e. It would require computing the unconstrained relation, ordering its tuples through
an arbitrary ordering, and iterating over the ordered tuples to only pick one per functional domain. In experiments with just a single application of choice-domain to compute a spanning tree, the
speedup is typically over 5 orders of magnitude [11]. It would require computing the unconstrained relation, ordering its tuples through
an arbitrary ordering, and iterating over the ordered tuples to only pick one per functional domain. In experiments with just a single application of choice-domain to compute a spanning tree, the
speedup is typically over 5 orders of magnitude [11]. It would require computing the unconstrained relation, ordering its tuples through
an arbitrary ordering, and iterating over the ordered tuples to only pick one per functional domain. In experiments with just a single application of choice-domain to compute a spanning tree, the
speedup is typically over 5 orders of magnitude [11]. It would require computing the unconstrained relation, ordering its tuples through
an arbitrary ordering, and iterating over the ordered tuples to only pick one per functional domain. In experiments with just a single application of choice-domain to compute a spanning tree, the
speedup is typically over 5 orders of magnitude [11]. This leads to bounding the number of SMT invocations and not just
Datalog analysis, yielding very substantial speedups. The overall message is that the technique applies to virtually any demanding Datalog analysis
and its expressiveness permits very powerful tuning in order to find sweet spots in the performancecompleteness trade-off.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Trade-offs and Completeness
The apparent trade-off is to sacrifice completeness and determinism.<ref:2503.05945#pg6, "This relaxation is achieved by adding an extra field to the relation that is choice-bound, denoting a unique identifier of the “choice” that needs to be made.">. Most realistic analyses we have found have already made design decisions to sacrifice completeness and determinism. p. 6 Universal Scalability in Declarative Program Analysis
(with Choice-Based Combination Pruning) 7
This is an excellent trade-off in practice: most realistic analyses we have found have already
made design decisions to sacrifice completeness and determinism, in order to get much more minor
benefits than those offered by Choice-Bound. What Choice-Bound does is empower the analysis
designer to find the sweet spot in this trade-off. What Choice-Bound does is empower the analysis
designer to find the sweet spot in this trade-off. The scalability problem with most large-scale Datalog-based analyses stems from their bottom-up
nature: the analysis computes all results, following from the inference rules. The scalability problem with most large-scale Datalog-based analyses stems from their bottom-up
nature: the analysis computes all results, following from the inference rules. However, in practice it
is commonly the case that not all results are necessary and that which specific results end up being
computed matters little. The scalability problem with most large-scale Datalog-based analyses stems from their bottom-up
nature: the analysis computes all results, following from the inference rules. However, in practice it
is commonly the case that not all results are necessary and that which specific results end up being
computed matters little.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Application to Frameworks
Choice-Bound has been applied to several pre-existing Datalog analyses.<ref:2503.05945#pg11, "We applied Choice-Bound to several pre-existing Datalog analyses (with minimal change to the analysis specification, as discussed in Section 4. p. 8 These include VarPointsTo::{var,ctx,hobj}13 [[hctx]] (where the
bound is on the number of heap allocation contexts kept, for all other dimensions being
identical), VarPointsTo::{var,hobj}277 [[ctx,hctx]] (where there is a total limit in the number
of appearances of a variable-value pair, which is an externally-observable quantity); etc. 2 Applications
We applied Choice-Bound to several pre-existing Datalog analyses (with minimal change to the
analysis specification, as discussed in Section 4. )
The bound used for the 2-object-sensitive+heap (2objH) analysis of Doop (i. , an objectsensitive [28] analysis with 2 elements of context for local variables and 1 for heap objects) is:
• VarPointsTo::{var,ctx}101 [[hobj,hctx]]. )
The bound used for the 2-object-sensitive+heap (2objH) analysis of Doop (i. , an objectsensitive [28] analysis with 2 elements of context for local variables and 1 for heap objects) is:
• VarPointsTo::{var,ctx}101 [[hobj,hctx]]. , all integers) even for a very small expression size. The Choice-Bound specification for this relation is:
ExprFlowsToVar::{var}1373 [[complexity,expr,ctx]].Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
The Choice-Bound specification for this relation is: ExprFlowsToVar:: var 1373 [[complexity,expr,ctx]].
>. The overall message is that the technique applies to virtually any demanding Datalog analysis and its expressiveness permits very powerful tuning in order to find sweet spots in the performance-completeness trade-off.<ref:2503.05945#pg7>
Conclusion
Choice-Bound offers a powerful tool in tuning scalability vs. completeness.<ref:2503.05945#pg7>. Although Choice-Bound will incur some completeness loss, this is typically minimal compared to the gains. p. 0 A Datalog specification of an analysis allows a declarative, easy-to-maintain specification, without
sacrificing performance, and indeed often achieving significant speedups compared to hand-coded algorithms. However, these benefits come with a certain loss of control. • We identify the design space behind Choice-Bound and introduce a vocabulary for expressing
the analysis designer’s choices. • We show the effectiveness of the technique in major pre-existing analysis frameworks and
the toughest benchmarks tackled in past literature, achieving speedups of over an order of
magnitude (and often two or more). Similarly, non-determinism is expected. The Doop output is non-deterministic, due to multiple
factors, such as multi-threaded fact generation, multi-threaded core analysis, arbitrary choice of
representatives (e. What Choice-Bound does is empower the analysis
designer to find the sweet spot in this trade-off. The scalability problem with most large-scale Datalog-based analyses stems from their bottom-up
nature: the analysis computes all results, following from the inference rules. Choice-Bound effectively solves the problem of scalability of Datalog-based analyses,
at the expense of introducing some analysis incompleteness and non-determinism. In overview, the contributions of this work are as follows:
• We introduce Choice-Bound: a way to easily make any pre-existing Datalog-based program
analysis implementation significantly more scalable. In this work, we present a simple, uniform, and elegant solution to the problem, with stunning practical
effectiveness and application to virtually any Datalog-based analysis. The approach consists of leveraging
the choice construct, supported natively in modern Datalog engines like Soufflé. The overall message is that the technique applies to virtually any demanding Datalog analysis
and its expressiveness permits very powerful tuning in order to find sweet spots in the performancecompleteness trade-off. 3 Implementation
Implementing Choice-Bound is simple, requiring only local changes to a Datalog program (modulo
a global semi-automatic search-and-replace). The overall message is that the technique applies to virtually any demanding Datalog analysis
and its expressiveness permits very powerful tuning in order to find sweet spots in the performancecompleteness trade-off. 3 Implementation
Implementing Choice-Bound is simple, requiring only local changes to a Datalog program (modulo
a global semi-automatic search-and-replace). The overall message is that the technique applies to virtually any demanding Datalog analysis
and its expressiveness permits very powerful tuning in order to find sweet spots in the performancecompleteness trade-off. 3 Implementation
Implementing Choice-Bound is simple, requiring only local changes to a Datalog program (modulo
a global semi-automatic search-and-replace). The overall message is that the technique applies to virtually any demanding Datalog analysis
and its expressiveness permits very powerful tuning in order to find sweet spots in the performancecompleteness trade-off. 3 Implementation
Implementing Choice-Bound is simple, requiring only local changes to a Datalog program (modulo
a global semi-automatic search-and-replace). The overall message is that the technique applies to virtually any demanding Datalog analysis
and its expressiveness permits very powerful tuning in order to find sweet spots in the performancecompleteness trade-off. 3 Implementation
Implementing Choice-Bound is simple, requiring only local changes to a Datalog program (modulo
a global semi-automatic search-and-replace). Note how these bounds are higher than the earlier bounds in the Doop framework analyses. This is easy to understand by considering that the Doop framework is meant for wholeprogram analysis of applications with many tens of thousands of classes (and many tens of
MB in binary form), whereas symvalic analysis attempts a much more precise analysis but
over programs (smart contracts) that are at most 24KB in binary form. Note how these bounds are higher than the earlier bounds in the Doop framework analyses. This is easy to understand by considering that the Doop framework is meant for wholeprogram analysis of applications with many tens of thousands of classes (and many tens of
MB in binary form), whereas symvalic analysis attempts a much more precise analysis but
over programs (smart contracts) that are at most 24KB in binary form. Note how these bounds are higher than the earlier bounds in the Doop framework analyses. This is easy to understand by considering that the Doop framework is meant for wholeprogram analysis of applications with many tens of thousands of classes (and many tens of
MB in binary form), whereas symvalic analysis attempts a much more precise analysis but
over programs (smart contracts) that are at most 24KB in binary form. Note how these bounds are higher than the earlier bounds in the Doop framework analyses. This is easy to understand by considering that the Doop framework is meant for wholeprogram analysis of applications with many tens of thousands of classes (and many tens of
MB in binary form), whereas symvalic analysis attempts a much more precise analysis but
over programs (smart contracts) that are at most 24KB in binary form. Note how these bounds are higher than the earlier bounds in the Doop framework analyses. This is easy to understand by considering that the Doop framework is meant for wholeprogram analysis of applications with many tens of thousands of classes (and many tens of
MB in binary form), whereas symvalic analysis attempts a much more precise analysis but
over programs (smart contracts) that are at most 24KB in binary form. The overall message is that the technique applies to virtually any demanding Datalog analysis
and its expressiveness permits very powerful tuning in order to find sweet spots in the performancecompleteness trade-off. 3 Implementation
Implementing Choice-Bound is simple, requiring only local changes to a Datalog program (modulo
a global semi-automatic search-and-replace). The overall message is that the technique applies to virtually any demanding Datalog analysis
and its expressiveness permits very powerful tuning in order to find sweet spots in the performancecompleteness trade-off. 3 Implementation
Implementing Choice-Bound is simple, requiring only local changes to a Datalog program (modulo
a global semi-automatic search-and-replace). The overall message is that the technique applies to virtually any demanding Datalog analysis
and its expressiveness permits very powerful tuning in order to find sweet spots in the performancecompleteness trade-off. 3 Implementation
Implementing Choice-Bound is simple, requiring only local changes to a Datalog program (modulo
a global semi-automatic search-and-replace). The overall message is that the technique applies to virtually any demanding Datalog analysis
and its expressiveness permits very powerful tuning in order to find sweet spots in the performancecompleteness trade-off. 3 Implementation
Implementing Choice-Bound is simple, requiring only local changes to a Datalog program (modulo
a global semi-automatic search-and-replace).Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the Gains Come From
The gains come from effectively bounding computation costs and preventing worst-case blowup of analysis time.<ref:2503.05945#pg6>. Choice-Bound effectively solves the problem of scalability of Datalog-based analyses, at the expense of introducing some analysis incompleteness and non-determinism. p. 2 Universal Scalability in Declarative Program Analysis
(with Choice-Based Combination Pruning) 3
Bounding the number of combinations of key variables directly addresses the worst-case behavior
of the analysis. Choice-Bound effectively solves the problem of scalability of Datalog-based analyses,
at the expense of introducing some analysis incompleteness and non-determinism. Universal Scalability in Declarative Program Analysis
(with Choice-Based Combination Pruning) 7
This is an excellent trade-off in practice: most realistic analyses we have found have already
made design decisions to sacrifice completeness and determinism, in order to get much more minor
benefits than those offered by Choice-Bound. What Choice-Bound does is empower the analysis
designer to find the sweet spot in this trade-off. Universal Scalability in Declarative Program Analysis
(with Choice-Based Combination Pruning) 7
This is an excellent trade-off in practice: most realistic analyses we have found have already
made design decisions to sacrifice completeness and determinism, in order to get much more minor
benefits than those offered by Choice-Bound. What Choice-Bound does is empower the analysis
designer to find the sweet spot in this trade-off. Universal Scalability in Declarative Program Analysis
(with Choice-Based Combination Pruning) 7
This is an excellent trade-off in practice: most realistic analyses we have found have already
made design decisions to sacrifice completeness and determinism, in order to get much more minor
benefits than those offered by Choice-Bound. What Choice-Bound does is empower the analysis
designer to find the sweet spot in this trade-off.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.
Improvements for AI systems
-
Choice-Bound allows an analysis designer to
tune performance by adding extra constraints of the form 'relation R shall never have more than N instances with the same values for fields x,y'
toprevent worst-case blowup of analysis time.
This enables analyses that would not terminate in over 24 or 48 hours to run in sub-hour time. -
The technique introduces a large design space for parameterization, allowing designers to choose between different tuning strategies like
VarPointsTo::(var,ctx)101 [[hobj,hctx]]
to balance precision and cost. This permitsprecise tuning of a bounded computation
by selecting parameters based on the specific analysis requirements. -
The system can handle complex analyses like Doop and symbolic value-flow analysis with minimal changes to the original specification, achieving
speedups typically well over 10x.
This makes previously unscalable analysesentirely realistic, at the expense of a small loss in completeness.
Abstract
In this work, we present a simple, uniform, and elegant solution to the problem, with stunning practical effectiveness and application to virtually any Datalog-based analysis. The approach consists of leveraging the choice construct, supported natively in modern Datalog engines like Soufflé. The choice construct allows the definition of functional dependencies in a relation and has been used in the past for expressing worklist algorithms. We show a near-universal construction that allows the choice construct to flexibly limit evaluation of predicates. The technique is applicable to practically any analysis architecture imaginable, since it adaptively prunes evaluation results when a (programmer-controlled) projection of a relation exceeds a desired cardinality. We apply the technique to probably the largest, pre-existing Datalog analysis frameworks in existence: Doop (for Java bytecode) and the main client analyses from the Gigahorse framework (for Ethereum smart contracts). Without needing to understand the existing analysis logic and with minimal, local-only changes, the performance of each framework increases dramatically, by over 20x for the hardest inputs, with near-negligible sacrifice in completeness.
Sources
Related papers
- AiFlow: Construction-to-Retirement Conformance for Versioned LLM Services
- HPCAgent-Bench: A Framework for Sound Benchmarking of Code-Optimizing Agents, Harnesses, and Skills
- CodeTeam: An LLM-Powered Multi-Agent Framework for Repository-Level Code Generation
- Training Language Model Agents to Find Vulnerabilities with CTF-Dojo
- ArkEval: Benchmarking and Evaluating Automated CodeRepair for ArkTS
- TestPrism: Rethinking Test Evaluation Beyond a Single Reference