MODULE; IMPORT FeedbackVBT, Filter, MultiClass, MultiFilter, MultiSplit, VBT; REVEAL T = Public BRANDED OBJECT OVERRIDES init := Init; normal := Normal; excited := Excited; END; TYPE MC = MultiClass.Filter OBJECT OVERRIDES pred := Succ; succ := Succ; replace := Replace; END; PROCEDURE BiFeedbackVBT Init (v: T; f1, f2: FeedbackVBT.T; ch: VBT.T): T = BEGIN <* ASSERT MultiFilter.Child(f1) = NIL *> <* ASSERT MultiFilter.Child(f2) = NIL *> EVAL MultiFilter.Replace(f2, ch); EVAL MultiFilter.Replace(f1, f2); EVAL FeedbackVBT.T.init(v, f1); MultiClass.Be(v, NEW(MC)); IF ch # NIL THEN MultiClass.BeChild(v, ch) END; FeedbackVBT.Normal(v); RETURN v END Init; PROCEDURENormal (v: T) = VAR f1: FeedbackVBT.T := Filter.Child(v); f2: FeedbackVBT.T := MultiFilter.Child(f1); BEGIN FeedbackVBT.SetState(f1, FeedbackVBT.GetState(v)); FeedbackVBT.Normal(f1); FeedbackVBT.SetState(f2, FeedbackVBT.GetState(v)); FeedbackVBT.Normal(f2) END Normal; PROCEDUREExcited (v: T) = VAR f1: FeedbackVBT.T := Filter.Child(v); f2: FeedbackVBT.T := MultiFilter.Child(f1); BEGIN FeedbackVBT.SetState(f1, FeedbackVBT.GetState(v)); FeedbackVBT.Excited(f1); FeedbackVBT.SetState(f2, FeedbackVBT.GetState(v)); FeedbackVBT.Excited(f2) END Excited; PROCEDUREReplace (m: MC; <* UNUSED *> ch: VBT.T; new: VBT.T) = VAR v : T := m.vbt; f1: FeedbackVBT.T := Filter.Child(v); f2: FeedbackVBT.T := MultiFilter.Child(f1); BEGIN EVAL MultiFilter.Replace(f2, new); END Replace; PROCEDURESucc (m: MC; ch: VBT.T): VBT.T = <* FATAL MultiSplit.NotAChild *> VAR v : T := m.vbt; f1: FeedbackVBT.T := Filter.Child(v); f2: FeedbackVBT.T := MultiFilter.Child(f1); BEGIN IF ch = NIL THEN RETURN MultiSplit.Succ(f2, ch) ELSE RETURN NIL END END Succ; BEGIN END BiFeedbackVBT.