Skip to content

Commit

Permalink
Added option "partial_equivalence_check" in config
Browse files Browse the repository at this point in the history
  • Loading branch information
Yiannis128 committed Oct 13, 2023
1 parent 3150d74 commit 6d2d10c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
"50"
],
"array_expansion": 5,
"init_max_depth": 4
"init_max_depth": 4,
"partial_equivalence_check": "deep"
}
}
}
12 changes: 10 additions & 2 deletions esbmc_ai_lib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
import json
import sys
from typing import Any, NamedTuple, Union
from typing import Any, NamedTuple, Union, Literal
from dotenv import load_dotenv

from .logging import *
Expand Down Expand Up @@ -62,7 +62,8 @@ class ChatPromptSettings(NamedTuple):
"""Used for allocating continuous memory. Arrays and pointers will be initialized using this."""
ocm_init_max_depth: int
"""Max depth that structs will be initialized into, afterwards initializes with NULL."""

ocm_partial_equivalence_check: Literal["basic", "deep"] = "basic"
"""Mode to check for partial equivalence on the return value."""

def _load_custom_ai(config: dict) -> None:
ai_custom: dict = config
Expand Down Expand Up @@ -248,6 +249,13 @@ def load_config(file_path: str) -> None:
default=10,
)

global ocm_partial_equivalence_check
ocm_partial_equivalence_check, _ = _load_config_value(
config_file=config_file["chat_modes"]["optimize_code"],
name="partial_equivalence_check",
default="basic",
)

# Load the custom ai configs.
_load_custom_ai(config_file["ai_custom"])

Expand Down

0 comments on commit 6d2d10c

Please sign in to comment.