Symbolic Synthesis of Distinguishing Test Batches for Specification Narrowing

arXiv:2511.19177 · cs.SE · Submitted 2025-11-24 · Read on arXiv

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: We're looking at the paper: "Symbolic Synthesis of Distinguishing Test Batches for Specification Narrowing".

Paper summary: Tom: So we're looking at this paper today titled "Symbolic Synthesis of Distinguishing Test Batches for Specification Narrowing". Basically they're trying to figure out how to pick the best formal specification when you have a bunch of alternatives.

Jane: Right, so the main goal is generating these test cases that let you narrow down that set of specifications to just one winner by having you mark which ones look good or not.

Lu: It tackles this problem of synthesizing a minimal narrowing test suite for a set of non-equivalent formulas, which means we need enough tests to guarantee at most one winner, and the lower bound for that minimal set size is log base two N > Page three <ref:2511.19177#pg3>.

Meng: So it's about finding the right number of tests efficiently. I wonder if this is just theoretical stuff because it doesn't address what happens when you have a huge number of specifications in production.

Lalam: I see they propose two ways to do this: one that always makes the minimal test suite, and another that isn't guaranteed to be minimal > Page three <ref:2511.19177#pg3>.

Tom: And the non-optimal one is implemented as a direct approach to proving the upper bound on how big that minimal set can get, which might return fewer than N minus one instances sometimes even hitting that optimal number > Page eight.

Jane: That makes sense, so they show you a way to generate these test suites, and while the non-optimal version might not be perfect in size, it can still handle dozens of candidate specifications within a sixty second timeout on public data like the Alloy4Fun set > Page four.

Lu: The evaluation showed that even with this non-optimal algorithm, the average size of that test suite grows at a logarithmic rate > Page four.

Meng: Logarithmic growth is good for scaling, but what about the runtime? I saw something about quadratic growth in execution time for that non-optimal strategy when testing all problems in the benchmark > Page four. That sounds like it could get expensive fast.

Paper summary: Tom: Yeah, so while it works for a set of specifications, if you have too many inputs, the time needed to run those test suites goes up quadratically with the number of specifications > Page four.

Jane: It’s interesting because they used this approach to solve a problem where requirements are weak and multiple repairs can exist, which is why narrowing down those candidates is tricky > Page two <ref:2511.19177#pg2>.

Lu: They also mentioned that this technique can be extended to other formal specification languages where you can automate the analysis by translating it into a SAT solver > Page six.

Meng: Automating translation to SAT sounds powerful for scaling up the analysis, but what about deployment? I need to know if running this on real traffic scenarios is practical, because testing all those combinations sounds like a heavy load on our systems > Page ten <ref:2511.19177#pg2>.

Lalam: The prototype they built for Alloy used translation to off-the-shelf SAT solvers for bounded analysis > Page ten <ref:2511.19177#pg2>.

Tom: They actually relied on something called AlloyMax, which is an extension of Alloy that does the analysis by translating it to PM-SAT solvers for the optimal Algorithm two > Page ten <ref:2511.19177#pg2>.

Jane: So they have two main paths here: one aiming for minimal test suites using an optimal algorithm, and another that's faster but not guaranteed to be minimal > Page three <ref:2511.19177#pg3>.

Lu: The paper also mentions the inspiration came from work on narrowing down program candidates generated by synthesis or repair procedures from weak specifications, specifically Shriver et al. twenty-three, which synthesized new inputs for which the user must provide the desired output > Page six.

Meng: So they're not just inventing this out of thin air; it builds on existing ideas about synthesizing inputs when you don't have perfect requirements > Page five.

Tom: It’s about using symbolic synthesis to help you choose the right specification when the requirements are ambiguous > Page two <ref:2511.19177#pg2>.

Paper summary: Jane: So, if a person were driving and they had to pick between three different road maps, this technique helps them generate test drives that quickly tell them which map is actually usable and which one isn't > Page one <ref:2511.19177#pg1>.

Lu: The implication is that we can use these symbolic techniques to automate the selection of the best design candidate among many possibilities > Page six.

Meng: From my side, I just wonder how much effort it takes to set up this symbolic synthesis system before you even start running tests on real data > Page ten <ref:2511.19177#pg2>.

Lalam: It seems they are trying to make that setup process manageable by generating the test suite in a single call to the PM-SAT solver, creating all those required instances at once > Page six.

Tom: So, looking at it from a practical standpoint for deployment, we've got these ideas for how to systematically reduce our candidate pool using formal methods > Page one <ref:2511.19177#pg1>.

Jane: The paper itself is titled "Symbolic Synthesis of Distinguishing Test Batches for Specification Narrowing", and the authors are Alcino Cunha and Nuno Macedo from INESC TEC and Universidade do Minho in Portugal > Page one <ref:2511.19177#pg1>.

Lu: Ultimately, this work proposes a technique to help choose the best formal specification candidate among a set of alternatives by generating test cases that narrow down the set to at most one specification > Page one <ref:2511.19177#pg1,proposes a technique to help choose the best formal specification candidate among>.

Meng: It feels like they're providing a toolkit for when you've got too many ways to build something and need an automated way to prune them > Page one <ref:2511.19177#pg1>.

Tom: They showed that the optimal algorithm is efficient enough for many practical problems, while the non-optimal one can handle dozens of candidates within a sixty second timeout on the benchmark data > Page four.

Jane: So, what this means for us is that we have a way to systematically explore design space when requirements aren't totally clear, using formal methods to guide our selection process > Page two <ref:2511.19177#pg2>.

Conclusion: Tom: So we're wrapping up our look at this paper, "Symbolic Synthesis of Distinguishing Test Batches for Specification Narrowing." Basically, they've developed a technique to automatically pick the best formal specification when you have a whole set of alternatives.

Jane: It sounds like they’ve created a system that generates test cases to narrow down that bunch of options so you only end up with one correct one. What does that mean for someone just trying to build something?

Lu: The core idea is synthesizing a minimal test suite, which means finding the smallest set of tests required to guarantee you can distinguish between the different specifications.

Meng: I'm still thinking about how much effort it takes to actually run these suites on real production data, because if they're slow, it doesn't matter how smart the synthesis is.

Lalam: The paper shows that while there are two ways to generate those test cases—one that’s guaranteed minimal and one that isn't—both methods can handle a lot of specifications within a sixty second time limit on benchmark data.

Tom: That non-minimal approach, the one they call the direct implementation, it seems like it can get away with synthesizing enough tests to narrow things down even if it’s not the absolute smallest set possible.

Jane: So, what’s the big picture here? This technique is about using formal methods to automate a decision that humans currently have to make by testing many possibilities manually.

Lu: It shows that this idea of synthesizing test cases to prune candidates isn't new; it builds on earlier work about finding inputs for weak specifications, but this paper makes the synthesis process more systematic and efficient.

Meng: It’s a tool for when you have too many ways to build something and you need an automated way to prune them before deployment.

Tom: The authors used Alloy4Fun data for their tests, which is publicly available, so it’s not just some theoretical thing floating in the air.

Jane: And they also mentioned that this approach can be translated into a SAT solver for other formal languages, meaning the method isn't just stuck on Alloy.

Lu: The implication is that you could potentially automate the selection of the best design candidate across many possibilities using this kind of symbolic synthesis framework.

INESC TEC · Universidade do Minho

cs.SE

Submitted: 2025-11-24

Updated: 2026-12-02

Code: https://github.com/haslab/Specification-Narrowing

Project page: https://practicalalloy.github.io

License: http://creativecommons.org/licenses/by/4.0/

Importance score: 77/100

The gist: This paper proposes a technique to help choose the best formal specification candidate among a set of alternatives by generating test cases that narrow down the set to at most one…

Key concepts

Minimal Narrowing Test Suite
This is a set of tests designed to distinguish between different formal specifications. The goal is to create a set small enough that after users classify the results, only one specification remains as the best candidate. The theoretical minimum size for this set is log2 N.
Optimal Synthesis Strategy
This strategy aims to always generate the smallest possible test suite required for narrowing down candidates. It is considered ideal because it guarantees minimality in terms of the number of test cases needed to achieve the goal, though its implementation might be complex.
Non-optimal Synthesis Strategy
This is a simpler method used to prove an upper bound on the minimal set size. While it doesn't guarantee minimality, it is easier to implement. The paper shows this strategy can produce test suites of varying sizes, sometimes achieving the optimal number.
PM-SAT Solver Translation
The prototype implementation translates formal specification analysis into problems solvable by PM-SAT solvers. This allows the system to efficiently generate all necessary test instances in a single call, which is crucial for performance.

Terminology

Summary

This paper proposes a technique to help choose the best formal specification candidate among a set of alternatives by generating test cases that narrow down the set to at most one specification. p. 0

Where the paper says it

This paper proposes a technique to help choose the best formal specification candidate among a set of alternatives. Given a set of specifications, our technique generates a suite of test cases that, once classified by the user as desirable or not, narrows down the set of candidates to at most one specification.

<ref:2511.19177#pg2, Given a set of specifications, our technique generates a suite of test cases that, once classified by the user as desirable or not, narrows down the set of candidates to at most one specification>. p. 0
Where the paper says it

This paper proposes a technique to help choose the best formal specification candidate among a set of alternatives. Given a set of specifications, our technique generates a suite of test cases that, once classified by the user as desirable or not, narrows down the set of candidates to at most one specification.

Problem Formulation and Objectives

The core problem addressed is synthesizing a minimal narrowing test suite for a set of non-equivalent formulas.<ref:2511.19177#pg3>. This condition ensures that the set of instances T is sufficient to narrow down the set of input formulas to at most one winner. p. 5

Where the paper says it

Cunha and N. Macedo This condition ensures that the set of instances T is sufficient to narrow down the set of input formulas to at most one winner, because there cannot be two formulas that are valid for the exact same subset of instances.

<ref:2511.19177#pg3>. The lower-bound for a minimal narrowing set T is obviously T = log2 N (and it occurred in the example of the previous section). p. 5
Where the paper says it

The exception are candidate sets F for which |T| = log2 N: here there are 2 |T| = N possible classifications, and since no two ϕi may hold for the same classification, each classification corresponds to exactly one formula from F. For the same reason, the lower-bound for a minimal narrowing set T is obviously |T| = log2 N (and it occurred in the example of the previous section): with fewer instances there would not be sufficient classifications to cover all N formulas.

p. 5
Where the paper says it

The exception are candidate sets F for which |T| = log2 N: here there are 2 |T| = N possible classifications, and since no two ϕi may hold for the same classification, each classification corresponds to exactly one formula from F. For the same reason, the lower-bound for a minimal narrowing set T is obviously |T| = log2 N (and it occurred in the example of the previous section): with fewer instances there would not be sufficient classifications to cover all N formulas.

<ref:2511.19177#pg3>.

Synthesis Strategies

Two synthesis strategies are introduced for generating this test suite: an optimal one that always generates a minimal test suite, and a non-optimal one that does not ensure minimality.<ref:2511.19177#pg3>. The non-optimal synthesis algorithm is a direct implementation of the strategy described above for proving the upper-bound on the size of the minimal narrowing set. p. 5

Where the paper says it

If these need to be classified by a domain expert, then a single interaction is needed. 2 A non-optimal synthesis algorithm The non-optimal synthesis algorithm is a direct implementation of the strategy described above for proving the upper-bound on the size of the minimal narrowing set.

<ref:2511.19177#pg8>. This non-optimal strategy might return less than N − 1 instances, sometimes even the optimal number of instances. p. 6
Where the paper says it

, ϕN } ∧ N > 1 ∧ V = S {fv(ϕi) | 1 ≤ i ≤ N} Require: ∀ϕi, ϕj ∈ F | i ̸= j → ∃I ⊆ V · I |= ϕi ↔ I ̸|= ϕj Ensure: |T| < N ∧ ∀I ∈ T · I ⊆ V Ensure: ∀ϕi, ϕj ∈ F | i ̸= j → ∃I ∈ T · I |= ϕi ↔ I ̸|= ϕj 1: S ← {F} 2: T ← ∅ 3: while S ̸= ∅ do 4: C ← choose(S) 5: S ← S \ {C} 6: U ← {I ∈ T | I |= W C ∧ ¬ V C} 7: if U ̸= ∅ then ▷ Check if a previous instance can be reused 8: I ← choose(U) 9: else ▷ If not generate a new one 10: I ← solve(V, W C ∧ ¬ V C) 11: end if 12: T ← T ∪ {I} 13: CP ← {ϕ ∈ C | I |= ϕ} 14: if |CP | > 1 then 15: S ← S ∪ {CP } 16: end if 17: CN ← C \ CP 18: if CN > 1 then 19: S ← S ∪ {CN } 20: end if 21: end while might return less than N − 1 instances, sometimes even the optimal number of instances. This non-optimal synthesis strategy is implemented in Algorithm 1.

<ref:2511.19177#pg8>.

Evaluation and Results

The evaluation used publicly available data from the Alloy4Fun dataset to answer research questions regarding execution time growth with the number of specifications.<ref:2511.19177#pg4>. The results show that while the non-optimal algorithm can synthesize test suites for all problems in the benchmark within a 60s timeout, its execution time grows at a quadratic rate. p. 0

Where the paper says it

Both algorithms were implemented in a prototype that can be used generate test suites to help choose among alternative Alloy specifications. Our evaluation of this prototype against a large set of problems showed that the optimal algorithm is efficient enough for many practical problems, and that the non-optimal algorithm can scale up to dozens of candidate specifications while still generating reasonably sized test suites.

p. 0
Where the paper says it

Both algorithms were implemented in a prototype that can be used generate test suites to help choose among alternative Alloy specifications. Our evaluation of this prototype against a large set of problems showed that the optimal algorithm is efficient enough for many practical problems, and that the non-optimal algorithm can scale up to dozens of candidate specifications while still generating reasonably sized test suites.

<ref:2511.19177#pg4>. Concerning RQ2, both algorithms show that the average size of the test suite |T| increases at a logarithmic rate.<ref:2511.19177#pg4>.

Prototype and Future Directions

The prototype implementation was developed for Alloy, relying on translation to off-the-shelf SAT solvers for bounded analysis.<ref:2511.19177#pg10, For the optimal Algorithm 2 we relied on AlloyMax [28], an extension of Alloy for modeling optimization problems that performs the analysis by translation to PM-SAT solvers>. p. 9

Where the paper says it

This bounded analysis is done via translation to off-the-shelf SAT solvers, so it is possible to implement the non-optimal Algorithm 1 almost directly. For the optimal Algorithm 2 we relied on AlloyMax [28], an extension of Alloy for modeling optimization problems, that performs the analysis by translation to PM-SAT solvers.

The paper intends to explore search-based techniques developed for other applications to obtain a more efficient optimal (or near optimal) synthesis algorithm. p. 0
Where the paper says it

Our evaluation of this prototype against a large set of problems showed that the optimal algorithm is efficient enough for many practical problems, and that the non-optimal algorithm can scale up to dozens of candidate specifications while still generating reasonably sized test suites. Keywords: Formal design exploration · Test case synthesis · Alloy 1 Introduction When developing a formal model, we often encounter situations that require selecting a preferred specification from among several alternative candidates.

<ref:2511.19177#pg6>. The technique can also be extended to other formal specification languages where analysis can be automated by translation to SAT. p. 9
Where the paper says it

The automatic analysis of Alloy models is possible because, as seen in Section 2, commands have a scope that limits the size of the domain of discourse. This bounded analysis is done via translation to off-the-shelf SAT solvers, so it is possible to implement the non-optimal Algorithm 1 almost directly.

p. 9
Where the paper says it

The automatic analysis of Alloy models is possible because, as seen in Section 2, commands have a scope that limits the size of the domain of discourse. This bounded analysis is done via translation to off-the-shelf SAT solvers, so it is possible to implement the non-optimal Algorithm 1 almost directly.

<ref:2511.19177#pg6>.

References

The paper references numerous works related to formal methods and test case synthesis.<ref:2511.19177#pg16, Alhanahnah, M., Rashedul Hasan, M., Xu, L., Bagheri, H.: An empirical evaluation of pre-trained large language models for repairing declarative formal specifications. p. 1

Where the paper says it

These techniques could easily be adapted to return a set of repair candidates instead of single repair, but then some technique would be needed to help the user narrow down that set and choose the preferred one. With the rapid improvement of large language models, autoformalization techniques are also becoming popular [26], targeting a variety of formal languages, including Alloy [11].

p. 1
Where the paper says it

These techniques could easily be adapted to return a set of repair candidates instead of single repair, but then some technique would be needed to help the user narrow down that set and choose the preferred one. With the rapid improvement of large language models, autoformalization techniques are also becoming popular [26], targeting a variety of formal languages, including Alloy [11].

Empirical Software Engineering 30(5), 1–38 (2025>, Barros, A. p. 0
Where the paper says it

19177v1 [cs. SE] 24 Nov 2025

p. 0
Where the paper says it

19177v1 [cs. SE] 24 Nov 2025

, Neto, H., Cunha, A. p. 1
Where the paper says it

Cunha and N. Macedo stop once they find a candidate repair that satisfies all requirements.

p. 1
Where the paper says it

Cunha and N. Macedo stop once they find a candidate repair that satisfies all requirements.

p. 1
Where the paper says it

Cunha and N. Macedo stop once they find a candidate repair that satisfies all requirements.

p. 1
Where the paper says it

Cunha and N. Macedo stop once they find a candidate repair that satisfies all requirements.

p. 1
Where the paper says it

Cunha and N. Macedo stop once they find a candidate repair that satisfies all requirements.

p. 1
Where the paper says it

Cunha and N. Macedo stop once they find a candidate repair that satisfies all requirements.

p. 1
Where the paper says it

Cunha and N. Macedo stop once they find a candidate repair that satisfies all requirements.

p. 1
Where the paper says it

Cunha and N. Macedo stop once they find a candidate repair that satisfies all requirements.

, Macedo, N. p. 1
Where the paper says it

Cunha and N. Macedo stop once they find a candidate repair that satisfies all requirements.

p. 1
Where the paper says it

Cunha and N. Macedo stop once they find a candidate repair that satisfies all requirements.

p. 1
Where the paper says it

Cunha and N. Macedo stop once they find a candidate repair that satisfies all requirements.

p. 1
Where the paper says it

Cunha and N. Macedo stop once they find a candidate repair that satisfies all requirements.

p. 1
Where the paper says it

Cunha and N. Macedo stop once they find a candidate repair that satisfies all requirements.

p. 1
Where the paper says it

Cunha and N. Macedo stop once they find a candidate repair that satisfies all requirements.

, Paiva, A.C.: Alloy repair hint generation based on historical data. p. 0
Where the paper says it

Two alternative solver-based algorithms are proposed, one that generates a minimal test suite, and another that does not ensure minimality. Both algorithms were implemented in a prototype that can be used generate test suites to help choose among alternative Alloy specifications.

p. 0
Where the paper says it

Two alternative solver-based algorithms are proposed, one that generates a minimal test suite, and another that does not ensure minimality. Both algorithms were implemented in a prototype that can be used generate test suites to help choose among alternative Alloy specifications.

In: International Symposium on Formal Methods. p. 0
Where the paper says it

Selecting the best specification by manually inspecting candidates is often burdensome, or even unfeasible with automatic techniques that may generate dozens of alternatives. Obviously, this problem is not specific to formal methods, and is known for techniques like automatic program synthesis or repair.

p. 0
Where the paper says it

Selecting the best specification by manually inspecting candidates is often burdensome, or even unfeasible with automatic techniques that may generate dozens of alternatives. Obviously, this problem is not specific to formal methods, and is known for techniques like automatic program synthesis or repair.

pp. 104–121. Springer (2024), Brida, S.G., Regis, G., Zheng, G., Bagheri, H., Nguyen, T., Aguirre, N., Frias, M.: BeAFix: an automated repair tool for faulty Alloy models. p. 1
Where the paper says it

These techniques could easily be adapted to return a set of repair candidates instead of single repair, but then some technique would be needed to help the user narrow down that set and choose the preferred one. With the rapid improvement of large language models, autoformalization techniques are also becoming popular [26], targeting a variety of formal languages, including Alloy [11].

p. 1
Where the paper says it

These techniques could easily be adapted to return a set of repair candidates instead of single repair, but then some technique would be needed to help the user narrow down that set and choose the preferred one. With the rapid improvement of large language models, autoformalization techniques are also becoming popular [26], targeting a variety of formal languages, including Alloy [11].

In: 2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE). p. 3
Where the paper says it

For example, if both scenarios are considered valid then an expect 1 should be added to both commands. By iterating over the candidate fixes after this classification, the user can see that the only KeyPolicyFix2 meets the expectations for both test cases, and is thus the desired repair (this procedure can, of course, be automated).

p. 3
Where the paper says it

For example, if both scenarios are considered valid then an expect 1 should be added to both commands. By iterating over the candidate fixes after this classification, the user can see that the only KeyPolicyFix2 meets the expectations for both test cases, and is thus the desired repair (this procedure can, of course, be automated).

pp. 1213–1217. IEEE (2021), Cerqueira, J., Cunha, A., Macedo, N.: Timely specification repair for Alloy 6. p. 0
Where the paper says it

In the formal methods community, specification repair is also becoming increasingly popular. Just for the Alloy formal specification language [13,14], several techniques have been proposed recently [29,25,2,10,3,4,1].

p. 0
Where the paper says it

In the formal methods community, specification repair is also becoming increasingly popular. Just for the Alloy formal specification language [13,14], several techniques have been proposed recently [29,25,2,10,3,4,1].

In: International Conference on Software Engineering and Formal Methods. p. 0
Where the paper says it

Selecting the best specification by manually inspecting candidates is often burdensome, or even unfeasible with automatic techniques that may generate dozens of alternatives. Obviously, this problem is not specific to formal methods, and is known for techniques like automatic program synthesis or repair.

p. 0
Where the paper says it

Selecting the best specification by manually inspecting candidates is often burdensome, or even unfeasible with automatic techniques that may generate dozens of alternatives. Obviously, this problem is not specific to formal methods, and is known for techniques like automatic program synthesis or repair.

pp. 288–303. Springer (2022), Cha, B., Iwama, K., Kambayashi, Y., Miyazaki, S.: Local search algorithms for partial MAXSAT. p. 2
Where the paper says it

1: An Alloy model with a buggy specification 2 Overview of the technique Consider the Alloy model in Figure 1, very similar to the one presented in [29] to motivate the ATR specification repair tool. An Alloy model consists of a set of signature and field declarations, facts with assumptions, auxiliary predicates and functions, and analysis commands, either check commands to verify assertions, or run commands to search for instances satisfying some constrain.

p. 2
Where the paper says it

1: An Alloy model with a buggy specification 2 Overview of the technique Consider the Alloy model in Figure 1, very similar to the one presented in [29] to motivate the ATR specification repair tool. An Alloy model consists of a set of signature and field declarations, facts with assumptions, auxiliary predicates and functions, and analysis commands, either check commands to verify assertions, or run commands to search for instances satisfying some constrain.

AAAI/IAAI 263268, 9 (1997), Cunha, A. p. 1
Where the paper says it

Cunha and N. Macedo stop once they find a candidate repair that satisfies all requirements.

p. 1
Where the paper says it

Cunha and N. Macedo stop once they find a candidate repair that satisfies all requirements.

, Macedo, N.: Validating formal specifications with LLM-generated test cases (2025), https://arxiv. p. 1
Where the paper says it

All this makes the technique more amenable to situations where test cases are classified offline by a domain expert. Specifically, the contributions of this paper are the following: – A formal characterization of the problem of generating a test case suite for narrowing down specification candidates; – Two alternative solver-based algorithms for synthesizing a narrowing test suite, one that ensures minimality of the suite, and another that does not; – An implementation of both algorithms in a prototype that can be used to generate test suites to help choose among alternative Alloy specifications; – An evaluation of this prototype against a large set of problems to assess its effectiveness, both in terms of efficiency and size of the generated test suite.

p. 1
Where the paper says it

All this makes the technique more amenable to situations where test cases are classified offline by a domain expert. Specifically, the contributions of this paper are the following: – A formal characterization of the problem of generating a test case suite for narrowing down specification candidates; – Two alternative solver-based algorithms for synthesizing a narrowing test suite, one that ensures minimality of the suite, and another that does not; – An implementation of both algorithms in a prototype that can be used to generate test suites to help choose among alternative Alloy specifications; – An evaluation of this prototype against a large set of problems to assess its effectiveness, both in terms of efficiency and size of the generated test suite.

org/abs/2510.23350, Hong, Y., Jiang, S., Fu, Y., Khurshid, S.: On the effectiveness of large language models in writing Alloy formulas. p. 1
Where the paper says it

These techniques could easily be adapted to return a set of repair candidates instead of single repair, but then some technique would be needed to help the user narrow down that set and choose the preferred one. With the rapid improvement of large language models, autoformalization techniques are also becoming popular [26], targeting a variety of formal languages, including Alloy [11].

p. 1
Where the paper says it

These techniques could easily be adapted to return a set of repair candidates instead of single repair, but then some technique would be needed to help the user narrow down that set and choose the preferred one. With the rapid improvement of large language models, autoformalization techniques are also becoming popular [26], targeting a variety of formal languages, including Alloy [11].

arXiv preprint arXiv:2502. p. 0
Where the paper says it

Just for the Alloy formal specification language [13,14], several techniques have been proposed recently [29,25,2,10,3,4,1]. These techniques arXiv:2511.

p. 0
Where the paper says it

Just for the Alloy formal specification language [13,14], several techniques have been proposed recently [29,25,2,10,3,4,1]. These techniques arXiv:2511.

15441 (2025), Hsu, H. p. 0
Where the paper says it

19177v1 [cs. SE] 24 Nov 2025

p. 0
Where the paper says it

19177v1 [cs. SE] 24 Nov 2025

Y., Orso, A.: MINTS: A general framework and tool for supporting testsuite minimization. p. 2
Where the paper says it

opens } assert Secure { all p : Person { CanEnter[p, SecureLab] implies p in Researcher } } check Secure for 2 expect 0 Fig. 1: An Alloy model with a buggy specification 2 Overview of the technique Consider the Alloy model in Figure 1, very similar to the one presented in [29] to motivate the ATR specification repair tool.

p. 2
Where the paper says it

opens } assert Secure { all p : Person { CanEnter[p, SecureLab] implies p in Researcher } } check Secure for 2 expect 0 Fig. 1: An Alloy model with a buggy specification 2 Overview of the technique Consider the Alloy model in Figure 1, very similar to the one presented in [29] to motivate the ATR specification repair tool.

In: 2009 IEEE 31st international conference on software engineering. pp. 419–429. IEEE (2009), Jackson, D.: Software Abstractions: Logic, language, and analysis. p. 9
Where the paper says it

1 Prototype implementation Although our algorithms were presented for propositional logic, we prototyped them for the more high-level first-order relational logic of Alloy. The automatic analysis of Alloy models is possible because, as seen in Section 2, commands have a scope that limits the size of the domain of discourse.

p. 9
Where the paper says it

1 Prototype implementation Although our algorithms were presented for propositional logic, we prototyped them for the more high-level first-order relational logic of Alloy. The automatic analysis of Alloy models is possible because, as seen in Section 2, commands have a scope that limits the size of the domain of discourse.

MIT press (2012), Jackson, D.: Alloy: A language and tool for exploring software designs. p. 0
Where the paper says it

In the formal methods community, specification repair is also becoming increasingly popular. Just for the Alloy formal specification language [13,14], several techniques have been proposed recently [29,25,2,10,3,4,1].

p. 0
Where the paper says it

In the formal methods community, specification repair is also becoming increasingly popular. Just for the Alloy formal specification language [13,14], several techniques have been proposed recently [29,25,2,10,3,4,1].

Communications of the ACM 62(9), 66–76 (2019), Khan, S.U.R., Lee, S.P., Javaid, N., Abdul, W.: A systematic review on test suite reduction: Approaches, experiment’s quality evaluation, and guidelines. p. 1
Where the paper says it

All this makes the technique more amenable to situations where test cases are classified offline by a domain expert. Specifically, the contributions of this paper are the following: – A formal characterization of the problem of generating a test case suite for narrowing down specification candidates; – Two alternative solver-based algorithms for synthesizing a narrowing test suite, one that ensures minimality of the suite, and another that does not; – An implementation of both algorithms in a prototype that can be used to generate test suites to help choose among alternative Alloy specifications; – An evaluation of this prototype against a large set of problems to assess its effectiveness, both in terms of efficiency and size of the generated test suite.

p. 1
Where the paper says it

All this makes the technique more amenable to situations where test cases are classified offline by a domain expert. Specifically, the contributions of this paper are the following: – A formal characterization of the problem of generating a test case suite for narrowing down specification candidates; – Two alternative solver-based algorithms for synthesizing a narrowing test suite, one that ensures minimality of the suite, and another that does not; – An implementation of both algorithms in a prototype that can be used to generate test suites to help choose among alternative Alloy specifications; – An evaluation of this prototype against a large set of problems to assess its effectiveness, both in terms of efficiency and size of the generated test suite.

IEEE Access 6, 11816–11841 (2018), Kitamura, T. p. 2
Where the paper says it

An Alloy model consists of a set of signature and field declarations, facts with assumptions, auxiliary predicates and functions, and analysis commands, either check commands to verify assertions, or run commands to search for instances satisfying some constrain. This example models a room access control problem.

p. 2
Where the paper says it

An Alloy model consists of a set of signature and field declarations, facts with assumptions, auxiliary predicates and functions, and analysis commands, either check commands to verify assertions, or run commands to search for instances satisfying some constrain. This example models a room access control problem.

, Maissonneuve, Q., Choi, E.H., Artho, C., Gargantini, A.: Optimal test suite generation for modified condition decision coverage using SAT solving. p. 6
Where the paper says it

It also trivially ensures the condition that T is a narrowing test set, being the instance I that distinguishes a pair of formulas ϕi and ϕj the one in the first common ancestor internal node of the decision tree that is implicitly being constructed. The algorithm relies on a SAT solver to generate instances satisfying a propositional formula.

p. 6
Where the paper says it

It also trivially ensures the condition that T is a narrowing test set, being the instance I that distinguishes a pair of formulas ϕi and ϕj the one in the first common ancestor internal node of the decision tree that is implicitly being constructed. The algorithm relies on a SAT solver to generate instances satisfying a propositional formula.

In: International Conference on Computer Safety, Reliability, and Security. pp. 123–138. Springer (2018), Macedo, N. p. 1
Where the paper says it

Cunha and N. Macedo stop once they find a candidate repair that satisfies all requirements.

p. 1
Where the paper says it

Cunha and N. Macedo stop once they find a candidate repair that satisfies all requirements.

, Cunha, A.: Alloy4Fun semantic entries (2025). p. 0
Where the paper says it

19177v1 [cs. SE] 24 Nov 2025

p. 0
Where the paper says it

19177v1 [cs. SE] 24 Nov 2025

https://doi.org/10.5281/zenodo.17392203, Macedo, N. p. 1
Where the paper says it

Cunha and N. Macedo stop once they find a candidate repair that satisfies all requirements.

p. 1
Where the paper says it

Cunha and N. Macedo stop once they find a candidate repair that satisfies all requirements.

, Cunha, A., Paiva, A.C.R.: Alloy4Fun dataset for 2024/25 (2025). p. 0
Where the paper says it

19177v1 [cs. SE] 24 Nov 2025

p. 0
Where the paper says it

19177v1 [cs. SE] 24 Nov 2025

https://doi.10.5281/zenodo.17390557, Moret, B.M., Shapiro, H.D.: On minimizing a set of tests. p. 0
Where the paper says it

pt Abstract. This paper proposes a technique to help choose the best formal specification candidate among a set of alternatives.

p. 0
Where the paper says it

pt Abstract. This paper proposes a technique to help choose the best formal specification candidate among a set of alternatives.

SIAM Journal on Scientific and Statistical Computing 6(4), 983–1003 (1985), Pei, Y., Furia, C.A., Nordio, M., Meyer, B.: Automated program repair in an integrated development environment. p. 3
Where the paper says it

For example, if both scenarios are considered valid then an expect 1 should be added to both commands. By iterating over the candidate fixes after this classification, the user can see that the only KeyPolicyFix2 meets the expectations for both test cases, and is thus the desired repair (this procedure can, of course, be automated).

p. 3
Where the paper says it

For example, if both scenarios are considered valid then an expect 1 should be added to both commands. By iterating over the candidate fixes after this classification, the user can see that the only KeyPolicyFix2 meets the expectations for both test cases, and is thus the desired repair (this procedure can, of course, be automated).

In: ICSE (2). pp. 681–684. IEEE Computer Society (2015), Shriver, D., Elbaum, S., Stolee, K.T.: At the end of synthesis: narrowing program candidates. p. 6
Where the paper says it

Synthesizing Test Cases for Narrowing Specification Candidates 7 Algorithm 1 Non-optimal synthesis Require: F = {ϕ1, . , ϕN } ∧ N > 1 ∧ V = S {fv(ϕi) | 1 ≤ i ≤ N} Require: ∀ϕi, ϕj ∈ F | i ̸= j → ∃I ⊆ V · I |= ϕi ↔ I ̸|= ϕj Ensure: |T| < N ∧ ∀I ∈ T · I ⊆ V Ensure: ∀ϕi, ϕj ∈ F | i ̸= j → ∃I ∈ T · I |= ϕi ↔ I ̸|= ϕj 1: S ← {F} 2: T ← ∅ 3: while S ̸= ∅ do 4: C ← choose(S) 5: S ← S \ {C} 6: U ← {I ∈ T | I |= W C ∧ ¬ V C} 7: if U ̸= ∅ then ▷ Check if a previous instance can be reused 8: I ← choose(U) 9: else ▷ If not generate a new one 10: I ← solve(V, W C ∧ ¬ V C) 11: end if 12: T ← T ∪ {I} 13: CP ← {ϕ ∈ C | I |= ϕ} 14: if |CP | > 1 then 15: S ← S ∪ {CP } 16: end if 17: CN ← C \ CP 18: if CN > 1 then 19: S ← S ∪ {CN } 20: end if 21: end while might return less than N − 1 instances, sometimes even the optimal number of instances.

p. 6
Where the paper says it

Synthesizing Test Cases for Narrowing Specification Candidates 7 Algorithm 1 Non-optimal synthesis Require: F = {ϕ1, . , ϕN } ∧ N > 1 ∧ V = S {fv(ϕi) | 1 ≤ i ≤ N} Require: ∀ϕi, ϕj ∈ F | i ̸= j → ∃I ⊆ V · I |= ϕi ↔ I ̸|= ϕj Ensure: |T| < N ∧ ∀I ∈ T · I ⊆ V Ensure: ∀ϕi, ϕj ∈ F | i ̸= j → ∃I ∈ T · I |= ϕi ↔ I ̸|= ϕj 1: S ← {F} 2: T ← ∅ 3: while S ̸= ∅ do 4: C ← choose(S) 5: S ← S \ {C} 6: U ← {I ∈ T | I |= W C ∧ ¬ V C} 7: if U ̸= ∅ then ▷ Check if a previous instance can be reused 8: I ← choose(U) 9: else ▷ If not generate a new one 10: I ← solve(V, W C ∧ ¬ V C) 11: end if 12: T ← T ∪ {I} 13: CP ← {ϕ ∈ C | I |= ϕ} 14: if |CP | > 1 then 15: S ← S ∪ {CP } 16: end if 17: CN ← C \ CP 18: if CN > 1 then 19: S ← S ∪ {CN } 20: end if 21: end while might return less than N − 1 instances, sometimes even the optimal number of instances.

In: 2017 IEEE/ACM 39th International Conference on Software Engineering: New Ideas and Emerging Technologies Results Track (ICSE-NIER). pp. 19–22. IEEE (2017), Sullivan, A., Wang, K., Zaeem, R.N., Khurshid, S.: Automated test generation and mutation testing for Alloy. p. 3
Where the paper says it

For example, if both scenarios are considered valid then an expect 1 should be added to both commands. By iterating over the candidate fixes after this classification, the user can see that the only KeyPolicyFix2 meets the expectations for both test cases, and is thus the desired repair (this procedure can, of course, be automated).

p. 3
Where the paper says it

For example, if both scenarios are considered valid then an expect 1 should be added to both commands. By iterating over the candidate fixes after this classification, the user can see that the only KeyPolicyFix2 meets the expectations for both test cases, and is thus the desired repair (this procedure can, of course, be automated).

In: 2017 IEEE International Conference on Software Testing, Verification and Validation (ICST). pp. 264–275. IEEE (2017), Wang, K., Sullivan, A., Khurshid, S.: ARepair: A repair framework for Alloy. p. 0
Where the paper says it

In the formal methods community, specification repair is also becoming increasingly popular. Just for the Alloy formal specification language [13,14], several techniques have been proposed recently [29,25,2,10,3,4,1].

p. 0
Where the paper says it

In the formal methods community, specification repair is also becoming increasingly popular. Just for the Alloy formal specification language [13,14], several techniques have been proposed recently [29,25,2,10,3,4,1].

In: 2019 IEEE/ACM 41st International Conference on Software Engineering: Companion Proceedings (ICSE-Companion). pp. 103–106. IEEE (2019), Weng, K., Du, L., Li, S., Lu, W., Sun, H., Liu, H., Zhang, T.: Autoformalization in the era of large language models: A survey. p. 1
Where the paper says it

These techniques could easily be adapted to return a set of repair candidates instead of single repair, but then some technique would be needed to help the user narrow down that set and choose the preferred one. With the rapid improvement of large language models, autoformalization techniques are also becoming popular [26], targeting a variety of formal languages, including Alloy [11].

p. 1
Where the paper says it

These techniques could easily be adapted to return a set of repair candidates instead of single repair, but then some technique would be needed to help the user narrow down that set and choose the preferred one. With the rapid improvement of large language models, autoformalization techniques are also becoming popular [26], targeting a variety of formal languages, including Alloy [11].

arXiv preprint arXiv:2505. p. 0
Where the paper says it

Just for the Alloy formal specification language [13,14], several techniques have been proposed recently [29,25,2,10,3,4,1]. These techniques arXiv:2511.

p. 0
Where the paper says it

Just for the Alloy formal specification language [13,14], several techniques have been proposed recently [29,25,2,10,3,4,1]. These techniques arXiv:2511.

23486 (2025), Yang, L. p. 0
Where the paper says it

19177v1 [cs. SE] 24 Nov 2025

p. 0
Where the paper says it

19177v1 [cs. SE] 24 Nov 2025

, Yan, J., Zhang, J.: Generating minimal test set satisfying MC/DC criterion via SAT based approach. p. 8
Where the paper says it

We assume the interface to the PM-SAT solver is a function pmaxsolve that receives a set of variables, a formula to be converted to hard clauses, and a set of soft clauses, and returns an instance (a set of true variables) that satisfies all hard clauses and maximizes the soft ones. The algorithm generates a minimal narrowing test suite in a single call to the PM-SAT solver, generating all required instances at once.

p. 8
Where the paper says it

We assume the interface to the PM-SAT solver is a function pmaxsolve that receives a set of variables, a formula to be converted to hard clauses, and a set of soft clauses, and returns an instance (a set of true variables) that satisfies all hard clauses and maximizes the soft ones. The algorithm generates a minimal narrowing test suite in a single call to the PM-SAT solver, generating all required instances at once.

In: Proceedings of the 33rd Annual ACM Symposium on Applied Computing. pp. 1899–1906 (2018).

Bares: The paper references numerous works related to formal methods and test case synthesis. p. 1

Where the paper says it

Specifically, the contributions of this paper are the following: – A formal characterization of the problem of generating a test case suite for narrowing down specification candidates; – Two alternative solver-based algorithms for synthesizing a narrowing test suite, one that ensures minimality of the suite, and another that does not; – An implementation of both algorithms in a prototype that can be used to generate test suites to help choose among alternative Alloy specifications; – An evaluation of this prototype against a large set of problems to assess its effectiveness, both in terms of efficiency and size of the generated test suite. The paper is structured as follows: the next section presents an overview of the technique using a motivating example specified with Alloy; Section 3 presents the formal characterization of the problem and describes the two synthesis algorithms; Section 4 describes the prototype implementation and its evaluation; Section 5 presents related work; and, finally, Section 6 concludes the paper, including some ideas for future work.

p. 1
Where the paper says it

Specifically, the contributions of this paper are the following: – A formal characterization of the problem of generating a test case suite for narrowing down specification candidates; – Two alternative solver-based algorithms for synthesizing a narrowing test suite, one that ensures minimality of the suite, and another that does not; – An implementation of both algorithms in a prototype that can be used to generate test suites to help choose among alternative Alloy specifications; – An evaluation of this prototype against a large set of problems to assess its effectiveness, both in terms of efficiency and size of the generated test suite. The paper is structured as follows: the next section presents an overview of the technique using a motivating example specified with Alloy; Section 3 presents the formal characterization of the problem and describes the two synthesis algorithms; Section 4 describes the prototype implementation and its evaluation; Section 5 presents related work; and, finally, Section 6 concludes the paper, including some ideas for future work.

p. 1
Where the paper says it

Specifically, the contributions of this paper are the following: – A formal characterization of the problem of generating a test case suite for narrowing down specification candidates; – Two alternative solver-based algorithms for synthesizing a narrowing test suite, one that ensures minimality of the suite, and another that does not; – An implementation of both algorithms in a prototype that can be used to generate test suites to help choose among alternative Alloy specifications; – An evaluation of this prototype against a large set of problems to assess its effectiveness, both in terms of efficiency and size of the generated test suite. The paper is structured as follows: the next section presents an overview of the technique using a motivating example specified with Alloy; Section 3 presents the formal characterization of the problem and describes the two synthesis algorithms; Section 4 describes the prototype implementation and its evaluation; Section 5 presents related work; and, finally, Section 6 concludes the paper, including some ideas for future work.

p. 1
Where the paper says it

Specifically, the contributions of this paper are the following: – A formal characterization of the problem of generating a test case suite for narrowing down specification candidates; – Two alternative solver-based algorithms for synthesizing a narrowing test suite, one that ensures minimality of the suite, and another that does not; – An implementation of both algorithms in a prototype that can be used to generate test suites to help choose among alternative Alloy specifications; – An evaluation of this prototype against a large set of problems to assess its effectiveness, both in terms of efficiency and size of the generated test suite. The paper is structured as follows: the next section presents an overview of the technique using a motivating example specified with Alloy; Section 3 presents the formal characterization of the problem and describes the two synthesis algorithms; Section 4 describes the prototype implementation and its evaluation; Section 5 presents related work; and, finally, Section 6 concludes the paper, including some ideas for future work.

p. 1
Where the paper says it

Specifically, the contributions of this paper are the following: – A formal characterization of the problem of generating a test case suite for narrowing down specification candidates; – Two alternative solver-based algorithms for synthesizing a narrowing test suite, one that ensures minimality of the suite, and another that does not; – An implementation of both algorithms in a prototype that can be used to generate test suites to help choose among alternative Alloy specifications; – An evaluation of this prototype against a large set of problems to assess its effectiveness, both in terms of efficiency and size of the generated test suite. The paper is structured as follows: the next section presents an overview of the technique using a motivating example specified with Alloy; Section 3 presents the formal characterization of the problem and describes the two synthesis algorithms; Section 4 describes the prototype implementation and its evaluation; Section 5 presents related work; and, finally, Section 6 concludes the paper, including some ideas for future work.

<ref:2511.19177#pg16, Alhanahnah, M., Rashedul Hasan, M., Xu, L., Bagheri, H.: An empirical evaluation of pre-trained large language models for repairing declarative formal specifications. Empirical Software Engineering 30(5), 1–38 (2025>, Barros, A., Neto, H., Cunha, A., Macedo, N., Paiva, A.C.: Alloy repair hint generation based on historical data. In: International Symposium on Formal Methods. pp. 104–121. Springer (2024), Brida, S.G., Regis, G., Zheng, G., Bagheri, H., Nguyen, T., Aguirre, N., Frias, M.: BeAFix: an automated repair tool for faulty Alloy models. In: 2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE). pp. 1213–1217. IEEE (2021), Cerqueira, J., Cunha, A., Macedo, N.: Timely specification repair for Alloy 6. In: International Conference on Software Engineering and Formal Methods. pp. 288–303. Springer (2022), Cha, B., Iwama, K., Kambayashi, Y., Miyazaki, S.: Local search algorithms for partial MAXSAT. AAAI/IAAI 263268, 9 (1997), Cunha, A., Macedo, N.: Validating formal specifications with LLM-generated test cases (2025), https://arxiv.org/abs/2510.23350, Hong, Y., Jiang, S., Fu, Y., Khurshid, S.: On the effectiveness of large language models in writing Alloy formulas. arXiv preprint arXiv:2502.15441 (2025), Hsu, H.Y., Orso, A.: MINTS: A general framework and tool for supporting testsuite minimization. In: 2009 IEEE 31st international conference on software engineering. pp. 419–429. IEEE (2009), Jackson, D.: Software Abstractions: Logic, language, and analysis. MIT press (2012), Jackson, D.: Alloy: A language and tool for exploring software designs. Communications of the ACM 62(9), 66–76 (2019), Khan, S.U.R., Lee, S.P., Javaid, N., Abdul, W.: A systematic review on test suite reduction: Approaches, experiment’s quality evaluation, and guidelines. IEEE Access 6, 11816–11841 (2018), Kitamura, T., Maissonneuve, Q., Choi, E.H., Artho, C., Gargantini, A.: Optimal test suite generation for modified condition decision coverage using SAT solving. In: International Conference on Computer Safety, Reliability, and Security. pp. 123–138. Springer (2018), Macedo, N., Cunha, A.: Alloy4Fun semantic entries (2025). https://doi.10.5281/zenodo.17392203, Macedo, N., Cunha, A., Paiva, A.C.R.: Alloy4Fun dataset for 2024/25 (2025). https://doi.10.5281/zenodo.17390557, Moret, B.M., Shapiro, H.D.: On minimizing a set of tests. SIAM Journal on Scientific and Statistical Computing 6(4), 983–1003 (1985), Pei, Y., Furia, C.A., Nordio, M., Meyer, B.: Automated program repair in an integrated development environment. In: ICSE (2). pp. 681–684. IEEE Computer Society (2015), Shriver, D., Elbaum, S., Stolee, K.T.: At the end of synthesis: narrowing program candidates. In: 2017 IEEE/ACM 39th International Conference on Software Engineering: New Ideas and Emerging Technologies Results Track (ICSE-NIER). pp. 19–22. IEEE (2017), Sullivan, A., Wang, K., Zaeem, R.N., Khurshid, S.: Automated test generation and mutation testing for Alloy. In: 2017 IEEE International Conference on Software Testing, Verification and Validation (ICST). pp. 264–275. IEEE (2017), Wang, K., Sullivan, A., Khurshid, S.: ARepair: A repair framework for Alloy. In: 2019 IEEE/ACM 41st International Conference on Software Engineering: Companion Proceedings (ICSE-Companion). pp. 103–106. IEEE (2019), Weng, K., Du, L., Li, S., Lu, W., Sun, H., Liu, H., Zhang, T.: Autoformalization in the era of large language models: A survey. arXiv preprint arXiv:2505.23486 (2025), Yang, L., Yan, J., Zhang, J.: Generating minimal test set satisfying MC/DC criterion via SAT based approach. In: Proceedings of the 33rd Annual ACM Symposium on Applied Computing. pp. 1899–1906 (2018).

Bares: The paper references numerous works related to formal methods and test case synthesis.<ref:2511.19177#pg4>. The results show that while the non-optimal algorithm can synthesize test suites for all problems in the benchmark within a 60s timeout, its execution time grows at a quadratic rate.<ref:2511.19177#pg4>. Concerning RQ3, the scope has a similar (substantial) impact on the efficiency of both techniques (as seen on the middleright graph). p. 9

Where the paper says it

RQ2 How does the size of the non-optimal test suite compare with the optimal? RQ3 What is the impact of the size of the domain of discourse on execution time and test suite size?

<ref:2511.19177#pg4>

Bares: The paper references numerous works related to formal methods and test case synthesis.<ref:2511.19177#pg6>. The technique can also be extended to other formal specification languages where analysis can be automated by translation to SAT.<ref:2511.19177#pg6>.

Bares: The paper references numerous works related to formal methods and test case synthesis.<ref:2511.19177#pg6, The inspiration for this paper came from work on narrowing down program candidates generated by synthesis or repair procedures from weak specifications, namely the work of Shriver et al. p. 1

Where the paper says it

Specifically, the contributions of this paper are the following: – A formal characterization of the problem of generating a test case suite for narrowing down specification candidates; – Two alternative solver-based algorithms for synthesizing a narrowing test suite, one that ensures minimality of the suite, and another that does not; – An implementation of both algorithms in a prototype that can be used to generate test suites to help choose among alternative Alloy specifications; – An evaluation of this prototype against a large set of problems to assess its effectiveness, both in terms of efficiency and size of the generated test suite. The paper is structured as follows: the next section presents an overview of the technique using a motivating example specified with Alloy; Section 3 presents the formal characterization of the problem and describes the two synthesis algorithms; Section 4 describes the prototype implementation and its evaluation; Section 5 presents related work; and, finally, Section 6 concludes the paper, including some ideas for future work.

[23] that performs that task by synthesizing new inputs for which the user must provide the desired output>

Bares: The paper references numerous works related to formal methods and test case synthesis.<ref:2511.19177#pg5, The basic idea of synthesizing test cases to narrow down candidates is not new, and has been proposed before to narrow down synthesized program candidates in the presence of weak specifications [23]>

Bares: The paper references numerous works related to formal methods and test case synthesis.<ref:2511.19177#pg8>. This non-optimal synthesis strategy might return less than N − 1 instances, sometimes even the optimal number of instances. p. 6

Where the paper says it

, ϕN } ∧ N > 1 ∧ V = S {fv(ϕi) | 1 ≤ i ≤ N} Require: ∀ϕi, ϕj ∈ F | i ̸= j → ∃I ⊆ V · I |= ϕi ↔ I ̸|= ϕj Ensure: |T| < N ∧ ∀I ∈ T · I ⊆ V Ensure: ∀ϕi, ϕj ∈ F | i ̸= j → ∃I ∈ T · I |= ϕi ↔ I ̸|= ϕj 1: S ← {F} 2: T ← ∅ 3: while S ̸= ∅ do 4: C ← choose(S) 5: S ← S \ {C} 6: U ← {I ∈ T | I |= W C ∧ ¬ V C} 7: if U ̸= ∅ then ▷ Check if a previous instance can be reused 8: I ← choose(U) 9: else ▷ If not generate a new one 10: I ← solve(V, W C ∧ ¬ V C) 11: end if 12: T ← T ∪ {I} 13: CP ← {ϕ ∈ C | I |= ϕ} 14: if |CP | > 1 then 15: S ← S ∪ {CP } 16: end if 17: CN ← C \ CP 18: if CN > 1 then 19: S ← S ∪ {CN } 20: end if 21: end while might return less than N − 1 instances, sometimes even the optimal number of instances. This non-optimal synthesis strategy is implemented in Algorithm 1.

<ref:2511.19177#pg8>. The non-optimal synthesis strategy is implemented in Algorithm 1. p. 6
Where the paper says it

, ϕN } ∧ N > 1 ∧ V = S {fv(ϕi) | 1 ≤ i ≤ N} Require: ∀ϕi, ϕj ∈ F | i ̸= j → ∃I ⊆ V · I |= ϕi ↔ I ̸|= ϕj Ensure: |T| < N ∧ ∀I ∈ T · I ⊆ V Ensure: ∀ϕi, ϕj ∈ F | i ̸= j → ∃I ∈ T · I |= ϕi ↔ I ̸|= ϕj 1: S ← {F} 2: T ← ∅ 3: while S ̸= ∅ do 4: C ← choose(S) 5: S ← S \ {C} 6: U ← {I ∈ T | I |= W C ∧ ¬ V C} 7: if U ̸= ∅ then ▷ Check if a previous instance can be reused 8: I ← choose(U) 9: else ▷ If not generate a new one 10: I ← solve(V, W C ∧ ¬ V C) 11: end if 12: T ← T ∪ {I} 13: CP ← {ϕ ∈ C | I |= ϕ} 14: if |CP | > 1 then 15: S ← S ∪ {CP } 16: end if 17: CN ← C \ CP 18: if CN > 1 then 19: S ← S ∪ {CN } 20: end if 21: end while might return less than N − 1 instances, sometimes even the optimal number of instances. This non-optimal synthesis strategy is implemented in Algorithm 1.

<ref:2511.19177#pg8>. The non-optimal synthesis strategy is implemented in Algorithm 4. p. 6
Where the paper says it

, ϕN } ∧ N > 1 ∧ V = S {fv(ϕi) | 1 ≤ i ≤ N} Require: ∀ϕi, ϕj ∈ F | i ̸= j → ∃I ⊆ V · I |= ϕi ↔ I ̸|= ϕj Ensure: |T| < N ∧ ∀I ∈ T · I ⊆ V Ensure: ∀ϕi, ϕj ∈ F | i ̸= j → ∃I ∈ T · I |= ϕi ↔ I ̸|= ϕj 1: S ← {F} 2: T ← ∅ 3: while S ̸= ∅ do 4: C ← choose(S) 5: S ← S \ {C} 6: U ← {I ∈ T | I |= W C ∧ ¬ V C} 7: if U ̸= ∅ then ▷ Check if a previous instance can be reused 8: I ← choose(U) 9: else ▷ If not generate a new one 10: I ← solve(V, W C ∧ ¬ V C) 11: end if 12: T ← T ∪ {I} 13: CP ← {ϕ ∈ C | I |= ϕ} 14: if |CP | > 1 then 15: S ← S ∪ {CP } 16: end if 17: CN ← C \ CP 18: if CN > 1 then 19: S ← S ∪ {CN } 20: end if 21: end while might return less than N − 1 instances, sometimes even the optimal number of instances. This non-optimal synthesis strategy is implemented in Algorithm 1.

<ref:2511.19177#pg8>. The non-optimal synthesis strategy is implemented in Algorithm 5. p. 6
Where the paper says it

, ϕN } ∧ N > 1 ∧ V = S {fv(ϕi) | 1 ≤ i ≤ N} Require: ∀ϕi, ϕj ∈ F | i ̸= j → ∃I ⊆ V · I |= ϕi ↔ I ̸|= ϕj Ensure: |T| < N ∧ ∀I ∈ T · I ⊆ V Ensure: ∀ϕi, ϕj ∈ F | i ̸= j → ∃I ∈ T · I |= ϕi ↔ I ̸|= ϕj 1: S ← {F} 2: T ← ∅ 3: while S ̸= ∅ do 4: C ← choose(S) 5: S ← S \ {C} 6: U ← {I ∈ T | I |= W C ∧ ¬ V C} 7: if U ̸= ∅ then ▷ Check if a previous instance can be reused 8: I ← choose(U) 9: else ▷ If not generate a new one 10: I ← solve(V, W C ∧ ¬ V C) 11: end if 12: T ← T ∪ {I} 13: CP ← {ϕ ∈ C | I |= ϕ} 14: if |CP | > 1 then 15: S ← S ∪ {CP } 16: end if 17: CN ← C \ CP 18: if CN > 1 then 19: S ← S ∪ {CN } 20: end if 21: end while might return less than N − 1 instances, sometimes even the optimal number of instances. This non-optimal synthesis strategy is implemented in Algorithm 1.

<ref:2511.19177#pg8>.

Bares: The paper references numerous works related to formal methods and test case synthesis.<ref:2511.19177#pg3>. The lower-bound for a minimal narrowing set T is obviously T = log2 N (and it occurred in the example of the previous section).<ref:2511.19177#pg3>.

Bares: The paper references numerous works related to formal methods and test case synthesis.<ref:2511.19177#pg6>. The algorithm generates a minimal narrowing test suite in a single call to the PM-SAT solver, generating all required instances at once. p. 8

Where the paper says it

We assume the interface to the PM-SAT solver is a function pmaxsolve that receives a set of variables, a formula to be converted to hard clauses, and a set of soft clauses, and returns an instance (a set of true variables) that satisfies all hard clauses and maximizes the soft ones. The algorithm generates a minimal narrowing test suite in a single call to the PM-SAT solver, generating all required instances at once.

<ref:2511.19177#pg6>.

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

  1. Improved test case selection by using a technique to help choose the best formal specification candidate among several alternatives, generating a suite of test cases that, once classified by the user as desirable or not, narrows down the set of candidates to at most one specification.

  2. The improved system can generate two alternative solver-based algorithms: one that generates a minimal test suite and another that does not ensure minimality for narrowing test suites.

  3. The prototype implementation can be used to generate test suites to help choose among alternative Alloy specifications, allowing offline classification by a domain expert, which makes the technique more amenable to situations where test cases are classified offline.

  4. The optimal algorithm generates a minimal test suite by creating a PM-SAT problem with variables for each possible instance and the requirement that at least one instance in the test suite must distinguish between any pair of formulas.

  5. The non-optimal algorithm uses an iterative strategy to generate instances, trying to reuse instances from different branches of the decision tree whenever possible, which might return less than N minus 1 instances sometimes even the optimal number.

  6. The system can be applied to other formal specification languages whose analysis can be automated by translation to SAT solvers, such as temporal logic, where it can be even more difficult for the user to choose the best candidate by directly inspecting the specifications.

Abstract

Ambiguous requirements can admit several non-equivalent formal specifications. We study the symbolic synthesis of complete distinguishing test batches for specification narrowing through expert review. Synthesized upfront, these fixed suites of instances or traces separate every candidate pair and support asynchronous and parallel classification. We formalize batch synthesis as a candidate-pair cover problem over an implicit test space and develop four methods for bounded Alloy models and temporal traces. Two cover-based methods obtain minimum-cardinality batches through joint MaxSAT optimization or SAT enumeration followed by explicit minimum-cover selection. Two tree-guided methods use SAT or balanced MaxSAT and reuse tests across branches. Our evaluation covers 196 static and 32 temporal configurations. On paired static configurations, reuse reduces balanced batch cardinality by 42% relative to the unreused construction tree, and minimum covers are a further 29% smaller. The SAT-based tree-guided method completes every main-study configuration within 0.43 seconds, while the exact methods exhibit different scalability profiles, particularly for temporal models. Complete batches also support adaptive review, with balanced batches nearly attaining the theoretical lower bound on mean classification cost. On completed benchmarks, modest additional upfront synthesis effort provides complete reusable suites that also support competitive adaptive classification.

Sources

Related papers