// CD for Part E include "lib.cd"; RawMaterialInstance = List(Constraint) *l "relations" List(RelationDefinition). Constraint = *l Weight RelationName List(Variable). Weight = int ":" *s. RelationName = ident *s. Variable = ident *s. RelationDefinition : PseudoBoolEx | BoolEx. PseudoBoolEx = *l "pseudo" *s RelationName "=" *s List(Term) Equality Value. BoolEx = *l RelationName *s "=" *s BoolFunc. BoolFunc : BoolVal | Or | And. Or = "(or" *s List(Term) ")". And = "(and" *s List(Term) ")". Term = Option(Coeff) BoolVal Option(AddOrSub). Coeff = int "*". BoolVal = Sign ident *s. Sign : Pos | Neg. Pos = . Neg = "!". AddOrSub : Add | Sub. Add = "+" *s. Sub = "-" *s. Equality : Equals | GreaterOrEq | LessOrEq. Equals = "=" *s. GreaterOrEq = ">=" *s. LessOrEq = "<=" *s. Value = int.