Counterexample: a guard stored in a boolean (boolean bad = a || b || c; if (bad) return;) is not split, so every variable of the guard is listed
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 52/100
Direção de pesquisa
Start by reading RefinementError.factsOf and how boolean definitions and negated facts are handled; the issue identifies linkedTerms and isKnown as relevant. Run the supplied Java reproducer and compare its counterexample with the expected timeout == -1. Done when the stored-boolean guard produces the expected minimal counterexample without unrelated guard variables or the generated name.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Impact: when a guard is stored in a boolean before the if, the counterexample lists values for every variable of the guard and for a generated name, instead of only the value that breaks the call. Seen on the branch of #460 (pending merge), which fixes this for an inline guard; on main the counterexample for this input has the same noise and also leaves out timeout (#453).
Minimal reproducer
import liquidjava.specification.Refinement;
public class Probe {
static void connect(@Refinement("_ >= 0") int timeout) {}
static void probe(int port, int retries, int timeout) {
boolean bad = port < 0 || retries < 0 || timeout > 60000;
if (bad) return;
connect(timeout);
}
}
Expected: Counterexample: timeout == -1, as with the inline guard if (port < 0 || retries < 0 || timeout > 60000) return;, which on #460's branch (712759fe) gives:
Refinement Error: !(port < 0 || retries < 0 || timeout > 60000) is not a subtype of timeout >= 0
--> Counterexample: timeout == -1
Actual (#460's branch @ 712759fe):
Refinement Error: #fresh⁹ == (port < 0 || retries < 0 || timeout > 60000) && !#fresh⁹ is not a subtype of timeout >= 0
7 | boolean bad = port < 0 || retries < 0 || timeout > 60000;
8 | if (bad) return;
9 | connect(timeout);
| ^^^^^^^^^^^^^^^^^
10 | }
11 | }
--> Counterexample: timeout == -1 && port == 0 && retries == 0 && #fresh⁹ == false
main @ 0053074e prints the same Found with Counterexample: port == 0 && retries == 0 && #fresh⁹ == false.
Cause. On #460's branch, RefinementError.factsOf splits !(a || b) into !a and !b, but here found is #fresh == (a || b || c) && !#fresh. The definition is one fact that shares terms with everything, so linkedTerms pulls in port, retries and #fresh. isKnown only recognises x == v facts, so !#fresh does not hide #fresh == false. Substituting a boolean defined as x == e into !x (giving !e) before splitting would give the same facts as the inline guard. Separately, found names the local bad as #fresh⁹.
🤖 Generated with Claude Code
- Linguagem predominante
- Java
- Estrelas
- 71
- Forks
- 37
- Merge médio
- 1d 19h
- PRs com merge (30d)
- 46
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de liquid-java/liquidjava
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
liquid-java/liquidjava#443 ·
Mantenedores costumam responder em até 2 dias
-
bug real-world-finding
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
liquid-java/liquidjava#395 ·
Mantenedores costumam responder em até 2 dias
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
liquid-java/liquidjava#373 ·
Mantenedores costumam responder em até 2 dias
-
bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 69/100
liquid-java/liquidjava#470 ·
Mantenedores costumam responder em até 2 dias
-
bug error messages
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 68/100
liquid-java/liquidjava#469 ·
Mantenedores costumam responder em até 2 dias
Todas as issues de liquid-java/liquidjava
Issues semelhantes
-
status:pending type:bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
EngineHub/WorldGuard#2329 ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Dans-Plugins/Medieval-Roleplay-Engine#396 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 6 dias
-
type: dependency-upgrade
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 70/100
spring-projects/spring-session#4156 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
quarkiverse/quarkus-langchain4j#3127 · 1 comentário ·
Mantenedores costumam responder em até 1 dia