Skip to content

Commit

Permalink
add always-sat and always-sat in default definitions (disabled)
Browse files Browse the repository at this point in the history
expected behavior is that they should only run if you ask for them explicitly
  • Loading branch information
karmacoma-eth committed Oct 29, 2024
1 parent dc31eff commit ff6b2d5
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,6 @@ Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# log files
**/*.{err,out,csv}
4 changes: 3 additions & 1 deletion src/jsi/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,10 @@ def main(args: list[str] | None = None) -> int:

# build the commands to run the solvers
# run the solvers in the specified sequence, or fallback to the default order
enabled_solvers = [s for s in solver_definitions if solver_definitions[s].enabled]

commands: list[Command] = base_commands(
config.sequence or list(available_solvers.keys()),
config.sequence or enabled_solvers,
solver_definitions,
available_solvers,
config,
Expand Down
11 changes: 10 additions & 1 deletion src/jsi/config/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@
"always-sat": {
"executable": "echo",
"model": null,
"args": ["sat", "\n; input:"]
"args": ["sat", "\n; input:"],
"enabled": false,
"meta": "for testing purposes"
},
"always-unsat": {
"executable": "echo",
"model": null,
"args": ["unsat", "\n; input:"],
"enabled": false,
"meta": "for testing purposes"
}
}
10 changes: 9 additions & 1 deletion src/jsi/config/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,25 @@ class SolverDefinition:
model: str | None
args: list[str]

def __init__(self, executable: str, model: str | None, args: list[str]):
def __init__(
self,
executable: str,
model: str | None,
args: list[str],
enabled: bool = True,
):
self.executable = executable
self.model = model
self.args = args
self.enabled = enabled

@classmethod
def from_dict(cls, data: dict[str, str | None | list[str]]) -> "SolverDefinition":
return cls(
executable=data["executable"], # type: ignore
model=data["model"], # type: ignore
args=data["args"], # type: ignore
enabled=data.get("enabled", True), # type: ignore
)


Expand Down

0 comments on commit ff6b2d5

Please sign in to comment.