changeset 0:ece8fc16ff1d

init commit
author e135704 <e135704@ie.u-ryukyu.ac.jp>
date Fri, 21 Oct 2016 23:09:43 +0900
parents
children 1b5ee04a7b4f
files .hgignore Makefile dummy.tex midterm.pdf midterm.tex pic/List.bb pic/List.pdf pic/List.xbb pic/codesegment.bb pic/codesegment.pdf pic/codesegment.xbb pic/emblem-bitmap.pdf pic/gearsosgpgpu.bb pic/gearsosgpgpu.pdf pic/gearsosgpgpu.xbb pic/rb_tree.bb pic/rb_tree.pdf pic/rb_tree.xbb pic/synchronizedQueue.bb pic/synchronizedQueue.pdf pic/synchronizedQueue.xbb picins.sty
diffstat 22 files changed, 900 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore	Fri Oct 21 23:09:43 2016 +0900
@@ -0,0 +1,10 @@
+syntax: glob
+
+*.swp
+.DS_Store
+
+*.log
+*.aux
+*.dvi
+*.toc
+*.cpt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile	Fri Oct 21 23:09:43 2016 +0900
@@ -0,0 +1,36 @@
+# Created by Daichi Toma on Nov 16, 2011
+
+TARGET=midterm
+
+LATEX=platex
+BIBTEX=pbibtex
+DVIPDF=dvipdfmx -p a4
+#You need setting "-l" option if You think You get a landscape PDF
+#DVIPDF_OPT=-l
+
+#Embed fonts
+#DVIPDF_OPT=-f hiraginoEmbed.map
+
+.SUFFIXES: .tex .dvi .pdf
+
+.tex.dvi:
+	$(LATEX) $<
+	#$(BIBTEX) $(TARGET)
+	$(LATEX) $<
+	$(LATEX) $<
+
+.dvi.pdf:
+	$(DVIPDF) $(DVIPDF_OPT) $<
+
+
+all: $(TARGET).pdf
+	open $(TARGET).pdf
+
+dvi: $(TARGET).dvi
+
+pdf: $(TARGET).pdf
+
+
+clean:
+	rm -f *.dvi *.aux *.log *.pdf *.ps *.gz *.bbl *.blg *.toc *~ *.core
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dummy.tex	Fri Oct 21 23:09:43 2016 +0900
@@ -0,0 +1,60 @@
+%%% jdummy.def
+%
+\DeclareRelationFont{JY1}{mc}{it}{}{OT1}{cmr}{it}{}
+\DeclareRelationFont{JT1}{mc}{it}{}{OT1}{cmr}{it}{}
+\DeclareFontShape{JY1}{mc}{m}{it}{<5> <6> <7> <8> <9> <10> sgen*min
+    <10.95><12><14.4><17.28><20.74><24.88> min10
+    <-> min10}{}
+\DeclareFontShape{JT1}{mc}{m}{it}{<5> <6> <7> <8> <9> <10> sgen*tmin
+    <10.95><12><14.4><17.28><20.74><24.88> tmin10
+    <-> tmin10}{}
+\DeclareRelationFont{JY1}{mc}{sl}{}{OT1}{cmr}{sl}{}
+\DeclareRelationFont{JT1}{mc}{sl}{}{OT1}{cmr}{sl}{}
+\DeclareFontShape{JY1}{mc}{m}{sl}{<5> <6> <7> <8> <9> <10> sgen*min
+    <10.95><12><14.4><17.28><20.74><24.88> min10
+    <-> min10}{}
+\DeclareFontShape{JT1}{mc}{m}{sl}{<5> <6> <7> <8> <9> <10> sgen*tmin
+    <10.95><12><14.4><17.28><20.74><24.88> tmin10
+    <-> tmin10}{}
+\DeclareRelationFont{JY1}{mc}{sc}{}{OT1}{cmr}{sc}{}
+\DeclareRelationFont{JT1}{mc}{sc}{}{OT1}{cmr}{sc}{}
+\DeclareFontShape{JY1}{mc}{m}{sc}{<5> <6> <7> <8> <9> <10> sgen*min
+    <10.95><12><14.4><17.28><20.74><24.88> min10
+    <-> min10}{}
+\DeclareFontShape{JT1}{mc}{m}{sc}{<5> <6> <7> <8> <9> <10> sgen*tmin
+    <10.95><12><14.4><17.28><20.74><24.88> tmin10
+    <-> tmin10}{}
+\DeclareRelationFont{JY1}{gt}{it}{}{OT1}{cmbx}{it}{}
+\DeclareRelationFont{JT1}{gt}{it}{}{OT1}{cmbx}{it}{}
+\DeclareFontShape{JY1}{mc}{bx}{it}{<5> <6> <7> <8> <9> <10> sgen*goth
+    <10.95><12><14.4><17.28><20.74><24.88> goth10
+    <-> goth10}{}
+\DeclareFontShape{JT1}{mc}{bx}{it}{<5> <6> <7> <8> <9> <10> sgen*tgoth
+    <10.95><12><14.4><17.28><20.74><24.88> tgoth10
+    <-> tgoth10}{}
+\DeclareRelationFont{JY1}{gt}{sl}{}{OT1}{cmbx}{sl}{}
+\DeclareRelationFont{JT1}{gt}{sl}{}{OT1}{cmbx}{sl}{}
+\DeclareFontShape{JY1}{mc}{bx}{sl}{<5> <6> <7> <8> <9> <10> sgen*goth
+    <10.95><12><14.4><17.28><20.74><24.88> goth10
+    <-> goth10}{}
+\DeclareFontShape{JT1}{mc}{bx}{sl}{<5> <6> <7> <8> <9> <10> sgen*tgoth
+    <10.95><12><14.4><17.28><20.74><24.88> tgoth10
+    <-> tgoth10}{}
+\DeclareRelationFont{JY1}{gt}{sc}{}{OT1}{cmbx}{sc}{}
+\DeclareRelationFont{JT1}{gt}{sc}{}{OT1}{cmbx}{sc}{}
+\DeclareFontShape{JY1}{mc}{bx}{sc}{<5> <6> <7> <8> <9> <10> sgen*goth
+    <10.95><12><14.4><17.28><20.74><24.88> goth10
+    <-> goth10}{}
+\DeclareFontShape{JT1}{mc}{bx}{sc}{<5> <6> <7> <8> <9> <10> sgen*tgoth
+    <10.95><12><14.4><17.28><20.74><24.88> tgoth10
+    <-> tgoth10}{}
+\DeclareRelationFont{JY1}{gt}{it}{}{OT1}{cmr}{it}{}
+\DeclareRelationFont{JT1}{gt}{it}{}{OT1}{cmr}{it}{}
+\DeclareFontShape{JY1}{gt}{m}{it}{<5> <6> <7> <8> <9> <10> sgen*goth
+    <10.95><12><14.4><17.28><20.74><24.88> goth10
+    <-> goth10}{}
+\DeclareFontShape{JT1}{gt}{m}{it}{<5> <6> <7> <8> <9> <10> sgen*tgoth
+    <10.95><12><14.4><17.28><20.74><24.88> tgoth10
+    <-> tgoth10}{}
+\endinput
+%%%% end of jdummy.def
Binary file midterm.pdf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/midterm.tex	Fri Oct 21 23:09:43 2016 +0900
@@ -0,0 +1,151 @@
+\documentclass[twocolumn,twoside,9.5pt]{jarticle}
+\usepackage[dvipdfmx]{graphicx}
+\usepackage{picins}
+\usepackage{fancyhdr}
+%\pagestyle{fancy}
+\lhead{\parpic{\includegraphics[height=1zw,keepaspectratio,bb=0 0 251 246]{pic/emblem-bitmap.pdf}}琉球大学主催 工学部情報工学科 中間発表予稿}
+\rhead{}
+\cfoot{}
+
+\setlength{\topmargin}{-1in \addtolength{\topmargin}{15mm}}
+\setlength{\headheight}{0mm}
+\setlength{\headsep}{5mm}
+\setlength{\oddsidemargin}{-1in \addtolength{\oddsidemargin}{11mm}}
+\setlength{\evensidemargin}{-1in \addtolength{\evensidemargin}{21mm}}
+\setlength{\textwidth}{181mm}
+\setlength{\textheight}{261mm}
+\setlength{\footskip}{0mm}
+\pagestyle{empty}
+
+\input{dummy.tex}
+\begin{document}
+\title{CodeGear,DataGearによるGPGPU処理}
+\author{135704C 氏名 {東恩納}{琢偉} 指導教員 : 河野 真治}
+\date{}
+\maketitle
+\thispagestyle{fancy} 
+
+\section{Gears OS}
+本研究室では並列プログラミングフレームワーク Cerium\cite{cerium} と分散フレームワーク Alice\cite{alice} の開発を行なってきた。
+
+Cerium と Alice を開発して得られた知見から、並列分散処理の信頼性を向上させるにはCodeの分割だけでなくDataの分割も必要であることがわかった。それををふまえ Gears OS\cite{gears}を設計、実装している。\\
+Alice では処理の単位である Code Segment、 データの単位である Data Segment を用いてプログラムを記述\cite{segment}する。
+Code Segment は使用する Input Data Segment, Output Data Segment を指定することで処理とデータの依存関係を解決する。
+Gears OS では Gear という単位を用いてプログラムを Code Gear, Data Gear に細かく分割する。
+これは Alice の Code Segment、 Data Segment にそれぞれ対応する\\
+従来の OS が行う排他制御、メモリ管理、並列実行などは Meta Computation に相当する。
+Meta Computationは本論のComputationを支えるComputationのことである。
+関数型言語では Meta Computation に Monad を用いる手法\cite{monad}がある。
+Gears OS では、Meta Code Gear, Meta Data Gear を Monadとして定義し、Meta Computationを実現する。\\
+また、接続する Gear を変更することでプログラムの振る舞いを変更することを可能にする柔軟性\
+、Monad に基づくメタ計算による並行制御を用いた信頼性の確保を目的とする。
+
+\section{Continuation based C}
+CbC のプログラムでは C の関数の代わりに Code Segment を用いて処理を記述している。
+Code Segment は C の関数と異なり戻り値を持たない。
+Code Segment の宣言はCの関数の構文と同様に行い、型に \_\_code を使うことで宣言できる。
+
+Code SegmentからCode Segmentへの移動は goto の後にCode Segment 名と引数を並べて記述するという CbC独自の構文で行う。
+この goto による処理の遷移を継続と呼ぶ。 
+図\ref{fig:codesegment}はCode Segment 間の継続関係を表している。
+
+C では関数呼び出しを繰り返し行う場合、呼びだされた関数の引数の数だけスタックに値が積まれていくが、戻り値を持たない Code Segment ではスタックに値を積んでいく必要が無くスタックを変更する必要が無い。
+このようなスタックに値を積まない継続、つまり呼び出し元の環境を持たない継続を軽量継続と呼び、軽量継続による並列化、ループ制御、関数コールとスタックの意識した最適化がソースコードで行えるようになる。
+
+\begin{figure}[ht]
+    \centering
+    \includegraphics[width=65mm]{pic/codesegment.pdf}
+    \caption{goto による Code Segment 間の継続}
+    \label{fig:codesegment}
+\end{figure}
+
+
+\section{Code Gear と Data Gear}
+Code Gear はプログラムの実行コードそのものであり、OpenCL\cite{opencl}/CUDA\cite{cuda} の kernel に相当する。
+
+Code Gear は処理の基本として、 Input Data Gear を参照し、一つまたは複数の Output Data Gear に書き込む。また、接続された Data Gear 以外には参照を行わない。
+これは Alice の Input Data Segment と Output Data Segment の関係に対応しており、依存関係を解決し、 Code Segment の並列実行を可能とする。
+
+
+Code Gear はfunction callではないので、呼び出し元に戻る概念はない。
+その代わりに、次に実行する Code Gear を指定する機能(軽量継続)を持つ。
+
+Data Gear には、int や文字列などの Primitive Data Type が入る。
+
+Gear の特徴の一つはその処理が Code Gear, Data Gear に閉じていることにある。
+これにより、Code Gear の実行時間、メモリ使用量を予測可能なものにする。
+
+\section{Context}
+ある Code Gear から継続するときには、次に実行する Code Gear を名前で指定する。
+Meta Code Gear が名前を解釈して、処理を対応する Code Gear に引き渡す。
+これらは、従来の OS の Dynamic Loading Library や Command 呼び出しに対応する。
+名前と Code Gear へのポインタの対応は Meta Data Gear に格納される。
+この Meta Data Gear を Context と呼ぶことにする。
+これは従来の OS の Process や Thread に対応する。
+
+Context には以下のようなものが格納される。
+\begin{itemize}
+    \item Code Gear の名前とポインタの対応表
+    \item Data Gear の Allocation 用の情報
+    \item Code Gear が参照する Data Gear へのポインタ
+    \item Data Gear に格納される Data Type の情報
+\end{itemize}
+
+\section{Red Black Tree}
+ Red Black Tree(赤黒木)は平衡二分木の一種で、主に連想配列の実装に使われる。Red Black Tree の Stack Pop,Stack Push している部分に Stub を仲介させることによって、Stack pop と Stack psuh を Data Segment に分けることで CbC による記述に直した。
+\begin{figure}[ht]
+    \centering
+    \includegraphics[width=70mm]{pic/rb_tree.pdf}
+    \caption{CbCでのRed Black Tree}
+    \label{fig:rb_Tree}
+\end{figure}
+\section{GPGPU}
+ GPGPUとは画像処理に使われるGPUを画像処理以外で利用する技術である。
+GPUはCPUに比べコア数が圧倒的に多く、単純な計算しかできないが並列処理において一度に大量の計算ができるため利用されている。
+Gears OS は Code Gear に分割され処理の依存関係が明確になるので、並列な処理を書きやすい。またData Gear へのアクセスは接続されたCode Gear からのみであるから、処理中に変数が書き変わる事がない。
+\begin{figure}[ht]
+    \centering
+    \includegraphics[width=90mm]{pic/gearsosgpgpu.pdf}
+    \caption{Gears OS による GPGPU}
+    \label{fig:gpgpu}
+\end{figure}
+\section{今後の課題}
+ 今回、Gears OS のGPGPU処理についての基本的な設計と必要な機能の一部を紹介した。
+今後の課題としては、Gears OS による GPGPU処理を実装する。並列化処理に最適な Mappingをほどこす。Cerium、GearsでのMany CPU の並列化処理と比較しながら、GPGPU処理の測定、評価を行う。
+
+
+\begin{thebibliography}{10}
+    \bibitem{cerium}
+        宮國 渡,河野真治,神里 晃,杉山千秋:Cell 用の Fine-grain Task Manager
+        の実装,情報処理学会
+        システムソフトウェアとオペレーティング・システム研究会(OS) (2008).
+
+    \bibitem{alice}
+        赤嶺一樹,河野真治:DataSegment API
+        を用いた分散フレームワークの設計,日本ソフトウェア科学会第28回大会論文集
+        (2011).
+    
+    \bibitem{gears}
+      伊波 立樹, 東恩納 琢偉,河野 真治:Code Gear、Data Gear に基づく OS のプロトタイプ、
+      情報処理学会システムソフトウェアとオペレーティング・システム研究会(OS) (2016).
+
+    \bibitem{segment}
+        河野真治,杉本 優:Code Segment と Data Segment
+        によるプログラミング手法,第54回プログラミング・シンポジウム (2013).
+
+    \bibitem{monad} 
+        Eugenio Moggi, Notion of Computation and Monads(1991)
+
+    \bibitem{cbc-llvm}
+        徳森海斗,河野真治:Continuation based C の LLVM/clang 3.5
+        上の実装について,情報処理学会システムソフトウェアとオペレーティング・システム研究会(OS)
+        (2014).
+
+    \bibitem{opencl}
+        {Aaftab Munshi, Khronos OpenCL Working Group}: {\em {The OpenCL Specification Version 1.0}} (2007).
+
+    \bibitem{cuda}
+        : {CUDA}, {https://developer.nvidia.com/category/zone/cuda-zone/}.
+
+\end{thebibliography}
+\end{document}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pic/List.bb	Fri Oct 21 23:09:43 2016 +0900
@@ -0,0 +1,5 @@
+%%Title: List.pdf
+%%Creator: extractbb 20150315
+%%BoundingBox: 0 0 548 260
+%%CreationDate: Sun Oct 25 04:25:52 2015
+
Binary file pic/List.pdf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pic/List.xbb	Fri Oct 21 23:09:43 2016 +0900
@@ -0,0 +1,8 @@
+%%Title: List.pdf
+%%Creator: extractbb 20150315
+%%BoundingBox: 0 0 548 260
+%%HiResBoundingBox: 0.000000 0.000000 548.000000 260.000000
+%%PDFVersion: 1.3
+%%Pages: 1
+%%CreationDate: Sun Oct 25 04:25:42 2015
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pic/codesegment.bb	Fri Oct 21 23:09:43 2016 +0900
@@ -0,0 +1,5 @@
+%%Title: pic/codesegment.pdf
+%%Creator: extractbb 20150315
+%%BoundingBox: 0 0 393 201
+%%CreationDate: Thu Oct 29 22:24:58 2015
+
Binary file pic/codesegment.pdf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pic/codesegment.xbb	Fri Oct 21 23:09:43 2016 +0900
@@ -0,0 +1,8 @@
+%%Title: pic/codesegment.pdf
+%%Creator: extractbb 20150315
+%%BoundingBox: 0 0 393 201
+%%HiResBoundingBox: 0.000000 0.000000 393.000000 201.000000
+%%PDFVersion: 1.3
+%%Pages: 1
+%%CreationDate: Thu Oct 29 22:24:55 2015
+
Binary file pic/emblem-bitmap.pdf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pic/gearsosgpgpu.bb	Fri Oct 21 23:09:43 2016 +0900
@@ -0,0 +1,5 @@
+%%Title: gearsosgpgpu.pdf
+%%Creator: extractbb 20150315
+%%BoundingBox: 0 0 1156 979
+%%CreationDate: Fri Oct 21 19:35:18 2016
+
Binary file pic/gearsosgpgpu.pdf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pic/gearsosgpgpu.xbb	Fri Oct 21 23:09:43 2016 +0900
@@ -0,0 +1,8 @@
+%%Title: gearsosgpgpu.pdf
+%%Creator: extractbb 20150315
+%%BoundingBox: 0 0 1156 979
+%%HiResBoundingBox: 0.000000 0.000000 1156.000000 979.000000
+%%PDFVersion: 1.3
+%%Pages: 1
+%%CreationDate: Fri Oct 21 19:35:06 2016
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pic/rb_tree.bb	Fri Oct 21 23:09:43 2016 +0900
@@ -0,0 +1,5 @@
+%%Title: rb_tree.pdf
+%%Creator: extractbb 20150315
+%%BoundingBox: 0 0 569 532
+%%CreationDate: Fri Oct 21 19:51:56 2016
+
Binary file pic/rb_tree.pdf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pic/rb_tree.xbb	Fri Oct 21 23:09:43 2016 +0900
@@ -0,0 +1,8 @@
+%%Title: rb_tree.pdf
+%%Creator: extractbb 20150315
+%%BoundingBox: 0 0 569 532
+%%HiResBoundingBox: 0.000000 0.000000 569.000000 532.000000
+%%PDFVersion: 1.3
+%%Pages: 1
+%%CreationDate: Fri Oct 21 19:52:02 2016
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pic/synchronizedQueue.bb	Fri Oct 21 23:09:43 2016 +0900
@@ -0,0 +1,5 @@
+%%Title: synchronizedQueue.pdf
+%%Creator: extractbb 20150315
+%%BoundingBox: 0 0 503 413
+%%CreationDate: Thu Oct 29 22:04:53 2015
+
Binary file pic/synchronizedQueue.pdf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pic/synchronizedQueue.xbb	Fri Oct 21 23:09:43 2016 +0900
@@ -0,0 +1,8 @@
+%%Title: synchronizedQueue.pdf
+%%Creator: extractbb 20150315
+%%BoundingBox: 0 0 503 413
+%%HiResBoundingBox: 0.000000 0.000000 503.000000 413.000000
+%%PDFVersion: 1.3
+%%Pages: 1
+%%CreationDate: Thu Oct 29 22:04:50 2015
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/picins.sty	Fri Oct 21 23:09:43 2016 +0900
@@ -0,0 +1,578 @@
+%       PICINS.STY --- Style File zum Einbinden von Bildern
+%       Autor:  J. Bleser, E. Lang
+%       Hochschulrechenzentrum
+%       Technische Hochschule Darmstadt
+%       !!!  Dieses Style-File ist urheberrechtlich geschuetzt  !!!
+%       !!!  Aenderungen nur mit Zustimmung der Autoren         !!!
+\message{Option `picins' Version 3.0  Sep. 1992, TH Darmstadt/HRZ}
+\newbox\@BILD%
+\newbox\@TEXT%
+\newdimen\d@breite%
+\newdimen\d@hoehe%
+\newdimen\d@xoff%
+\newdimen\d@yoff%
+\newdimen\d@shad%
+\newdimen\d@dash%
+\newdimen\d@boxl%
+\newdimen\d@pichskip%
+\newdimen\d@tmp
+\newdimen\d@tmpa
+\newdimen\d@bskip
+\newdimen\hsiz@%
+\newdimen\p@getot@l%
+\newcount\c@breite
+\newcount\c@hoehe
+\newcount\c@xoff
+\newcount\c@yoff
+\newcount\c@pos
+\newcount\c@shad
+\newcount\c@dash
+\newcount\c@boxl
+\newcount\c@zeilen%
+\newcount\@changemode%
+\newcount\c@piccaption%
+\newcount\c@piccaptionpos%
+\newcount\c@picpos
+\newcount\c@whole%
+\newcount\c@half%
+\newcount\c@tmp
+\newcount\c@tmpa
+\newcount\c@tmpb
+\newcount\c@tmpc
+\newcount\c@tmpd
+\newskip\d@leftskip
+\newif\if@list \@listfalse%
+\newif\if@offset%
+
+
+\c@piccaptionpos=1%
+\c@picpos=0
+\d@shad=4pt%
+\d@dash=4pt%
+\d@boxl=10pt%
+\d@pichskip=1em%
+\@changemode=0%
+\def\@captype{figure}%
+\let\old@par=\par%
+
+\def\pichskip#1{\d@pichskip #1\relax}
+
+
+\def\shadowthickness#1{\d@shad #1\relax}
+
+
+\def\dashlength#1{\d@dash #1\relax}
+
+
+\def\boxlength#1{\d@boxl #1\relax}
+
+
+\def\picchangemode{\@changemode=1}%
+\def\nopicchangemode{\@changemode=0}%
+
+
+\def\piccaptionoutside{\c@piccaptionpos=1}%
+\def\piccaptioninside{\c@piccaptionpos=2}%
+\def\piccaptionside{\c@piccaptionpos=3}%
+\def\piccaptiontopside{\c@piccaptionpos=4}%
+
+\def\piccaption{\@ifnextchar [{\@piccaption}{\@piccaption[]}}
+\def\@piccaption[#1]#2{\c@piccaption=1\def\sh@rtf@rm{#1}\def\capti@nt@xt{#2}}
+\def\make@piccaption{%
+ \hsiz@\d@breite%
+ \ifnum\c@piccaptionpos=2%
+   \advance\hsiz@ -2\fboxsep%
+ \fi%
+ \ifnum\c@piccaptionpos>2%
+   \hsiz@\hsize\advance\hsiz@-\d@breite\advance\hsiz@-\d@pichskip%
+ \fi%
+ \setbox\@TEXT=\vbox{\hsize\hsiz@\caption[\sh@rtf@rm]{\capti@nt@xt}}%
+}
+
+
+
+\def\newcaption{\refstepcounter\@captype\@dblarg{\@newcaption\@captype}}
+\long\def\@newcaption#1[#2]#3{%
+  \old@par%
+  \addcontentsline{\csname ext@#1\endcsname }{#1}%
+    {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}
+  \begingroup\@parboxrestore\normalsize%
+    \@newmakecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\old@par%
+  \endgroup%
+}
+\long\def\@newmakecaption#1#2{%
+  \vskip 10pt%
+  \setbox\@tempboxa \hbox {#1: #2}%
+  \ifdim \wd\@tempboxa >\hsize%
+    \setbox0=\hbox{#1: }\dimen0=\hsize\advance\dimen0 by-\wd0
+    \setbox1=\vtop{\hsize=\dimen0 #2}
+    \hbox{\box0 \box1}
+    \par
+  \else \hbox to\hsize {\hfil \box \@tempboxa \hfil}
+  \fi
+}
+
+
+
+
+
+\def\parpic{%
+  \@ifnextchar ({\iparpic}{\iparpic(0pt,0pt)}
+}
+\def\iparpic(#1,#2){%
+  \@ifnextchar ({\@offsettrue\iiparpic(#1,#2)}%
+                {\@offsetfalse\iiparpic(#1,#2)(0pt,0pt)}
+}
+\def\iiparpic(#1,#2)(#3,#4){%
+  \@ifnextchar [{\iiiparpic(#1,#2)(#3,#4)}{\iiiparpic(#1,#2)(#3,#4)[l]}
+}
+\def\iiiparpic(#1,#2)(#3,#4)[#5]{%
+  \@ifnextchar [{\ivparpic(#1,#2)(#3,#4)[#5]}{\ivparpic(#1,#2)(#3,#4)[#5][]}
+}
+\def\ivparpic(#1,#2)(#3,#4)[#5][#6]#7{%
+ \let\par=\old@par\par%
+ \hangindent0pt\hangafter1%
+ \setbox\@BILD=\hbox{#7}%
+ \d@breite=#1\d@breite=\the\d@breite%
+ \ifdim\d@breite=0pt\d@breite=\wd\@BILD\fi%
+ \c@breite=\d@breite\divide\c@breite by65536%
+ \multiply\c@piccaption\c@piccaptionpos%
+ \d@hoehe=#2\d@hoehe=\the\d@hoehe%
+ \ifdim\d@hoehe=0pt\d@hoehe=\ht\@BILD\advance\d@hoehe by\dp\@BILD\fi%
+ \c@hoehe=\d@hoehe\divide\c@hoehe by65536%
+ \d@xoff=#3\c@xoff=\d@xoff\divide\c@xoff by65536%
+ \d@yoff=\d@hoehe%
+ \advance\d@yoff by-#4\c@yoff=\d@yoff\divide\c@yoff by65536%
+ \c@pos=1\unitlength1pt%
+ \if@offset%
+   \setbox\@BILD=\hbox{%
+     \begin{picture}(\c@breite,\c@hoehe)%
+       \put(0,0){\makebox(\c@breite,\c@hoehe){}}%
+       \put(\c@xoff,\c@yoff){\box\@BILD}%
+     \end{picture}%
+   }%
+ \else%
+   \setbox\@BILD=\hbox{%
+     \begin{picture}(\c@breite,\c@hoehe)%
+       \put(0,0){\makebox(\c@breite,\c@hoehe)[#6]{\box\@BILD}}%
+     \end{picture}%
+   }%
+ \fi%
+ \ifnum\c@piccaption=2%
+   \make@piccaption%
+   \advance\d@hoehe\ht\@TEXT\advance\d@hoehe\dp\@TEXT%
+   \c@hoehe=\d@hoehe\divide\c@hoehe by65536%
+   \setbox\@BILD=\vbox{\box\@BILD\vspace{-5pt}%
+                       \hbox{\hspace{\fboxsep}\box\@TEXT}%
+                       \vspace{4pt}}%
+ \fi%
+ \@tfor\@tempa := #5\do{%
+   \if\@tempa f\setbox\@BILD=\hbox{\Rahmen(\c@breite,\c@hoehe){\box\@BILD}}\fi%
+   \if\@tempa s\setbox\@BILD=\hbox{\Schatten(\c@breite,\c@hoehe){\box\@BILD}}\fi%
+   \if\@tempa o\setbox\@BILD=\hbox{\Oval(\c@breite,\c@hoehe){\box\@BILD}}\fi%
+   \if\@tempa d\setbox\@BILD=\hbox{\Strich(\c@breite,\c@hoehe){\box\@BILD}}\fi%
+   \if\@tempa x\setbox\@BILD=\hbox{\Kasten(\c@breite,\c@hoehe){\box\@BILD}}\fi%
+   \if\@tempa l\c@pos=1\fi%
+   \if\@tempa r\c@pos=2\fi%
+ }%
+ \ifnum\c@piccaption=1%
+   \make@piccaption%
+   \advance\d@hoehe\ht\@TEXT\advance\d@hoehe\dp\@TEXT%
+   \c@hoehe=\d@hoehe\divide\c@hoehe by65536%
+   \setbox\@BILD=\vbox{\box\@BILD\vspace{-5pt}\hbox{\box\@TEXT}\vspace{4pt}}%
+ \fi%
+ \ifodd\count0\c@picpos=0\else\c@picpos=\@changemode\fi%
+ \pagetotal=\the\pagetotal%
+ \d@tmp=\pagegoal\advance\d@tmp by-\pagetotal\advance\d@tmp by-\baselineskip%
+ \ifdim\d@hoehe>\d@tmp%
+   \vskip 0pt plus\d@hoehe\relax\pagebreak[3]\vskip 0pt plus-\d@hoehe\relax%
+   \ifnum\c@picpos=1\c@picpos=0\else\c@picpos=\@changemode\fi%
+ \fi%
+ \ifnum\c@picpos=1\ifnum\c@pos=1\c@pos=2\else\c@pos=1\fi\fi%
+ \ifnum\@listdepth>0
+   \@listtrue\parshape 0%
+   \advance\hsize -\rightmargin%
+   \d@leftskip \leftskip%
+   \leftskip \@totalleftmargin%
+   \if@inlabel\rule{\linewidth}{0pt}\vskip-\baselineskip\relax\fi%
+ \else\@listfalse\medskip%
+ \fi%
+ \if@list\d@tmpa=\linewidth\else\d@tmpa=\hsize\fi%
+ \ifnum\c@piccaption=3%
+   \make@piccaption%
+   \d@tmp\ht\@TEXT\advance\d@tmp\dp\@TEXT%
+   \ifdim\d@hoehe>\d@tmp%
+     \setbox\@TEXT=\vbox to\d@hoehe{\vfill\box\@TEXT\vspace{.2\baselineskip}\vfill}%
+   \else%
+     \setbox\@BILD=\vbox to\d@tmp{\vfill\box\@BILD\vfill}%
+     \d@hoehe\d@tmp%
+   \fi%
+ \fi%
+ \ifnum\c@piccaption=4%
+   \make@piccaption%
+   \d@tmp\ht\@TEXT\advance\d@tmp\dp\@TEXT%
+   \setbox\@TEXT=\vbox to\d@hoehe{\vspace{-10pt}\box\@TEXT\vfil}%
+   \advance\d@hoehe-\d@tmp%
+ \fi%
+ \ifnum\c@pos=1\d@tmpa=0pt%
+   \ifnum\c@piccaption>2%
+      \setbox\@BILD=\hbox{\box\@BILD\hspace{\d@pichskip}\hbox{\box\@TEXT}}%
+   \fi%
+ \else\advance\d@tmpa by-\wd\@BILD\d@breite=-\d@breite%
+   \ifnum\c@piccaption>2%
+      \d@tmpa=0pt%
+      \setbox\@BILD=\hbox{\hbox{\box\@TEXT}\hspace{\d@pichskip}\box\@BILD}%
+   \fi%
+ \fi%
+ \p@getot@l\the\pagetotal%
+ \d@bskip\d@hoehe\advance\d@bskip by\parskip\advance\d@bskip by.3\baselineskip%
+ {\noindent\hspace*{\d@tmpa}\relax%
+  \box\@BILD\nopagebreak\vskip-\d@bskip\relax\nopagebreak}%
+ \d@tmp=-\d@hoehe\divide\d@tmp by\baselineskip%
+ \c@zeilen=\d@tmp\advance\c@zeilen by-1%
+ \ifdim\d@breite<0pt\advance\d@breite by-\d@pichskip%
+ \else\advance\d@breite by\d@pichskip%
+ \fi%
+ \hangindent=\d@breite%
+ \hangafter=\c@zeilen%
+ \let\par=\x@par%
+ \ifnum\c@piccaption=3%
+    \hangindent0pt\hangafter1\let\par=\old@par%
+    \vskip\d@hoehe\vskip.2\baselineskip%
+ \fi%
+ \c@piccaption=0%
+}
+
+
+
+
+\newdimen\ptoti
+\newdimen\ptotii
+\def\x@par{%
+ \ptoti\pagetotal%
+ \old@par%
+ \ptotii\pagetotal%
+ \ifdim\ptoti=\ptotii%
+   \d@tmp\d@hoehe%
+ \else%
+   \d@tmp\baselineskip%
+   \multiply\d@tmp by\prevgraf%
+   \advance\d@tmp by\parskip%
+   \global\advance\d@hoehe by-\d@tmp\d@tmp=\d@hoehe%
+ \fi%
+ \ifdim\d@hoehe>0pt%
+   \divide\d@tmp by\baselineskip\c@zeilen=-\d@tmp\advance\c@zeilen by-1%
+   \c@zeilen=\the\c@zeilen%
+ \else\c@zeilen=0
+ \fi
+ \ifnum\c@zeilen<0\hangafter=\c@zeilen\hangindent=\d@breite%
+ \else\let\par=\old@par%
+   \hangindent 0pt%
+   \leftskip \d@leftskip%
+   \if@list\parshape \@ne \@totalleftmargin \linewidth%
+     \advance\hsize \rightmargin%
+   \fi%
+ \fi%
+}
+
+
+\def\picskip#1{%
+ \let\par=\old@par%
+ \par%
+ \pagetotal\the\pagetotal%
+ \c@tmp=#1\relax%
+ \ifnum\c@tmp=0%
+   \d@tmp\baselineskip\multiply\d@tmp by\prevgraf\advance\d@tmp\parskip%
+   \ifdim\p@getot@l<\pagetotal
+     \advance\d@hoehe by-\d@tmp\advance\d@hoehe by1ex%
+     \ifdim\d@hoehe>0pt\vspace*{\d@hoehe}\fi%
+   \fi%
+   \ifdim\p@getot@l=\pagetotal%
+     \advance\d@hoehe by-\d@tmp\advance\d@hoehe by1ex%
+     \ifdim\d@hoehe>0pt\vspace*{\d@hoehe}\fi%
+   \fi%
+ \else\hangafter=-\c@tmp\hangindent=\d@breite%
+ \fi%
+ \leftskip \d@leftskip%
+ \if@list\parshape \@ne \@totalleftmargin \linewidth%
+   \advance\hsize \rightmargin%
+ \fi%
+}
+
+
+
+
+
+
+\def\hpic{%
+  \@ifnextchar ({\ihpic}{\ihpic(0pt,0pt)}
+}
+\def\ihpic(#1,#2){%
+  \@ifnextchar ({\@offsettrue\iihpic(#1,#2)}%
+                {\@offsetfalse\iihpic(#1,#2)(0pt,0pt)}
+}
+\def\iihpic(#1,#2)(#3,#4){%
+  \@ifnextchar [{\iiihpic(#1,#2)(#3,#4)}{\iiihpic(#1,#2)(#3,#4)[l]}
+}
+\def\iiihpic(#1,#2)(#3,#4)[#5]{%
+  \@ifnextchar [{\ivhpic(#1,#2)(#3,#4)[#5]}{\ivhpic(#1,#2)(#3,#4)[#5][]}
+}
+\def\ivhpic(#1,#2)(#3,#4)[#5][#6]#7{%
+  \setbox\@BILD=\hbox{#7}%
+  \d@breite=#1\d@breite=\the\d@breite%
+  \ifdim\d@breite=0pt\d@breite=\wd\@BILD\fi%
+  \c@breite=\d@breite\divide\c@breite by65536%
+  \d@hoehe=#2\d@hoehe=\the\d@hoehe%
+  \ifdim\d@hoehe=0pt\d@hoehe=\ht\@BILD\advance\d@hoehe by\dp\@BILD\fi%
+  \c@hoehe=\d@hoehe\divide\c@hoehe by65536%
+  \d@xoff=#3\c@xoff=\d@xoff\divide\c@xoff by65536%
+  \d@yoff=\d@hoehe%
+  \advance\d@yoff by-#4\c@yoff=\d@yoff\divide\c@yoff by65536%
+  \c@pos=0\d@tmpa=\parindent\parindent=0pt\unitlength1pt%
+  \if@offset
+    \setbox\@BILD=\hbox{%
+      \begin{picture}(\c@breite,\c@hoehe)%
+        \put(0,0){\makebox(\c@breite,\c@hoehe){}}%
+        \put(\c@xoff,\c@yoff){\box\@BILD}%
+      \end{picture}%
+    }%
+  \else%
+    \setbox\@BILD=\hbox{%
+      \begin{picture}(\c@breite,\c@hoehe)%
+        \put(0,0){\makebox(\c@breite,\c@hoehe)[#6]{\box\@BILD}}%
+      \end{picture}%
+    }%
+  \fi%
+  \@tfor\@tempa := #5\do{%
+    \if\@tempa f\setbox\@BILD=\hbox{\Rahmen(\c@breite,\c@hoehe){\box\@BILD}}\fi%
+    \if\@tempa s\setbox\@BILD=\hbox{\Schatten(\c@breite,\c@hoehe){\box\@BILD}}\fi%
+    \if\@tempa o\setbox\@BILD=\hbox{\Oval(\c@breite,\c@hoehe){\box\@BILD}}\fi%
+    \if\@tempa d\setbox\@BILD=\hbox{\Strich(\c@breite,\c@hoehe){\box\@BILD}}\fi%
+    \if\@tempa x\setbox\@BILD=\hbox{\Kasten(\c@breite,\c@hoehe){\box\@BILD}}\fi%
+    \if\@tempa t\c@pos=1\fi%
+    \if\@tempa b\c@pos=2\fi%
+  }%
+ \ifnum\c@pos=0\parbox{\d@breite}{\makebox[0cm]{}\\\box\@BILD\smallskip}\fi%
+ \ifnum\c@pos=1\parbox[t]{\d@breite}{\makebox[0cm]{}\\\box\@BILD\smallskip}\fi%
+ \ifnum\c@pos=2\parbox[b]{\d@breite}{\makebox[0cm]{}\\\box\@BILD\smallskip}\fi%
+ \parindent=\d@tmpa%
+}
+
+
+
+
+
+
+\def\Rahmen(#1,#2)#3{%
+  \c@whole=\@wholewidth\divide\c@whole by65536%
+  \c@half=\@halfwidth\divide\c@half by65536%
+  \c@tmpa=#1\advance\c@tmpa by\c@whole\advance\c@tmpa by\c@whole%
+  \c@tmpb=#2\advance\c@tmpb by\c@whole\advance\c@tmpb by\c@whole%
+  \begin{picture}(\c@tmpa,\c@tmpb)%
+    \put(\c@whole,\c@half){\framebox(#1,#2){#3}}%
+  \end{picture}%
+  \global\advance\d@breite by2\@wholewidth%
+  \global\advance\d@hoehe by2\@wholewidth%
+}
+
+
+\def\Schatten(#1,#2)#3{%
+  \c@whole=\@wholewidth\divide\c@whole by65536%
+  \c@half=\@halfwidth\divide\c@half by65536%
+  \c@shad=\d@shad\divide\c@shad by65536%
+  \c@tmp=\c@whole\advance\c@tmp by\c@whole\c@tmpd=\c@tmp%
+  \advance\c@tmp by\c@shad%
+  \advance\c@tmpd by#1%
+  \advance\c@half by\c@shad%
+  \c@tmpa=#1\advance\c@tmpa by\c@tmp%
+  \c@tmpb=#2\advance\c@tmpb by\c@tmp%
+  \begin{picture}(\c@tmpa,\c@tmpb)%
+    \put(\c@whole,\c@half){\framebox(#1,#2){#3}}%
+    \put(\c@shad,0){\rule{\c@tmpd pt}{\c@shad pt}}%
+    \put(\c@tmpd,0){\rule{\c@shad pt}{#2 pt}}%
+  \end{picture}%
+  \global\advance\d@breite by2\@wholewidth\global\advance\d@breite by\d@shad%
+  \global\advance\d@hoehe by2\@wholewidth\global\advance\d@hoehe by\d@shad%
+}
+
+
+\def\Oval(#1,#2)#3{%
+  \@wholewidth=0.4pt%
+  \c@tmpa=\the#1\divide\c@tmpa by2%
+  \c@tmpb=\the#2\divide\c@tmpb by2%
+  \begin{picture}(#1,#2)%
+    \put(\c@tmpa,\c@tmpb){\oval(#1,#2)}%
+    \put(0.4,0.4){#3}%
+  \end{picture}%
+  \global\advance\d@breite by1pt\global\advance\d@hoehe by1pt%
+}
+
+
+\def\Strich(#1,#2)#3{%
+  \c@whole=\@wholewidth\divide\c@whole by65536%
+  \c@half=\@halfwidth\divide\c@half by65536%
+  \c@dash=\d@dash\divide\c@dash by65536%
+  \c@tmp=\c@whole\advance\c@tmp by\c@whole%
+  \c@tmpa=#1\advance\c@tmpa by\c@tmp%
+  \c@tmpb=#2\advance\c@tmpb by\c@tmp%
+  \c@tmpc=#1\advance\c@tmpc by\c@whole%
+  \c@tmpd=#2\advance\c@tmpd by\c@whole%
+  \begin{picture}(\c@tmpa,\c@tmpb)%
+    \put(\c@half,\c@half){\dashbox{\c@dash}(\c@tmpc,\c@tmpd){#3}}%
+  \end{picture}%
+  \global\advance\d@breite by2\@wholewidth%
+  \global\advance\d@hoehe by2\@wholewidth%
+}
+
+
+\def\Kasten(#1,#2)#3{%
+  \@wholewidth=0.4pt%
+  \c@boxl=\d@boxl\divide\c@boxl by65536\c@boxl=\the\c@boxl%
+  \c@tmpa=#1\advance\c@tmpa by\c@boxl%
+  \c@tmpb=#2\advance\c@tmpb by\c@boxl%
+  \c@tmp=#2%
+  \begin{picture}(\c@tmpa,\c@tmpb)%
+    \put(0,\c@boxl){\framebox(#1,#2){#3}}%
+    \put(\c@boxl,0){\line(-1,1){\c@boxl}}%
+    \put(\c@boxl,0){\line(1,0){#1}\line(-1,1){\c@boxl}}%
+    \put(\c@boxl,0){\put(#1,0){\line(0,1){\c@tmp}%
+         \put(0,\c@tmp){\line(-1,1){\c@boxl}}}}%
+  \end{picture}%
+  \global\advance\d@breite by\d@boxl%
+  \global\advance\d@hoehe by\d@boxl%
+}
+
+
+
+
+
+\newbox\env@box%
+\newdimen\d@envdp
+\newcount\c@hsize
+\newcount\c@envdp
+\newdimen\d@envb
+
+\long\def\frameenv{\@ifnextchar [{\@frameenv}{\@frameenv[\textwidth]}}
+\long\def\@frameenv[#1]{%
+ \hsiz@=\textwidth  \textwidth=#1  \d@envb=#1
+ \advance\textwidth by-2\@wholewidth
+ \advance\textwidth by-2\fboxsep
+ \hsize=\textwidth   \linewidth=\textwidth
+ \setbox\env@box=\vbox\bgroup}%
+\def\endframeenv{%
+ \egroup%
+ \hsize=\hsiz@  \textwidth=\hsiz@  \linewidth=\hsiz@
+ \c@breite=\d@envb   \divide\c@breite by65536
+ \advance\d@envb by-2\@wholewidth
+ \c@hsize=\d@envb  \divide\c@hsize by65536%
+ \d@envdp=\dp\env@box  \advance\d@envdp by\ht\env@box%
+ \advance\d@envdp by2\fboxsep%
+ \d@hoehe=\d@envdp   \advance\d@hoehe by2\@wholewidth
+ \c@hoehe=\d@hoehe   \divide\c@hoehe by65536
+ \c@envdp=\d@envdp   \divide\c@envdp by65536%
+ \c@tmp=\@wholewidth \divide\c@tmp by65536
+ \vskip\@wholewidth%
+ \unitlength 1pt\noindent%
+ \begin{picture}(\c@breite,\c@hoehe)(0,0)
+   \put(\c@tmp,\c@tmp){\framebox(\c@hsize,\c@envdp){\box\env@box}}
+ \end{picture}%
+}
+
+
+
+\long\def\shadowenv{\@ifnextchar [{\@shadowenv}{\@shadowenv[\textwidth]}}
+\long\def\@shadowenv[#1]{%
+ \hsiz@=\textwidth  \textwidth=#1  \d@envb=#1
+ \advance\textwidth by-2\@wholewidth
+ \advance\textwidth by-2\fboxsep
+ \advance\textwidth by-\d@shad%
+ \hsize=\textwidth   \linewidth=\textwidth
+ \setbox\env@box=\vbox\bgroup}%
+\def\endshadowenv{%
+ \egroup
+ \hsize=\hsiz@  \textwidth=\hsiz@  \linewidth=\hsiz@
+ \d@tmpa=\d@envb
+ \c@breite=\d@envb   \divide\c@breite by65536
+ \advance\d@envb by-2\@wholewidth  \advance\d@envb by-\d@shad
+ \c@hsize=\d@envb  \divide\c@hsize by65536%
+ \d@envdp=\dp\env@box  \advance\d@envdp by\ht\env@box%
+ \advance\d@envdp by2\fboxsep%
+ \c@envdp=\d@envdp   \divide\c@envdp by65536%
+ \d@hoehe=\d@envdp
+ \advance\d@hoehe by2\@wholewidth  \advance\d@hoehe by\d@shad
+ \c@hoehe=\d@hoehe    \divide\c@hoehe by65536
+ \c@shad =\d@shad     \divide\c@shad  by65536
+ \c@tmp=\@wholewidth  \divide\c@tmp by65536
+ \advance\d@tmpa by-2\d@shad
+ \c@xoff =\d@tmpa     \divide\c@xoff by65536
+ \advance\c@xoff by\c@shad  \advance\c@xoff by-1
+ \advance\d@envdp by\@wholewidth
+ \vskip\@halfwidth
+ \unitlength 1pt\noindent%
+ \begin{picture}(\c@breite,\c@hoehe)(0,0)
+    \put(\c@tmp,\c@shad){\framebox(\c@hsize,\c@envdp){\box\env@box}}
+    \put(\c@shad,0){\rule{\d@tmpa}{\d@shad}}%
+    \put(\c@xoff,0){\rule{\d@shad}{\d@envdp}}%
+ \end{picture}%
+ \vskip\@halfwidth
+}
+
+
+\long\def\dashenv{\@ifnextchar [{\@dashenv}{\@dashenv[\textwidth]}}
+\long\def\@dashenv[#1]{%
+ \hsiz@=\textwidth  \textwidth=#1  \d@envb=#1
+ \advance\textwidth by-2\@wholewidth  \advance\textwidth by-2\fboxsep
+ \hsize=\textwidth   \linewidth=\textwidth
+ \setbox\env@box=\vbox\bgroup}%
+\long\def\enddashenv{%
+ \egroup
+ \hsize=\hsiz@  \textwidth=\hsiz@  \linewidth=\hsiz@
+ \c@breite=\d@envb   \divide\c@breite by65536
+ \advance\d@envb by-\@wholewidth
+ \c@hsize=\d@envb  \divide\c@hsize by65536%
+ \d@envdp=\dp\env@box  \advance\d@envdp by\ht\env@box%
+ \advance\d@envdp by2\fboxsep%
+ \advance\d@envdp by\@wholewidth
+ \d@hoehe=\d@envdp   \advance\d@hoehe by2\@wholewidth
+ \c@hoehe=\d@hoehe   \divide\c@hoehe by65536
+ \c@envdp=\d@envdp   \divide\c@envdp by65536%
+ \c@dash=\d@dash     \divide\c@dash  by65536%
+ \c@whole=\@wholewidth  \divide\c@whole by65536
+ \c@half=\@halfwidth  \divide\c@half by 65536
+ \noindent\unitlength 1pt
+ \begin{picture}(\c@breite,\c@hoehe)(0,0)
+   \put(\c@half,\c@whole){\dashbox{\c@dash}(\c@hsize,\c@envdp){\box\env@box}}
+ \end{picture}%
+}
+
+
+\long\def\ovalenv{\@ifnextchar [{\@ovalenv}{\@ovalenv[\textwidth]}}%
+\long\def\@ovalenv[#1]{%
+ \hsiz@=\textwidth  \textwidth=#1  \d@envb=#1
+ \advance\textwidth by-4\fboxsep
+ \hsize=\textwidth   \linewidth=\textwidth
+ \setbox\env@box=\vbox\bgroup}%
+\long\def\endovalenv{%
+ \egroup
+ \hsize=\hsiz@  \textwidth=\hsiz@  \linewidth=\hsiz@
+ \@wholewidth=0.4pt
+ \c@breite=\d@envb   \divide\c@breite by65536
+ \advance\d@envb by-2\@wholewidth
+ \c@hsize=\d@envb  \divide\c@hsize by65536%
+ \d@envdp=\dp\env@box  \advance\d@envdp by\ht\env@box%
+ \advance\d@envdp by4\fboxsep%
+ \c@envdp=\d@envdp   \divide\c@envdp by65536%
+ \d@hoehe=\d@envdp   \advance\d@hoehe by2\@wholewidth
+ \c@hoehe=\d@hoehe   \divide\c@hoehe by65536
+ \c@tmpa=\c@hsize   \divide\c@tmpa by2%
+ \c@tmpb=\c@envdp   \divide\c@tmpb by2%
+ \d@tmpa=2\fboxsep   \advance\d@tmpa by\@wholewidth
+ \c@xoff=\d@tmpa     \divide\c@xoff  by65536%
+ \advance\d@tmpa by\dp\env@box
+ \c@yoff=\d@tmpa     \divide\c@yoff  by65536%
+ \unitlength 1pt\noindent
+ \begin{picture}(\c@breite,\c@hoehe)(0,0)
+   \put(\c@tmpa,\c@tmpb){\oval(\c@hsize,\c@envdp)}
+   \put(\c@xoff,\c@yoff){\box\env@box}%
+ \end{picture}%
+}