Echtzeitsysteme / gips

Graph-Based (M)ILP Problem Specification Tool
https://gips.dev
GNU General Public License v3.0
3 stars 1 forks source link

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 1 year ago

maxkratz commented 1 year ago

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
}