***
*** Counterpart of the viewInstantiationByTheoryViewApril2025 test for
*** strategy to strategy expression mappings.
***

sth T is
  sort Small .
  strat f : Small @ Small .
endsth

sth T2 is
  sort Little .
  strat h : Little @ Little .
endsth

view TV from T to T2 is
  sort Small to Little .
  strat f to h .
endv

sth B is
  sort Tiny .
  strat g : Tiny @ Tiny .
endsth

smod USE-B{X :: B} is
  sd g(N:X$Tiny) := match N:X$Tiny [label "raw thumb"] .
endsm

smod BASE{X :: T} is
  sort Big .
  subsort X$Small < Big .  *** this triggers the bug
endsm

view PV{X :: T} from B to BASE{X} is
  sort Tiny to X$Small .
  strat g(N:Tiny) to expr f(N:X$Small) .
endv

smod TEST{Y :: T2} is
  pr USE-B{PV{TV}{Y}} .
endsm

show sds .
