All Downloads are FREE. Search and download functionalities are using the official Maven repository.

constraints.simple_allConstraints.ocl Maven / Gradle / Ivy

There is a newer version: 2.0.15
Show newest version
package tudresden::ocl20::pivot::examples::simple

-- The age of Person can not be negative.
context Person
inv: age >= 0

-- Students should be 16 or older.
context Student
inv: age > 16

-- Professors should be at least 30.
context Professor
inv: not (age < 30)


-- Returns the age of a Person.
context Person
def: getAge(): Integer = age


-- Before returning the age, the age must be defined.
context Person::getAge()
pre: not age.oclIsUndefined()


-- The result of getAge must equal to the age of a Person.
context Person::getAge()
post: result = age

endpackage




© 2015 - 2024 Weber Informatics LLC | Privacy Policy