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

master thesis: Taming Recursion with Three Context-Sensitive Analyses (Callstring, LoopfreeCallstring, Context Gas) #1340

Merged
merged 176 commits into from
Apr 23, 2024

Conversation

SchiJoha
Copy link
Collaborator

@SchiJoha SchiJoha commented Jan 26, 2024

Implementation of three context-sensitive approaches to tame recursion:

  • call string approach in the Sharir and Pnueli sense: a call stack tracking the last k function calls is simulated and used as context. As elements on the call stack, the function definitions (classical call string) or the statements (similar to call site) are used. We also enable the choice of k = infinity.
  • Loopfree Callstring: similar to call string but with (1) the callee stored in the call stack and (2) loops of the call stack stored in a set. Consequently, the stack elements are function definitions and sets containing function definitions. Overall no function is stored twice in the stack.
  • Context Gas: analyzes the first k calls on the call stack context-sensitive. The remaining calls receive no context information.

For the call-sequence main -> f -> g -> f -> g the approaches would have the following context (and gas):

  • Callstring: (main)-> (main, f) -> (main, f, g) -> (main, f, g, f) -> (main, f, g, f, g)
  • Loopfree: (main)-> (main, f) -> (main, f, g) -> (main, {f, g}) -> (main, {f, g})
  • Context Gas (gas = 2): (Some (main-context)) gas 2 -> (Some (f context)) gas 1 -> (None) gas 0 -> (None) gas 0 -> (None) gas 0

Johanna Schinabeck and others added 30 commits October 19, 2023 10:59
… to update transfer functions (may still need some updates)
…r functions; code is running for simple example, improvement for the int modules need still to be done
…rk properly; only issue:1 decrement too much
…ory (this should make the gobview test work); changed the testcase recursion depth (this should make the regression tests work)
…ice), ana.opt.ctx_gas -> ana.context.ctx_gas; made html output of context gas prettier (by overwriting Prod), added and adapted testcases
@michael-schwarz
Copy link
Member

michael-schwarz commented Apr 17, 2024

Is this ready for a new review (and merging) or are there still things you're working on?

@SchiJoha
Copy link
Collaborator Author

Is this ready for a new review (and merging) or are there still things you're working on?

Yes! It should be ready for review :)

gobview Outdated Show resolved Hide resolved
…d analysis; fixed typo in loopfree callstring comment
gobview Outdated Show resolved Hide resolved
src/analyses/loopfreeCallstring.ml Outdated Show resolved Hide resolved
@sim642 sim642 added this to the v2.4.0 milestone Apr 18, 2024
@michael-schwarz
Copy link
Member

@jerhard @DrMichaelPetter do you still want to review this or should we merge it?

Copy link
Member

@jerhard jerhard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I only have some cosmetical suggestions for the code.

src/analyses/callstring.ml Outdated Show resolved Hide resolved
src/analyses/callstring.ml Outdated Show resolved Hide resolved
src/analyses/loopfreeCallstring.ml Outdated Show resolved Hide resolved
src/config/options.schema.json Outdated Show resolved Hide resolved
src/config/options.schema.json Outdated Show resolved Hide resolved
src/config/options.schema.json Outdated Show resolved Hide resolved
src/config/options.schema.json Outdated Show resolved Hide resolved
@michael-schwarz michael-schwarz merged commit 5a389f4 into goblint:master Apr 23, 2024
12 checks passed
michael-schwarz added a commit that referenced this pull request Apr 23, 2024
sim642 added a commit to sim642/opam-repository that referenced this pull request Aug 2, 2024
CHANGES:

* Remove unmaintained analyses: spec, file (goblint/analyzer#1281).
* Add linear two-variable equalities analysis (goblint/analyzer#1297, goblint/analyzer#1412, goblint/analyzer#1466).
* Add callstring, loopfree callstring and context gas analyses (goblint/analyzer#1038, goblint/analyzer#1340, goblint/analyzer#1379, goblint/analyzer#1427, goblint/analyzer#1439).
* Add non-relational thread-modular value analyses with thread IDs (goblint/analyzer#1366, goblint/analyzer#1398, goblint/analyzer#1399).
* Add NULL byte array domain (goblint/analyzer#1076).
* Fix spurious overflow warnings from internal evaluations (goblint/analyzer#1406, goblint/analyzer#1411, goblint/analyzer#1511).
* Refactor non-definite mutex handling to fix unsoundness (goblint/analyzer#1430, goblint/analyzer#1500, goblint/analyzer#1503, goblint/analyzer#1409).
* Fix non-relational thread-modular value analysis unsoundness with ambiguous points-to sets (goblint/analyzer#1457, goblint/analyzer#1458).
* Fix mutex type analysis unsoundness and enable it by default (goblint/analyzer#1414, goblint/analyzer#1416, goblint/analyzer#1510).
* Add points-to set refinement on mutex path splitting (goblint/analyzer#1287, goblint/analyzer#1343, goblint/analyzer#1374, goblint/analyzer#1396, goblint/analyzer#1407).
* Improve narrowing operators (goblint/analyzer#1502, goblint/analyzer#1540, goblint/analyzer#1543).
* Extract automatic configuration tuning for soundness (goblint/analyzer#1369).
* Fix many locations in witnesses (goblint/analyzer#1355, goblint/analyzer#1372, goblint/analyzer#1400, goblint/analyzer#1403).
* Improve output readability (goblint/analyzer#1294, goblint/analyzer#1312, goblint/analyzer#1405, goblint/analyzer#1497).
* Refactor logging (goblint/analyzer#1117).
* Modernize all library function specifications (goblint/analyzer#1029, goblint/analyzer#688, goblint/analyzer#1174, goblint/analyzer#1289, goblint/analyzer#1447, goblint/analyzer#1487).
* Remove OCaml 4.10, 4.11, 4.12 and 4.13 support (goblint/analyzer#1448).
avsm pushed a commit to avsm/opam-repository that referenced this pull request Sep 5, 2024
CHANGES:

* Remove unmaintained analyses: spec, file (goblint/analyzer#1281).
* Add linear two-variable equalities analysis (goblint/analyzer#1297, goblint/analyzer#1412, goblint/analyzer#1466).
* Add callstring, loopfree callstring and context gas analyses (goblint/analyzer#1038, goblint/analyzer#1340, goblint/analyzer#1379, goblint/analyzer#1427, goblint/analyzer#1439).
* Add non-relational thread-modular value analyses with thread IDs (goblint/analyzer#1366, goblint/analyzer#1398, goblint/analyzer#1399).
* Add NULL byte array domain (goblint/analyzer#1076).
* Fix spurious overflow warnings from internal evaluations (goblint/analyzer#1406, goblint/analyzer#1411, goblint/analyzer#1511).
* Refactor non-definite mutex handling to fix unsoundness (goblint/analyzer#1430, goblint/analyzer#1500, goblint/analyzer#1503, goblint/analyzer#1409).
* Fix non-relational thread-modular value analysis unsoundness with ambiguous points-to sets (goblint/analyzer#1457, goblint/analyzer#1458).
* Fix mutex type analysis unsoundness and enable it by default (goblint/analyzer#1414, goblint/analyzer#1416, goblint/analyzer#1510).
* Add points-to set refinement on mutex path splitting (goblint/analyzer#1287, goblint/analyzer#1343, goblint/analyzer#1374, goblint/analyzer#1396, goblint/analyzer#1407).
* Improve narrowing operators (goblint/analyzer#1502, goblint/analyzer#1540, goblint/analyzer#1543).
* Extract automatic configuration tuning for soundness (goblint/analyzer#1369).
* Fix many locations in witnesses (goblint/analyzer#1355, goblint/analyzer#1372, goblint/analyzer#1400, goblint/analyzer#1403).
* Improve output readability (goblint/analyzer#1294, goblint/analyzer#1312, goblint/analyzer#1405, goblint/analyzer#1497).
* Refactor logging (goblint/analyzer#1117).
* Modernize all library function specifications (goblint/analyzer#1029, goblint/analyzer#688, goblint/analyzer#1174, goblint/analyzer#1289, goblint/analyzer#1447, goblint/analyzer#1487).
* Remove OCaml 4.10, 4.11, 4.12 and 4.13 support (goblint/analyzer#1448).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for k-callstring & Evaluate different approaches to context-sensitivity
4 participants