pub struct AlloyModel {
pub module_name: String,
pub signatures: Vec<Signature>,
pub facts: Vec<Fact>,
pub assertions: Vec<Assertion>,
pub comment: Option<String>,
}Expand description
A complete Alloy model comprising sigs, facts, assertions, and commands.
This is the top-level structure that gets serialised into an .als file.
The model can be loaded into Alloy Analyzer for verification.
Fields§
§module_name: StringThe module name (first line of the .als file).
signatures: Vec<Signature>All signatures in the model.
facts: Vec<Fact>All facts (constraints) in the model.
assertions: Vec<Assertion>All assertions to check.
comment: Option<String>Optional opening comment describing the model’s purpose.
Implementations§
Source§impl AlloyModel
impl AlloyModel
Sourcepub fn new(module_name: impl Into<String>) -> Self
pub fn new(module_name: impl Into<String>) -> Self
Create a new empty model with the given module name.
Sourcepub fn add_signature(&mut self, sig: Signature)
pub fn add_signature(&mut self, sig: Signature)
Add a signature to the model.
Sourcepub fn add_assertion(&mut self, assertion: Assertion)
pub fn add_assertion(&mut self, assertion: Assertion)
Add an assertion to the model.
Trait Implementations§
Source§impl Clone for AlloyModel
impl Clone for AlloyModel
Source§fn clone(&self) -> AlloyModel
fn clone(&self) -> AlloyModel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AlloyModel
impl RefUnwindSafe for AlloyModel
impl Send for AlloyModel
impl Sync for AlloyModel
impl Unpin for AlloyModel
impl UnsafeUnpin for AlloyModel
impl UnwindSafe for AlloyModel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more