OptimizeTT.cm
% ← &s ← FS.StreamOpen[fileName: "/ivy/serlet/alps/dumppha.tt", extendFileProc: NIL]
^[streamProcs: 2321252B^, streamData: 12243472B^, propList: 11255214B^, backingStream: NIL]
% open runpwpla
 Created Viewer: []<>runPWPLA.cm
% run BoolOpsImplA BoolOpsImplB
Loaded and ran: [indigo]<Chipndale>5.2>PWPLA20>BoolOpsImplA.bcd!2

Loaded and ran: [indigo]<chipndale>5.2>PWPLA20>BoolOpsImplB.bcd!1

% ← &tt ← BoolOps.StreamToTT[&s]
^[numInputs: 31, numOutputs: 39, numPTerms: 948, pterms: (948)[12063762B^, 12063642B^, 12063522B^, 12063402B^, 14032262B^, 14032142B^, 14032022B^, 14031702B^, 14031562B^, 14031442B^, 14031322B^, 14031202B^, 14031062B^, 14030742B^, 14030622B^, 14030502B^, 14030362B^, 14030242B^, 14030122B^, 14030002B^, 14034662B^, 14034542B^, 14034422B^, 14034302B^, 14034162B^, 14034042B^, 14033722B^, 14033602B^, 14033462B^, 14033342B^, 14033222B^, 14033102B^, ...]]
% ← &newtt ← BoolOps.TTOptimize[&tt]
^[numInputs: 31, numOutputs: 39, numPTerms: 355, pterms: (355)[14303622B^, 14303502B^, 14303742B^, 14304062B^, 14071542B^, 14063022B^, 14062442B^, 14062562B^, 14062202B^, 14071662B^, 14062702B^, 14062322B^, 14256102B^, 14257302B^, 14262262B^, 14263462B^, 14256722B^, 14260742B^, 14260362B^, 14256222B^, 14262762B^, 14256602B^, 14257162B^, 14255402B^, 14262522B^, 14256342B^, 14263102B^, 14262642B^, 14261562B^, 14264302B^, 14264542B^, 14261062B^, ...]]
% ← &nntt ← BoolOps.TTOptimize[&newtt]
^[numInputs: 31, numOutputs: 39, numPTerms: 355, pterms: (355)[14303622B^, 14303502B^, 14303742B^, 14304062B^, 14071542B^, 14063022B^, 14062442B^, 14062562B^, 14062202B^, 14071662B^, 14062702B^, 14062322B^, 14256102B^, 14257302B^, 14262262B^, 14263462B^, 14256722B^, 14260742B^, 14260362B^, 14256222B^, 14262762B^, 14256602B^, 14257162B^, 14255402B^, 14262522B^, 14256342B^, 14263102B^, 14262642B^, 14261562B^, 14264302B^, 14264542B^, 14261062B^, ...]]
% ← &out ← FS.StreamOpen[fileName: "///optdumppha.tt", accessOptions: $create, extendFileProc: NIL]
Error: RangeFault
% ← &out ← FS.StreamOpen[fileName: "///optdumppha.tt", accessOptions: FS.create, extendFileProc: NIL]
Error: selection failed
% ← &out ← FS.StreamOpen[fileName: "///optdumppha.tt", accessOptions: create, extendFileProc: NIL]
^[streamProcs: 2321222B^, streamData: 13754012B^, propList: 11255324B^, backingStream: NIL]
% ← BoolOps.TTToStream[&newtt, &out]

% ← &out.Close
Error: selection failed
% ← IO.Close[&out]
Error: selection failed
% &out.streamProcs.close[&out, FALSE]
% ← &out.streamProcs.close[&out, FALSE]

%