Skip to content

Commit

Permalink
add simplify tool
Browse files Browse the repository at this point in the history
  • Loading branch information
ekiwi committed Dec 16, 2024
1 parent f26ad51 commit 38650f3
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,25 @@ jobs:
run: |
cargo run --release -p patronus-egraphs-cond-synth -- --check-cond mult-to-add
smt-simplify:
name: Test SMT Simplifier
runs-on: ubuntu-24.04
timeout-minutes: 5
strategy:
matrix:
toolchain:
- stable

steps:
- name: Update Rust to ${{ matrix.toolchain }}
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose --release -p simplify
- name: run
run: cargo run --release -p simplify -- in.smt out.smt


semver:
name: Check Semantic Versioning of Patronus
runs-on: ubuntu-24.04
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
resolver = "2"
members = ["patronus", "patronus-egraphs", "patronus-dse", "tools/bmc", "tools/egraphs-cond-synth", "tools/sim"]
members = ["patronus", "patronus-egraphs", "patronus-dse", "tools/bmc", "tools/egraphs-cond-synth", "tools/sim", "tools/simplify"]

[workspace.package]
edition = "2021"
Expand Down
13 changes: 13 additions & 0 deletions tools/simplify/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "simplify"
version = "0.1.0"
edition.workspace = true
authors.workspace = true
repository.workspace = true
readme.workspace = true
license.workspace = true
rust-version.workspace = true

[dependencies]
patronus.workspace = true
clap.workspace = true
24 changes: 24 additions & 0 deletions tools/simplify/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright 2024 Cornell University
// released under BSD 3-Clause License
// author: Kevin Laeufer <[email protected]>

use clap::Parser;
use patronus::expr::*;
use patronus::*;

#[derive(Parser, Debug)]
#[command(name = "simplify")]
#[command(author = "Kevin Laeufer <[email protected]>")]
#[command(version)]
#[command(about = "Parses a SMT file, simplifies it and writes the simplified version to an output file.", long_about = None)]
struct Args {
#[arg(value_name = "INPUT", index = 1)]
input_file: String,
#[arg(value_name = "OUTPUT", index = 2)]
output_file: String,
}

fn main() {
let args = Args::parse();
todo!();
}

0 comments on commit 38650f3

Please sign in to comment.