lsc check accepts added requires/ensures lines in .dfy, so a proof file can make obligations vacuous
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- tooling
Línea de trabajo
Start with additionsOnly in tools/src/dafny-commands.ts, which currently rejects only deleted lines when .dfy is compared with .dfy.gen. Reproduce the two cases from the issue: an added requires in a generated header, and an added assume or {:axiom} declaration, both passing lsc check. Done means these additions are rejected or explicitly configured, while legitimate appended lemmas still pass. The issue leaves the exact rule open, so agree on it with maintainers first.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
This was generated by AI during triage.
Summary
lsc check treats any line that appears in foo.dfy but not in foo.dfy.gen as an allowed proof addition. additionsOnly in tools/src/dafny-commands.ts (checked on main at 566df0d) rejects only deleted lines. An added requires, assume, or {:axiom} passes the check. Each of these weakens what is proved while lsc check still reports success.
Reproduction
Observed with lemmascript 0.6.8 and Dafny 4.11.0. The code involved is unchanged on main.
-
Write a function with a guard in its contract and run
lsc gen, so thatcounter.dfyandcounter.dfy.genboth contain:function increment(c: Counter): Counter requires inRange(c) && belowMaximum(c) -
Remove
belowMaximum(context)from the TypeScript//@ requires(or from the guard in the body) and runlsc genagain.counter.dfy.genis regenerated without the clause.counter.dfyis left as it was. -
Run
lsc check. It reports all obligations verified. The diff from.dfy.gento.dfyshows the stalerequires ... && belowMaximum(c)line as an addition, so the check accepts it and Dafny verifies the old, stronger-precondition model instead of the current source.
The same check accepts lines added inside a generated header. Adding two lines to a generated contract lemma:
lemma increment_ensures(context: Context)
requires inRange(context)
requires belowMaximum(context)
requires false // added
ensures false // added
ensures inRange(increment(context))
and running lsc check --backend=dafny quantityCounter.ts regenerates .dfy.gen, passes the diff check, and prints Dafny program verifier finished with 11 verified, 0 errors, including the proof of ensures false. It also accepts new declarations that use assume or {:axiom}, which a proof addition can then rely on. Putting {:axiom} on an existing generated line does count as a modification and is rejected.
Expected
Proof additions should not be able to change what the generated declarations claim. Possible rules:
- Reject added lines that fall inside a generated declaration's header (
requires,ensures,decreases,reads, attributes). Allow new declarations and lemma bodies. - Reject
assumeand{:axiom}in proof additions unless explicitly allowed by configuration. - Optionally, have
lsc checkwarn when.dfypredates the latest.dfy.genand the regen merge was not run.
Context
We work around this in a downstream runner by requiring the generated text to appear byte-for-byte in the proof file, allowing only appended declarations and lemma calls, and refusing assume and attributes. We would prefer to rely on lsc check for this. Related, closed: #280 (regen merge conflicts), #192 (a translation that verified the wrong model).
- Lenguaje dominante
- TypeScript
- Estrellas
- 113
- Forks
- 13
- Merge medio
- 16 h 22 min
- PR fusionados (30 d)
- 40
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de midspiral/LemmaScript
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
midspiral/LemmaScript#308 ·
Los mantenedores suelen responder en 1 día
-
Dafny: `toUpperCase`/`toLowerCase` are modeled as ASCII-only, so false contracts about non-ASCII text verifyPosiblemente ocupada @quangng2000 la tomó hace 1 día. Abierto
midspiral/LemmaScript#312 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 1-2 días Aptitud para principiantes 56/100
midspiral/LemmaScript#311 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 48/100
midspiral/LemmaScript#310 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 67/100
midspiral/LemmaScript#309 ·
Los mantenedores suelen responder en 1 día
Todos los issues de midspiral/LemmaScript
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
vercel-labs/ui#809 ·
Los mantenedores suelen responder en 1 día
-
bot:ai-assisted component:platform-js status:untriaged
Dificultad 1/5 Menos de una hora Aptitud para principiantes 74/100
midnightntwrk/platform-js#38 ·
-
[bug] Second false positive on high-cost plugin alert: detection only compares patch entry id, community plugin dsh-auto | [bug] 高成本插件告警第二次误报:检测只比对 patch 条目 id,社区插件 dsh-auto-review 被认成 @deepseek-ai/dsh-experimental-auto-reviewPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ranxianglei/billion-context#7068 ·
Los mantenedores suelen responder en 1 día
-
vendor: bump whisper.cpp past 6a8addd — the current pin aborts the app on a failed Metal initAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
mybigday/whisper.rn#348 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
six-group/six-webcomponents#600 ·