I found myself needing to do something very similar: I'm working on something where I need to write a module that takes in actions (or in my case, sets of actions) and defines specifications in terms of these passed-in actions.
From Leslie’s earlier reply (and also from Section 17.5.5 of
Specifying Systems) it seems that module instantiation isn't the right tool for this. And since I want to prove properties about these specs in TLAPS, Andrew's workaround of passing definitions through the model configuration file is not an option for me either.
Of course, the most straightforward approach is to have the user define the actions in a module, then extend that module and copy-paste my spec definitions. A slightly nicer approach would be to write a small script that takes a module containing the arguments, and generates a new module that extends it and defines the specs.
But I'm hoping to find a solution that stays entirely within the TLA+ ecosystem. Has anyone run into this challenge and found a solution?
Thanks!
Ugur