Genetic algorithm for FRETish requirements
  • Python 96.6%
  • Makefile 3.4%
Find a file
2026-07-26 22:52:50 +01:00
.github/workflows Remove bandit as it's misbehaving 2025-09-08 16:43:37 +01:00
src Clean directory structure 2025-09-08 17:22:32 +01:00
tests Clean directory structure 2025-09-08 17:22:32 +01:00
.gitignore Basic FRET reqs implemented 2025-09-08 15:17:59 +01:00
LICENCE Add MIT licence 2026-07-26 22:52:50 +01:00
Makefile Remove bandit as it's misbehaving 2025-09-08 16:43:37 +01:00
pyproject.toml Remove bandit as it's misbehaving 2025-09-08 16:43:37 +01:00
README.md Add README 2025-09-08 17:34:57 +01:00
requirements.txt Remove bandit as it's misbehaving 2025-09-08 16:43:37 +01:00

FRET Genetic Algorithm

Modifying FRETish requirements using a genetic algorithm inspired by [1]. Two genetic operators are defined: mutation and crossover.

Mutation

Mutation takes a single part of a FRETish requirement, either the condition, timing, or consequent, and randomly mutates it. The condition and consequent can be mutated according to the propositional mutations described in [1], and the timing can be mutated by choosing any timing, with a random time parameter if needed.

For example, if x, then always, (¬(y)) ∧ (x) could be mutated to any of the following:

if x, then after 7 timesteps, (¬(y)) ∧ (x)
if x, then always, ((y) ∧ (z)) ∧ (y)
if z, then always, (¬(y)) ∧ (x)
if x, then never, (¬(y)) ∧ (x)
always, (¬(y)) ∧ (x)

Crossover

Crossover takes two FRETish requirements, and produces a third that takes subformulae of the conditions and consequents, as well as one of the timings. This is yet to be implemented.


[1]: Brizzio, M., et al. (2023). Automated Repair of Unrealisable LTL Specifications Guided by Model Counting. Proceedings of the Genetic and Evolutionary Computation Conference, 14991507. https://doi.org/10.1145/3583131.3590454