import Base import ../../../spec/containers/deque.bend as S import ../../../src/containers/deque.bend as DQ import ../../../src/containers/types/deque.bend as E import ./state.bend as ST # StepOK(sh, op): the public step on the deque of shadow sh lands on the # deque of a shadow sh2 and emits o, and (model(sh2), o) is exactly the spec # step on model(sh). def StepOK(~T: Data, sh: ST.Shadow, op: E.Op) -> Type: Sigma<&1, &1, ST.Shadow, sh2 => Sigma<&1, &1, E.Obs, o => {DQ.step(~T, ST.real(T, sh), op) == (ST.real(T, sh2), o) : DQ.Deque & E.Obs} & {(ST.model(T, sh2), o) == S.step(T, ST.model(T, sh), op) : List<&2, T> & E.Obs}>> def mk(~T: Data, -sh: ST.Shadow, -op: E.Op, sh2: ST.Shadow, o: E.Obs, e1: {DQ.step(~T, ST.real(T, sh), op) == (ST.real(T, sh2), o) : DQ.Deque & E.Obs}, e2: {(ST.model(T, sh2), o) == S.step(T, ST.model(T, sh), op) : List<&2, T> & E.Obs}) -> StepOK(~T, sh, op): (sh2, (o, (e1, e2)))