Metraipolis › archive › dc_921281f04a17
SLICE: Specification-Level Isolation of Contract Enforcement — arXiv:2608.21483
- Source
- arXiv (en)
- Original
- https://arxiv.org/abs/2608.21483
- License (as archived)
- CC0-1.0
- Archived
- 2026-10-18T08:10:51.115Z
- SHA-256 of the archived text
4b8802210bcf367f1015bba5e44f74e8c7211a574ca142645b04b0f79865c0bc- Stable URL of this page
https://metraipolis.com/documento/dc_921281f04a17
How to cite
SLICE: Specification-Level Isolation of Contract Enforcement — arXiv:2608.21483 — arXiv (en), https://arxiv.org/abs/2608.21483 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_921281f04a17 (Metraipolis archive dc_921281f04a17, sha256 4b8802210bcf367f1015bba5e44f74e8c7211a574ca142645b04b0f79865c0bc)
BibTeX
@misc{dc921281f04a17,
title = {SLICE: Specification-Level Isolation of Contract Enforcement — arXiv:2608.21483},
howpublished = {arXiv (en)},
url = {https://arxiv.org/abs/2608.21483},
note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_921281f04a17; sha256 4b8802210bcf367f1015bba5e44f74e8c7211a574ca142645b04b0f79865c0bc},
year = {2026}
}Archived text
Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2608.21483. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
Programming problems commonly specify both the computation a function should perform and the conditions that its inputs must satisfy. Large language models are widely used to generate code from these problem specifications, and the generated function must implement the required computation while enforcing the stated input conditions. The stated input conditions collectively form an input contract. Enforcing this contract is difficult: incomplete enforcement accepts inputs that should be rejected, whereas overly restrictive enforcement rejects inputs that should be accepted. Existing code generation methods do not provide a generation process that identifies both the input contract and the functional requirements and generates code that satisfies them jointly. We therefore introduce SLICE, a generation framework that identifies both requirements and addresses them through separate generation stages. SLICE consists of three stages: (i) Graph-based specification structuring, which grounds contract conditions to description segments in a specification graph and removes contract-only segments to form a functional view; (ii) Functional body generation, which produces multiple candidate function bodies through greedy and sampled decoding, ranks them using execution scores, and resolves ties using difference-region log probabilities; and (iii) Contract assertion generation, which generates input-validation assertions from the identified contract conditions and attaches them to the selected function body. We evaluate SLICE on ContractEval across four LLMs and compare it with six competing methods. Relative to the strongest evaluated baseline for each model, SLICE improves performance in generating code that satisfies both the functional requirements and the input contract by an average of 6.58%. Our code is available at this https URL . Tema degli esploratori: calcolo e infrastrutture (retro-catalogo arXiv: annunci del 2026-08-25 in cs.SE). Categorie arXiv: Software Engineering (cs.SE) ; Programming Languages (cs.PL). Pagina del lavoro: https://arxiv.org/abs/2608.21483 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito). Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina. Letto il 2026-10-18T08:07:32.974Z dalla pagina https://arxiv.org/catchup/cs.SE/2026-08-25?abs=True (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).