<> <> <> <> <> DIRECTORY PW, Rope; PWTest: CEDAR PROGRAM IMPORTS PW = BEGIN ROPE: TYPE = Rope.ROPE; examples: PW.Design _ PW.OpenDesign["PWTest.dale"]; PWTestX: PW.UserProc = BEGIN <<-- Cells >> a, b, test: PW.Object; <> a _ PW.Get[examples, "a"]; b _ PW.Get[examples, "b"]; test _ PW.AbutX[a, b]; RETURN[test]; END; <<>> PWTestSharedY: PW.UserProc = BEGIN <<-- Cells >> a, b, test: PW.Object; <> a _ PW.Rot90[PW.Get[examples, "a"]]; b _ PW.Rot90[PW.Get[examples, "b"]]; test _ PW.SharedAbutListY[LIST[a, b, a, b, a]]; RETURN[test]; END; <<>> TestMapFunction: PW.UserProc = BEGIN <> contact, noContact, edge, test: PW.Object; BinaryCount: PW.XYFunction = {RETURN[ SELECT TRUE FROM y=0 => edge, PW.XthBitOfN[y-1, x] => contact, ENDCASE => noContact]}; contact _ PW.Get[examples, "contact"]; edge _ PW.Get[examples, "edge"]; noContact _ PW.Inst[contact, LIST["contact"]]; test _ PW.MapFunction[BinaryCount, 0, 16, 0, 4]; RETURN[test]; END; PW.Register[PWTestX, "PWTestX"]; PW.Register[PWTestSharedY, "PWTestSharedY"]; PW.Register[TestMapFunction, "TestMapFunction"]; END. <<>>