Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
FROM continuumio/miniconda3 AS build
COPY requirements.txt .

COPY ltlmutator/ /ltlmutator/
RUN conda init bash && \
. /opt/conda/etc/profile.d/conda.sh && \
conda create --name myenv python=3.9 && \
conda activate myenv && \
conda install -c https://conda.anaconda.org/conda-forge spot && \
pip install /ltlmutator && \
pip install -r requirements.txt
# && \
#conda pack -n myenv -o /tmp/myenv.tar.gz
Expand Down
10 changes: 5 additions & 5 deletions experiments/benchmark_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
# Add src to path for LTL Tutor imports
sys.path.insert(0, str(Path(__file__).parent.parent / 'src'))

from ltlnode import parse_ltl_string
from ltlmutator import parse_ltl_string
import ltltoeng
import spot
import codebook
from ltlmutator import codebook

from sentence_transformers import SentenceTransformer

Expand Down Expand Up @@ -132,7 +132,7 @@ def compute_sbert_distance(text1, text2, model):
# Misconception distribution control
def get_all_misconception_types():
"""Get all misconception types from the codebook."""
from codebook import MisconceptionCode
from ltlmutator import MisconceptionCode
return [m.value for m in MisconceptionCode if m != MisconceptionCode.Syntactic]


Expand Down Expand Up @@ -275,7 +275,7 @@ def generate_template_formulas_for_misconceptions(misconceptions_needed, num_tem
template_formulas = []

# Only generate templates for misconceptions that need them
from codebook import MisconceptionCode
from ltlmutator import MisconceptionCode

for misconception_name, deficit in misconceptions_needed:
# Skip if no deficit (already have enough)
Expand Down Expand Up @@ -316,7 +316,7 @@ def adjust_priorities_for_misconceptions(misconceptions_needed):
# For each missing misconception, boost its associated operators
for misconception_name, _ in misconceptions_needed[:3]: # Top 3 most needed
try:
from codebook import MisconceptionCode
from ltlmutator import MisconceptionCode
misconception_enum = MisconceptionCode(misconception_name)
operators = misconception_enum.associatedOperators()

Expand Down
4 changes: 2 additions & 2 deletions experiments/benchmark_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
# Add src to path for LTL parsing and equivalence checking
sys.path.insert(0, str(Path(__file__).parent.parent / 'src'))

from ltlnode import parse_ltl_string
from spotutils import areEquivalent
from ltlmutator import parse_ltl_string
from ltlmutator.spotutils import areEquivalent
import spot


Expand Down
12 changes: 12 additions & 0 deletions ltlmutator/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[project]
name = "ltlmutator"
version = "0.1.0"
description = "LTL formula semantic and syntactic mutation library"
requires-python = ">=3.9"
dependencies = [
"antlr4-python3-runtime>=4.13.1",
]

[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
6 changes: 6 additions & 0 deletions ltlmutator/src/ltlmutator.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Metadata-Version: 2.4
Name: ltlmutator
Version: 0.1.0
Summary: LTL formula semantic and syntactic mutation library
Requires-Python: >=3.9
Requires-Dist: antlr4-python3-runtime>=4.13.1
15 changes: 15 additions & 0 deletions ltlmutator/src/ltlmutator.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
pyproject.toml
src/ltlmutator/__init__.py
src/ltlmutator/codebook.py
src/ltlmutator/ltlnode.py
src/ltlmutator/spotutils.py
src/ltlmutator/syntacticmutator.py
src/ltlmutator.egg-info/PKG-INFO
src/ltlmutator.egg-info/SOURCES.txt
src/ltlmutator.egg-info/dependency_links.txt
src/ltlmutator.egg-info/requires.txt
src/ltlmutator.egg-info/top_level.txt
src/ltlmutator/grammar/__init__.py
src/ltlmutator/grammar/ltlLexer.py
src/ltlmutator/grammar/ltlListener.py
src/ltlmutator/grammar/ltlParser.py
1 change: 1 addition & 0 deletions ltlmutator/src/ltlmutator.egg-info/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions ltlmutator/src/ltlmutator.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
antlr4-python3-runtime>=4.13.1
1 change: 1 addition & 0 deletions ltlmutator/src/ltlmutator.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ltlmutator
9 changes: 9 additions & 0 deletions ltlmutator/src/ltlmutator/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from .codebook import MisconceptionCode, applyMisconception, getAllApplicableMisconceptions, MutationResult
from .syntacticmutator import applyRandomMutation, applyRandomMutationNotEquivalentTo
from .ltlnode import (
LTLNode, LiteralNode, UnaryOperatorNode, BinaryOperatorNode,
UntilNode, NextNode, GloballyNode, FinallyNode,
OrNode, AndNode, NotNode, ImpliesNode, EquivalenceNode,
parse_ltl_string, SUPPORTED_SYNTAXES
)
from . import spotutils
Loading
Loading