Skip to content

Make StrataCoreToGoto accept a user-specified Strata Core file#404

Merged
tautschnig merged 7 commits intomainfrom
tautschnig/generalise-core-to-goto
Mar 13, 2026
Merged

Make StrataCoreToGoto accept a user-specified Strata Core file#404
tautschnig merged 7 commits intomainfrom
tautschnig/generalise-core-to-goto

Conversation

@tautschnig
Copy link
Copy Markdown
Contributor

@tautschnig tautschnig commented Feb 10, 2026

Description of changes:

It was previously hard-coded to a single test. Turn it into a workflow that accepts a *.core.st file as command-line argument.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

It was previously hard-coded to a single test. Turn it into a workflow
that accepts *.core.st files as command-line arguments.
Copilot AI review requested due to automatic review settings February 10, 2026 14:55
@tautschnig tautschnig requested a review from a team as a code owner February 10, 2026 14:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the StrataCoreToGoto executable so it can translate a user-specified Strata Core source file (*.core.st) into CBMC-compatible GOTO JSON outputs, instead of being hard-coded to the SimpleAdd test case.

Changes:

  • Replace hard-coded SimpleAdd program import/entrypoint with a CLI that reads and elaborates a .core.st file.
  • Add basic CLI options (--output-dir, --program-name) and derive default output names from the input filename.
  • Update the SimpleAdd CBMC helper script to invoke the new CLI form.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
StrataTest/Backends/CBMC/SimpleAdd/mkGotoBin.sh Switches the script to call StrataCoreToGoto with an explicit input .core.st file and output directory.
StrataCoreToGoto.lean Implements new CLI parsing, file loading/elaboration, and JSON output file naming for StrataCoreToGoto.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread StrataCoreToGoto.lean Outdated
Comment thread StrataCoreToGoto.lean Outdated
Comment thread StrataCoreToGoto.lean
Comment thread StrataCoreToGoto.lean Outdated
@tautschnig tautschnig changed the title Make StrataCoreToGoto accept user-specified Strata Core files Make StrataCoreToGoto accept a user-specified Strata Core file Feb 10, 2026
atomb
atomb previously approved these changes Feb 11, 2026
Copy link
Copy Markdown
Contributor

@atomb atomb left a comment

Choose a reason for hiding this comment

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

This looks good to me, though the Copilot comment might be good to address.

@tautschnig tautschnig self-assigned this Feb 19, 2026
@tautschnig tautschnig marked this pull request as draft February 19, 2026 10:41
@tautschnig tautschnig marked this pull request as draft February 19, 2026 10:41
tautschnig and others added 2 commits March 13, 2026 10:53
Address Copilot PR review feedback:
- Reject --program-name values containing '/' or '..' to prevent
  path traversal outside the output directory.
- Use System.FilePath for path construction instead of string
  interpolation.
- Create the output directory (createDirAll) before writing files
  so that a non-existent --output-dir produces the directory rather
  than an unhelpful IO exception.

Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
Resolve conflict in CoreToCProverGOTO.lean: keep origin/main's API
with explicit programName parameter (used by other callers), and
update StrataCoreToGoto.lean to pass programName and use the new
import path after the file was relocated to Strata/Backends/CBMC/GOTO/.

Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
@tautschnig tautschnig marked this pull request as ready for review March 13, 2026 11:43
@tautschnig tautschnig enabled auto-merge March 13, 2026 11:43
@tautschnig
Copy link
Copy Markdown
Contributor Author

This looks good to me, though the Copilot comment might be good to address.

Addressed in 4afbbae.

@tautschnig tautschnig added this pull request to the merge queue Mar 13, 2026
Merged via the queue into main with commit 1150724 Mar 13, 2026
15 checks passed
@tautschnig tautschnig deleted the tautschnig/generalise-core-to-goto branch March 13, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants