Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: Add some kind of "invariant" (or whatever it should be called) as a shortcut for placing a constraint on self.value() #117

Open
maxkratz opened this issue Jun 13, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@maxkratz
Copy link
Member

Example:

constraint -> mapping::aom {
	[self.variables().hours + self.variables().overTime >= 1 =>
	self.value() >= 1] & 
	[self.value() >= 1 =>
	self.variables().hours + self.variables().overTime >= 1]
}

Possible shortcuts/syntactic sugar:

invariant -> mapping::aom {
	self.variables().hours + self.variables().overTime >= 1
}

constraint -> mapping::aom {
	inv: self.variables().hours + self.variables().overTime >= 1
}

// Maybe "invariant" or "inv" is not completely correct -> we should choose another name

Currently, the longer form of this expression can be written as a boolean equivalence:

constraint -> mapping::aom {
	self.variables().hours + self.variables().overTime >= 1 <=> self.value() >= 1
}
@maxkratz maxkratz added documentation Improvements or additions to documentation enhancement New feature or request labels Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant