Compare commits

..

2 Commits

Author SHA1 Message Date
JanUlrich a7918d2895 Add Gradle Wrapper 2023-01-10 14:23:22 +01:00
JanUlrich 2edb23f2d8 Change BigRefactoring to Gradle build 2023-01-10 14:22:05 +01:00
3190 changed files with 43706 additions and 570980 deletions
-10
View File
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry excluding=".classpath|.cvsignore|.externalToolBuilders/|.project|.settings/|Papers/|bin/|doc/|examples/|lib/|notizen/|src/|test/|tools/" including="log4j.xml" kind="src" path=""/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/log4j-1.2.12.jar"/>
<classpathentry kind="lib" path="lib/junit-4.0.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
-12
View File
@@ -1,12 +0,0 @@
bin
*.class
output*
JavaLexer.java
JavaParser.java
*.~*~
*.aux
*.dvi
*.log
y.output
Bytecode
JavaParserBuilder.launch
@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${workspace}"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/JavaCompilerCore/tools/AntParserBuilderWindows.xml"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="JavaCompilerCore"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/JavaCompilerCore/tools/AntParserBuilderWindows.xml}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="incremental,clean"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/JavaCompilerCore/tools}"/>
</launchConfiguration>
+9
View File
@@ -0,0 +1,9 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf
# These are Windows script files and should use crlf
*.bat text eol=crlf
+30
View File
@@ -1,5 +1,7 @@
CVS
bin
*.class
*.log
# Mobile Tools for Java (J2ME)
.mtj.tmp/
@@ -8,3 +10,31 @@ CVS
*.jar
*.war
*.ear
# IDEs
.classpath
*.iml
.idea/
/target/
.DS_Store
.project
.settings/
/target/
#
manually/
logFiles/**
!logFiles/.gitkeep
src/main/java/de/dhbwstuttgart/parser/antlr/
src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr/
#GRADLE
# Ignore Gradle project-specific cache directory
.gradle
# Ignore Gradle build output directory
build
-27
View File
@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>JavaCompilerCore</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>clean,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/JavaParserBuilder.launch</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
@@ -1,5 +0,0 @@
eclipse.preferences.version=1
encoding//src/mycompiler/mystatement/LambdaExpression.java=UTF-8
encoding//src/typinferenz/SingleConstraint.java=UTF-8
encoding//src/typinferenz/UndConstraint.java=UTF-8
encoding/<project>=ISO-8859-1
-12
View File
@@ -1,12 +0,0 @@
eclipse.preferences.version=1
instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7
-4
View File
@@ -1,4 +0,0 @@
#Sun Jul 27 10:21:29 CEST 2008
eclipse.preferences.version=1
instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
internal.default.compliance=default
-76
View File
@@ -1,76 +0,0 @@
\begin{thebibliography}{CMP00}
\bibitem[B{\"a}u05]{JB05}
J{\"o}rg B{\"a}uerle.
\newblock {\em Typinferenz in \textsf{Java}}.
\newblock Studienarbeit, BA Stuttgart/Horb, 2005.
\newblock (in german).
\bibitem[CMP00]{CMP2000}
Emmanuel Chailloux, Pascal Manoury, and Bruno Pagano.
\newblock {\em D\'eveloppement d'applications avec Objective Caml}.
\newblock O'Reilly, avril 2000.
\newblock in french, translation http://caml.inria.fr/oreilly-book.
\bibitem[Lit98]{VL98}
Vassily Litvinov.
\newblock Constraint-based polymorphism in {Cecil}: Towards a practical and
static type system.
\newblock In {\em {OOPSLA} '98 Conference Proceedings}, volume 33(10), pages
388--411, 1998.
\bibitem[Mel05]{MM05}
Markus Melzer.
\newblock {\em Integration der \textsf{Java}--Typeinferenz in eine
Programmierumgebung}.
\newblock Studienarbeit, BA Stuttgart/Horb, 2005.
\newblock Studienarbeit (in german).
\bibitem[Ode02]{MO02}
Martin Odersky.
\newblock Inferred type instantiation for {GJ}.
\newblock Note sent to the types mailing list, January 2002.
\bibitem[Ott04]{TO04}
Thomas Ott.
\newblock {\em Typinferenz in \textsf{Java}}.
\newblock Studienarbeit, BA Stuttgart/Horb, 2004.
\newblock (in german).
\bibitem[OZZ01]{OZZ01}
Martin Odersky, Christoph Zenger, and Matthias Zenger.
\newblock Colored local type inference.
\newblock {\em ACM SIG{\-}PLAN Notices}, 36(3):41--53, 2001.
\bibitem[PC94]{PC94}
John Plevyak and Andrew~A. Chien.
\newblock Precise concrete type inference for object-oriented languages.
\newblock In {\em Proceedings of the ninth annual conference on Object-oriented
programming systems, language, and applications}, pages 324--340. ACM Press,
1994.
\bibitem[Pl{\"u}04]{Plue04_1}
Martin Pl{\"u}micke.
\newblock Type unification in \textsf{Generic--Java}.
\newblock In Michael Kohlhase, editor, {\em Proceedings of 18th {I}nternational
{W}orkshop on {U}nification ({U}{N}{I}{F}'04)}, July 2004.
\newblock {\tt http://www.faculty.iu-bremen.de/mkohlhase/event/unif04}.
\bibitem[PS91]{PS91}
Jens Palsberg and Michael~I. Schwartzbach.
\newblock Object-oriented type inference.
\newblock {\em Proceedings of OOPSLA'91, ACM SIGPLAN Sixth Annual Conference on
Object-Oriented Programming Systems, Languages and Applications}, pages
146--161, October 1991.
\bibitem[PS94]{PS94}
Jens Palsberg and Michael~I. Schwartzbach.
\newblock {\em Object-oriented type systems}.
\newblock John Wiley \& Sons, 1994.
\bibitem[PT00]{PT00}
Benjamin~C. Pierce and David~N. Turner.
\newblock Local type inference.
\newblock {\em ACM Trans. Program. Lang. Syst.}, 22(1):1--44, 2000.
\end{thebibliography}
Binary file not shown.
-140
View File
@@ -1,140 +0,0 @@
\documentclass[11pt]{article}
\setlength{\unitlength}{1 true cm}
\setlength{\oddsidemargin}{0 true mm}
\setlength{\evensidemargin}{\oddsidemargin}
\setlength{\textwidth}{160 true mm}
\setlength{\parindent}{5 true mm}
\setlength{\topmargin}{1 true mm}
\setlength{\headheight}{12 true pt}
\setlength{\headsep}{20 true pt}
\setlength{\textheight}{240 true mm}
\setlength{\footskip}{15 true mm}
\setlength{\voffset}{-10 true mm}
%\setlength{\footheight}{5 true mm}
\usepackage{prolog}
\title{Type--Inference in \javafive}
\author{J\"org B\"auerle, Markus Melzer, Martin Pl\"umicke\medskip\\
\small
University of Cooperative Education Stuttgart\\
%Department of Information Technology\\
%Florianstra{\ss}e 15\\
%D--72160 Horb\\
%tel. +49-7451-521142\\
%fax. +49-7451-521190\\
\small m.pluemicke@ba-horb.de
}
\begin{document}
\bibliographystyle{alpha}
\maketitle
\section{Overview}
We have developed for \javafive a type inference system. This means that the
user can write programs without any type annotations and the system determines
the correct types. We have implemented a prototype for this
system. Furthermore we have implemented a plugin for the integrated development
environment \eclipse.
\section{The Type Inference Algorithm}
Since then type inference in \oldjava similar languages is known as the
automatic parameter instantiation in polymorphic methods (local type inference)
\cite{PT00,OZZ01,MO02}. It is proved that this type inference is
unsound. Some techniques are presented, which solve these unsoundness.
We extend these approaches to a global variant, where additionally
the types of method parameters, methods' return types and the
types of local variables are determined automatically. The input of the algorithm
are only the types of the fields of the respective classes.
The type inference algorithm traverses the programming code as an abstract syntax
tree and forms sets of type inequations. As it is known that even the local
type inference is unsound, it is obvious that our approach is also unsound. We
deal with this problem, as we allow different type assumptions for the
parameters, the return type, the local variables, and the expressions of each
method, respectively. During traversing the set of type assumptions is adapted, such
that the set contains exactly the assumptions, which are possible assumptions at
the respective position during the traverse. The adaption is done by solving the
inequations as far as possible by a type unification algorithm
\cite{Plue04_1}. The type unification is not unitary but finitary. This means
that each unification step reduces the set of type assumptions if there is no
solution for one set of inequations. On the other hand the set of type assumptions is extended, if
there is more than one solution for a set of inequations.
The result of the type inference algorithm is the set of all correct
combinations of types of the parameters, the return type, and the local
variables.
After the type inference step during the compilation, there are two possibilities. Either for each
combination of types of each method, byte code could be built,
respectively. This would lead to the property that method names, which are
declared only once, could be overloaded.
On the other hand one combination could
be selected. Then, for this combination of types byte code would be built. We
implemented the second possibility (cp. section \ref{sec:IDE}).
Furthermore, we have done comparisons to other type inference
approaches. We considered the
type system of \textsf{Cecil} \cite{VL98}, which is a static type system
providing type checking and local type inference. Furthermore we considered a
type system for a language oriented at \textsf{Smalltalk} \cite{PS91,
PS94}. In this approach the types are computed by a least fixed point derivation.
In \cite{PC94} type inference for the language \textsf{Concurrent Aggregates} is
described, which contains a data flow analysis. Finally, we considered the type
system of \textsf{ocaml} \cite{CMP2000}. The approach of this type system
differs from our's, as \textsf{ocaml} allows higher-order functions.
\section{Implementation}
We have done the implementation in \oldjava. The implementation consists of two
parts. First we describe the implementation of the type unification
algorithm. Then we present the implementation of the actual type inference via
code traverse.
\subsection{Type Unification}
The implementation of the type unification \cite{TO04} contains as the main
datastructure a vector of type term pairs. The algorithm itself is
implemented as an extension of the usual unification algorithm. Pairs of
the form $a \olsub ty$ respectively $ty \olsub a$, where $a$ is a variable and
$ty$ is a term but no variable, generate multiple solutions.
\subsection{Type Inference}
The idea of the implementation of the actual type inference algorithm
\cite{JB05} is that each construct in a \javafive program (method, parameter,
return type, variable,
expression) get first a variable as its type assumption. Then, for each variable a
type is determined by the algorithm.
There are two main datastructures.
The first one represents type assumptions for methods, fields, and
variables. During runtime a set of instances of this
datastructure represent the different possibilities of type assumptions. The
second main datastructure represents the substitutions of the variables to types,
calculated step by step.
During runtime each construct of the abstract syntax tree is registered
as a listener by the corresponding type variable. These registrations finally allow
to substitute the variables in the abstract syntax tree by the
calculated types.
\section{Integrated Development Environment (IDE)}
\label{sec:IDE}
For \javafive without explicite type declaration a plugin for \eclipse is
developed \cite{MM05}. The IDE allows to show all different correct
possibilities to give types to the methods, parameters, return types, and local
variables, which are determined by the type inference algorithm. Then, the user
can select the favored type for each construct step by step. Finally, the
selected types are substituted in the respective constructs of the abstract syntax
tree.
\section{Summary and Outlook}
We have developed a system, which allows to give typeless \javafive
programs. The system calculates the correct types. The soundness problem is
solved such that all different possibilities are determined and the user
himself decides, which type should be used.
In the moment only a subset of \javafive is implemented. Interfaces and
F--bounded type parameters are not implemented yet. This should be done
henceforth.
\bibliography{martin,SE}
\end{document}
File diff suppressed because it is too large Load Diff
-708
View File
@@ -1,708 +0,0 @@
\usepackage{float}
\usepackage{color}
\usepackage{xspace_spezial}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{alltt}
\usepackage{fancybox}
\usepackage{stmaryrd}
\usepackage{verbatim}
\usepackage{epsfig}
\usepackage{multicol}
\newlength{\textwid}
\setlength{\textwid}{\textwidth}
\addtolength{\textwid}{-4ex}
\newlength{\textfighei}
\setlength{\textfighei}{\textheight}
\addtolength{\textfighei}{-10ex}
\DeclareSymbolFont{blackboard}{OT1}{bbm}{m}{sl}
\DeclareMathSymbol{\IR}{0}{blackboard}{"52}
\DeclareMathSymbol{\IN}{0}{blackboard}{"4E}
\DeclareMathSymbol{\IF}{0}{blackboard}{"46}
\DeclareMathSymbol{\IP}{0}{blackboard}{"50}
\DeclareMathSymbol{\IK}{0}{blackboard}{"4D}
\DeclareMathSymbol{\IZ}{0}{blackboard}{"5A}
\DeclareMathSymbol{\IQ}{0}{blackboard}{"51}
\DeclareMathSymbol{\IC}{0}{blackboard}{"43}
\parindent 0mm
\renewcommand{\unlhd}{<}
%\renewcommand{\lhd}{<\!\!|}
%\renewcommand{\rhd}{|\!\!>}
\definecolor{blue}{rgb}{0,0,1}
\definecolor{red}{rgb}{1,0,0}
\definecolor{green}{rgb}{0,1,0.3}
\definecolor{bluered}{rgb}{1,0,1}
\definecolor{bluegreen}{rgb}{1,0.3,0}
\newcommand{\red}[1]{\textcolor{red}{#1}}
\newcommand{\blue}[1]{\textcolor{blue}{#1}}
\newcommand{\green}[1]{\textcolor{green}{#1}}
\newcommand{\bluered}[1]{\textcolor{bluered}{#1}}
\newcommand{\bluegreen}[1]{\textcolor{bluegreen}{#1}}
\reversemarginpar
\newcommand{\commentary}[1]{\marginpar[\tiny #1]{\tiny #1}}
%\newcommand{\commentaryforKlaeren}[1]{\marginpar[\tiny #1]{\tiny #1}}
%\newcommand{\commentary}[1]{}
\newcommand{\commentaryforKlaeren}[1]{}
%
% figure - Einstellungen
%
\def\textfraction{0}
\def\topfraction{1.5}
\def\bottomfraction{1}
\def\floatpagefraction{1.0}
%\def\dbltopfraction{1}
%\def\dblfloatpagefraction{1.0}
\newcommand{\indexentry}[2]{\item[] #1 \dotfill #2\qquad\qquad\vspace{-0.8em}}
\newcommand{\sub}{\textrm{\,$\sqsubseteq$\,}\xspace}
\newcommand{\nsub}{\text{\,$\not\sqsubseteq$\,}\xspace}
\newcommand{\ecap}{\mbox{$\,\sqcap\,$}}
\newcommand{\ecup}{\mbox{$\,\sqcup\,$}}
\newcommand{\pre}{\mbox{$\,\preceq\,$}}
\newcommand{\botam}{{\{\, \bot,\ \amalg \,\}}\xspace}
%
% Substitutions
%
\newcommand{\subst}{\textrm{$\expbf{subst}{\normaltset}$}}
%
% Signaturen
%
\def\einf#1#2{\mbox{$(#1,~#2)$}\xspace}
\newcommand{\sig}{\einf{\normalbtermset}{\Theta}}
\newcommand{\typesig}{\einf{BTV}{TC}\xspace}
\newcommand{\einsig}{\einf{\normaltermset}{F}\xspace}
\newcommand{\msig}{\einsig}
\newcommand{\mssig}{\einf{\equivtermset}{F_{ms}}\xspace}
\newcommand{\ossig}{\einf{\normaltset, \sub}{F_{os}}\xspace}
\def\einfm#1#2{\langle #1,\ #2 \rangle}
%\def\pos#1#2{\einf{#1,\ \sqsubseteq}{#2}}
\def\pos#1#2#3{\einf{#1,\ #2}{#3}}
\def\posm#1#2{\pos{#1}{#2}}
\def\posSO#1{\pos{#1}{F}}
\def\posSIG#1{\pos{S}{#1}}
\newcommand{\posig}{\pos{\normaltset}{\olsub}{\Sigma}}
\newcommand{\posigM}{\pos{\normaltset}{\olsub}{M}}
%\newcommand{\posig}{\pos{S}{\Sigma}}
\newcommand{\overposig}{\pos{\overline{S}}{\overline{\Sigma}}}
\def\fsf#1#2#3{\mbox{$#1^{(#2,#3)}$}\xspace}
\def\Sigmaa#1#2{\fsf{F}{#1}{#2}\xspace}
\newcommand{\Sigmaws}{\Sigmaa{w}{s}}
\newcommand{\Sigmawt}{\Sigmaa{w}{\theta}}
\def\set#1{\{\,#1 \,\}}
\newcommand{\termset}[3]{\textrm{$\exp{#1_{#2}}{#3}$}\xspace}
\newcommand{\normaltset}{\termset{T}{\Theta}{TV}}
\newcommand{\normaltermset}{\termset{T}{\Theta}{TV}}
\newcommand{\normalbtermset}{\termset{T}{TC}{BTV}}
\newcommand{\equivtermset}{\textrm{$\exp{T_{\Theta_{\sim}}}{TV}$}\xspace}
\newcommand{\equiva}[1]{[#1]_{\sim}}
\newcommand{\popoSIG}[1]{\einf{\normaltset,~\sqsubseteq}{#1}}
\newcommand{\poposig}{\popoSIG{F}}
%\newcommand{\poss}{polymorphically order-sorted signature\xspace}
%\newcommand{\posa}{polymorphically order-sorted algebra\xspace}
\newcommand{\polyosalg}{\textrm{\rm \textbf{PolyOSAlg}$_{\SigO}$}}
\newcommand{\polyalg}{\textrm{\rm \textbf{PolyAlg}$_{\SigM}$}}
\newcommand{\SigO}{\textrm{$\Sigma_{\textit{os}}$}\xspace}
\newcommand{\FuO}{\textrm{$F$}\xspace}
\newcommand{\SigM}{\textrm{$\Sigma_{\textit{ms}}$}\xspace}
\newcommand{\FuM}{\textrm{$F$}\xspace}
\newcommand{\Sig}{\textrm{$\Sigma$}\xspace}
\newcommand{\SigE}{\textrm{$\Sigma_{\textit{ext}}$}\xspace}
\newcommand{\objprogram}{\textrm{$<\Sig, \, E>$}\xspace}
%
% Algebren
%
\let\oldsqsubseteq=\sqsubseteq
\renewcommand{\sqsubseteq}{\leq}
\def\alg#1#2{\textrm{{\rm (}$#1;#2${\rm )}}\xspace}
\def\algm#1#2{(#1;#2)}
\def\algME#1{\alg{#1}{\alpha}}
\def\algABB#1{\alg{A}{#1}}
\def\algebra{\alg{A}{\alpha}}
\def\termalg{\mbox{$\algm{T_{\text{\rm posig}}}{\iota}$}}
\def\termalgm#1{\algm{T_{\text{#1}}}{\iota_{\text{#1}}}}
\def\OStermsetvar#1{\textrm{$T_{\SigO}#1$}\xspace}
\def\OStermset{\OStermsetvar{(V)}}
\def\OStset{\OStermsetvar{}\xspace}
\def\OStermsettypevar#1#2{\textrm{$T^{#1}_{\SigO}#2$}\xspace}
\def\OStermsettype#1{\OStermsettypevar{#1}{(V)}}
\def\ops{\exp{Ops}{A}}
\def\exp#1#2{#1(\,#2\,)\xspace}
%\def\exptt#1#2{\exp{\text{\tt #1}}{\text{\tt #2}}}
\def\exptt#1#2{\exp{\mbox{$\mathtt{#1}$}}{\mbox{$\mathtt{#2}$}}}
\def\expsyn#1#2{\exp{\syn{#1}}{\syn{#2}}}
\def\expbf#1#2{\exp{\text{\bf #1}}{#2}}
\def\expsf#1#2{\exp{\text{\sf #1}}{#2}}
\def\exptype#1#2{#1\textrm{{\tt <}}#2\textrm{{\tt >}}\xspace}
\def\exptypett#1#2{\mathtt{#1}\textrm{{\tt <}}\mathtt{#2}\textrm{{\tt >}}\xspace}
\def\smalltt#1{\texttt{\small #1}}
\def\term{\textrm{$\exp{f}{t_1, \ \ldots \ ,t_n}$}\xspace}
\def\hverbandm#1#2{\textrm{$(#1,~#2)$}}
\def\partord#1#2{\hverbandm{#1}{#2}\xspace}
\def\eval#1{eval_{\left<#1\right>}\xspace}
\def\evalA{$\eval{\algm{A}{\alpha}}$\xspace}
\def\la#1#2{\mbox{$\lambda#1.#2$}\xspace}
\def\set#1{\{\, #1 \,\}}
\newcommand{\inletters}[1]{
\ifx\the
first
\fi}
%\newcommand{\olsub}{\textrm{$\, \ol{\sqsubseteq} \,$}\xspace}
\newcommand{\olsub}{\textrm{$\, \leq^\ast \,$}\xspace}
\newcommand{\olsubprime}{\textrm{$\, \ol{\sqsubseteq}' \,$}\xspace}
\newcommand{\nolsub}{\textrm{$\, \not\sqsubseteq^* \,$}\xspace}
\newcommand{\hverband}{\partord{S}{\sqsubseteq}\xspace}
\newcommand{\qverband}{\partord{\exp{\ol{T}_{\Theta}}{V}}{\olsub}}
\newcommand{\cloqverband}{\partord{\exp{T_{\Theta}}{V}}{\olsub}}
\newcommand{\hord}{\mbox{$(S,~\sqsubseteq)$}\xspace}
\def\einschr#1{|_{#1}}
%\newcommand{\lsem}{[\hspace*{-0.3ex}[}
%\newcommand{\rsem}{]\hspace*{-0.3ex}]}
\newcommand{\lsem}{\llbracket\hspace{.5ex}}
\newcommand{\rsem}{\hspace{.5ex}\rrbracket}
\newcommand{\lsemm}{\lsem}
\newcommand{\rsemm}{\rsem}
\newcommand{\semantic}[1]{\lsem #1 \rsem\xspace}
\newcommand{\ol}[1]{\overline{#1}}
\newcommand{\ul}[1]{\underline{#1}}
\newcommand{\dps}{\displaystyle}
\newcommand{\sema}[3]{{\cal #1}_{#2}\semantic{#3}}
\newcommand{\sem}[2]{\sema{#1}{}{#2}\xspace}
%
% Programming languages
%
\newcommand{\haskell}{\textsf{Haskell}\xspace}
\newcommand{\gofer}{\textsf{Gofer}\xspace}
\newcommand{\objp}{\mbox{\textsf{OBJ--P}}\xspace}
\newcommand{\java}{\mbox{\textsf{G--JAVA}}\xspace}
\newcommand{\oldjava}{\mbox{\textsf{JAVA}}\xspace}
\newcommand{\javafive}{\mbox{\textsf{JAVA 5.0}}\xspace}
\newcommand{\eclipse}{\mbox{\textsf{eclipse}}\xspace}
\newcommand{\pizza}{\mbox{\textsf{PIZZA}}\xspace}
\newcommand{\gj}{\mbox{\textsf{GJ}}\xspace}
\newcommand{\sml}{\mbox{\textsf{SML}}\xspace}
\newcommand{\ocaml}{\textsf{OCAML}}
\newcommand{\obj}{\mbox{\textsf{OBJ--3}}\xspace}
\newcommand{\objtwo}{\mbox{\textsf{OBJ--2}}\xspace}
\def\pot#1{{\cal P}(\, #1 \,)\xspace}
\def\partf{\overset{\text{\tiny part}}{\longrightarrow}\xspace}
%
% Deduktionssystem
%
\newcommand{\byrule}[1]{\raisebox{1.5ex}[0ex][0ex]{{{\rm [{\bf \small #1}]}}}}
\newcommand{\byruleok}[1]{\raisebox{1.5ex}[0ex][0ex]{{{\rm \small #1}}}}
\newcommand{\byrulewb}[1]{\raisebox{2.5ex}[0ex][0ex]{{{\rm [{\bf \small #1}]}}}}
\newcommand{\byruleokwb}[1]{\raisebox{2.5ex}[0ex][0ex]{{{\rm \small #1}}}}
\newcommand{\byrulesli}[1]{\raisebox{3.0ex}[0ex][0ex]{{{\rm [{\bf \small #1}]}}}}
\newcommand{\inter}[1]{\bigwedge \hspace{-.55em} \bigwedge_{#1}}
%
% ARRAY WITH ARGUMENTS
%
\newcommand{\sarray}[2]{\begin{array}[t]{#1} #2 \end{array}}
\newcommand{\sarrayt}[2]{\begin{array}[t]{#1} #2 \end{array}}
\newcommand{\sarrayb}[2]{\begin{array}[b]{#1} #2 \end{array}}
\newcommand{\sarrayo}[2]{\begin{array}{#1} #2 \end{array}}
%
% INFERENCE RULES
%
\newcommand{\byrulenew}[1]{\raisebox{2.1ex}[0ex][0ex]{{{\rm [{\bf \small #1}]}}}}
\newcommand{\postcond}[1]{\raisebox{2.1ex}[0ex][0ex]{#1}}
\newcommand{\lef}[1]{\multicolumn{1}{@{}l}{#1}}
\newcommand{\ri}[1]{\multicolumn{1}{r@{}}{#1}}
\newcommand{\ce}[1]{\multicolumn{1}{@{}c}{#1}}
\newcommand{\axiom}[2]{\textrm{[}\textbf{\small #1}\textrm{]} & \lef{#2}}
\newcommand{\irule}[4]{& \sarray{c}{#2}\vspace{1ex}\\\cline{2-2}
\vspace{-2ex}\\ \byrulenew{#1} & \sarray{c}{#3} & \postcond{$#4$}}
\newcommand{\irulealign}[6]{& \sarray{#2}{#3}\vspace{1ex}\\\cline{2-2}
\vspace{-2ex}\\ \byrulenew{#1} & \sarray{#4}{#5} & \postcond{$#6$}}
\newenvironment{irules}{$\begin{array}{lcl}}{\end{array}$}
%
% Kategorien
%
\newcommand{\funs}[1]{\mbox{$F^S_{ERR}$(\, #1 \,)}\xspace}
\newcommand{\funa}[1]{\mbox{$F^A_{ERR}$(\, #1 \,)}\xspace}
\newcommand{\funh}[1]{\mbox{$F^H_{ERR}(\, #1 \,)$}\xspace}
%
% Typherleitungen
%
%\let\oldrhd=\rhd
%\newcommand{\rder}{\hspace*{0.5ex} \rhd_{\textrm{\tiny $\Sig$}} \hspace{0.5ex}}
\newcommand{\rder}{\hspace*{0.5ex} \rhd \hspace{0.5ex}}
%\newcommand{\lder}{\hspace*{0.5ex} \lhd_{\textrm{\tiny $\Sig$}} \hspace*{0.5ex}}
\newcommand{\lder}{\hspace*{0.5ex} \lhd \hspace*{0.5ex}}
\newcommand{\rderStmt}{\hspace*{0.5ex} \rhd_{Stmt} \hspace*{0.5ex}}
\newcommand{\rderExpr}{\hspace*{0.5ex} \rhd_{Expr} \hspace*{0.5ex}}
\newcommand{\rderIdent}{\hspace*{0.5ex} \rhd_{Id} \hspace*{0.5ex}}
\let\oldblacktriangleright=\blacktriangleright
%\newcommand{\fder}{\hspace*{1ex} \textrm{$\blacktriangleright_{\textsl{\tiny \hspace{-1ex}\Sig}}$}}
\newcommand{\fder}{\hspace*{1ex} \textrm{$\blacktriangleright$}}
\newcommand{\newtheo}[3]{\newtheorem{#1}[defhalbordnung]{#2}
\begin{#1} {\rm #3} \label{#1} \end{#1}}
\newcommand{\der}[2]{\mbox{$#1 \rhd\ #2$}\xspace}
\newcommand{\derl}[2]{#1 \lhd_{\textrm{\tiny $\Sig$}} #2\xspace}
\newcommand{\derr}[2]{#1 \rhd_{\textrm{\tiny \hspace{-1ex}$\Sig$}} #2\xspace}
\newcommand{\derf}[3]{( \, #1, \, #2 \, ) \fder #3\xspace}
\newcommand{\deri}[1]{\der{A}{K}{#1}\xspace}
\newcommand{\derif}[1]{\derf{A}{K}{D}{#1}\xspace}
\newcommand{\arity}[3]{\textrm{$\alpha^{(#1,#2)}_{#3}$}\xspace}
\newcommand{\coarity}[2]{\textrm{$\beta^{(#1,#2)}$}\xspace}
\newcommand{\sodaprg}{\textrm{$(\,\textsl{csig},\ D\,)$\xspace}}
%
% Typen
%
\newcommand{\typ}[3]{\textrm{$ #1 \times \ldots \times #2 \rightarrow #3$}\xspace}
\newcommand{\syn}[1]{{\rm \texttt{\small #1}}}
\newcommand{\sigmatyp}{\typ{\sigma_1}{\sigma_n}{\sigma}\xspace}
\newcommand{\sigmadef}{\mbox{$\sigma_1 \times \ldots \times \sigma_n$}\xspace}
\newcommand{\tautyp}{\typ{\tau_1}{\tau_n}{\tau}\xspace}
\newcommand{\tautypsup}[1]{\typ{\tau^{#1}_1}{\tau^{#1}_n}{\tau^{#1}}\xspace}
\newcommand{\taudef}{\mbox{$\tau_1 \times \ldots \times \tau_n$}\xspace}
\newcommand{\thetatyp}{\typ{\theta_1}{\theta_n}{\theta_0}\xspace}
\newcommand{\type}{\text{$\text{TYPE}(\,S,\ V\,)$}\xspace}
\newcommand{\typea}{\text{$\text{TYPE}_T(\,S,\ V\,)$}\xspace}
\newcommand{\ptype}{{\rm \expsf{Type}{\normalbtermset}}\xspace}
\newcommand{\ptypea}{\text{$\text{TYPE}_T(\,\Theta,\ V\,)$}\xspace}
\newcommand{\types}{\text{$\text{TYPE}_s(\,S,\ \Gamma\,)$}\xspace}
\newcommand{\epsbox}[2]{
%\begin{center}
\setlength{\fboxsep}{4mm}
\fbox{\epsfxsize=#1 \epsfbox{#2}}
%\end{center}
}
\newcommand{\epsxybox}[3]{
\begin{minipage}[t]{#1}
\setlength{\fboxsep}{4mm}
\fbox{\epsfysize=#2 \epsfbox{#3}}
\end{minipage}}
\newenvironment{program}{\begin{alltt}\small}
{\normalsize\end{alltt}\vspace*{-1em}}
\floatstyle{plain}
\newfloat{soda}{htp}{lop}
\floatname{soda}{SODA-Program}
%\sodaprog
% 1. width
% 2. figure
% 3. file
\newcommand{\sodaprog}[3]{
\begin{figure}%[#2]
%\begin{center}
\begin{Sbox}
\begin{minipage}{#1}
\small
\begin{alltt}
\verbatiminput{#3.soda}
\end{alltt}
\normalsize
\end{minipage}
\end{Sbox}
\setlength{\fboxsep}{2mm}
\fbox{\TheSbox}
%\end{center}
\caption{SODA module \texttt{#3}}
\label{fig:#3}
\end{figure}
}
%
% Theorem
%
\newcommand{\QED}{\rule{1.1ex}{1.1ex}}
%\newenvironment{proof}{\par \bigskip \noindent {\bf Proof:}
% }{\mbox{ } \hfill \QED \par \smallskip}
%\newenvironment{remark}{\par \bigskip \noindent {\bf Remark}
% }{\par \smallskip}
%\newtheorem{definition}{Definition}[section]
%\newtheorem{example}[definition]{Example}
%\newtheorem{theorem}[definition]{Theorem}
%\newtheorem{corollary}[definition]{Corollary}
%\newtheorem{lemma}[definition]{Lemma}
%\newtheorem{algorithm}[definition]{Algorithm}
%\newenvironment{abstract}{\small \begin{center} {\bf Abstract}\\[2ex]
%\begin{minipage}{0.85\textwidth}}{\end{minipage} \end{center}}
\newenvironment{Zusammenfassung}{\small \begin{center} {\bf Zusammenfassung}\\[2ex]
\begin{minipage}{0.85\textwidth}}{\end{minipage} \end{center}}
\newlength{\level}
\newlength{\wid}
%\newcommand{\thelb}{
\def\notunlhd{\mathrel{\unlhd\!\!\!\!\!\mid}}
\def\In#1#2{#1 \! \in \! #2}
\def\Leq#1#2#3{#1 \! \leqslant \! #2 \! \leqslant \! #3}
\def\Lequ#1#2#3{#1 \leqslant #2 \leqslant #3}
\newcommand{\ma}[1]{\text{``}#1\text{''}\xspace}
\newcommand{\ttm}[1]{\mbox{\tt #1}\xspace}
\newcommand{\ret}[2]{\ttm{r}^{\ttm{\footnotesize #1}}_{\ttm{\footnotesize #2}}\xspace}
\newcommand{\retm}[2]{\ttm{r}^{#1}_{#2}\xspace}
\newcommand{\re}[2]{\displaystyle r^{#1}_{#2}\xspace}
\newlength{\qwert}
%\newcommand{\htext}[1]{\settowidth{\qwert}{#1} \addtolength{\qwert}{-0.65ex} \hspace*{\qwert}}
\newcommand{\htext}[1]{\settowidth{\qwert}{#1} \hspace*{\qwert}}
\newcommand{\leng}[1]{\settowidth{\qwert}{#1} \qwert}
\newcommand{\ldo}{, \ldots , }
%
% Algorithmus
%
\newcommand{\nll}{\newline\hspace*{\level}}
\newcommand{\nlevel}{\addtolength{\level}{0.4cm}}
\newcommand{\llevel}{\addtolength{\level}{-0.4cm}}
\newcommand{\ifc}[1]{\textbf{if} \nlevel #1 \llevel}
\newcommand{\elsifc}[1]{\textbf{elsif} \nlevel #1 \llevel}
\newcommand{\foreachc}[2]{\textbf{foreach} #1 \nlevel #2 \llevel}
\newcommand{\thenc}[1]{\textbf{then} \nlevel #1 \llevel}
\newcommand{\ifthenc}[2]{\textbf{if} #1 \textbf{then} \nlevel #2 \llevel}
\newcommand{\elsec}[1]{\textbf{else} \nlevel #1 \llevel}
\newcommand{\eifc}{\textbf{endif}\\}
\newcommand{\casec}[2]{\fbox{\textbf{case} #1}\ \nlevel \nlevel #2 \llevel \llevel}
\newcommand{\letc}[2]{\textbf{let} \nlevel \\ #1 = \nlevel #2 \llevel \llevel}
\newcommand{\letbf}[1]{\textbf{let} \nlevel \\ #1 \llevel}
\newcommand{\inc}[1]{\textbf{in} \nlevel #1 \llevel \nopagebreak\\ \textbf{end}}
\newcommand{\lam}[2]{\textbf{fn } #1 \textrm{$\, \Rightarrow \,$} #2}
\newcommand{\inputc}[1]{\nll \textbf{Input:} \nlevel #1 \llevel}
\newcommand{\outputc}[1]{\nll \textbf{Output:} \nlevel #1 \llevel}
%\newcommand{\letforeachc}[3]{\textbf{let-foreach} \nlevel #1:\\ \ul{#2} = \nlevel #3 \llevel \llevel}
\newcommand{\letforeachc}[3]{\textbf{let-foreach} \nlevel #1:\\ #2 = \nlevel #3 \llevel \llevel}
%\newcommand{\letuc}[2]{\textbf{let} \nlevel \\ \ul{#1} = \nlevel #2 \llevel \llevel}
\newcommand{\letuc}[2]{\textbf{let} \nlevel \\ #1 = \nlevel #2 \llevel \llevel}
\newcommand{\letoeq}[3]{\textbf{let} \nlevel \\ #1 #2 \nlevel #3 \llevel \llevel}
\newcommand{\letoeqol}[3]{\nlevel \\ #1 #2 \nlevel #3 \llevel \llevel}
%\newcommand{\letu}[2]{\nlevel\\ \ul{#1} = \nlevel #2 \llevel\llevel}
\newcommand{\letu}[2]{\nlevel\\ #1 = \nlevel #2 \llevel\llevel}
\newcommand{\letnc}[2]{\nlevel\\ #1 = \nlevel #2 \llevel\llevel}
\newcommand{\misc}[1]{\nlevel\\ #1 \llevel}
\newcommand{\least}{\textrm{$\top$}\xspace}
\newenvironment{algocommands}{
\setlength{\level}{2mm}
\renewcommand{\\}{\nll}
\noindent
}{\renewcommand{\\}{\newline}
\vspace{1ex}
}
\newenvironment{algo}{\begin{algorithm} \rm %\mbox{}\\
\begin{algocommands}
}{\end{algocommands}
\end{algorithm}
}
\newenvironment{boxedalgo}{
\begin{Sbox}
\begin{minipage}{\textwid}
\begin{algo}
}{\end{algo}
\end{minipage}
\end{Sbox}
\fbox{\TheSbox}
}
\newenvironment{Liste}{\begin{list}{\textbf{--}}{
\setlength{\parsep}{0pt plus0.0ex}
\setlength{\labelwidth}{2ex}
\setlength{\itemsep}{0pt}
\setlength{\leftmargin}{\labelsep +\labelwidth}
}}{\normalsize \end{list}}
\newcounter{ficall}
\setcounter{ficall}{0}
\newcommand{\ficall}[1]{\addtocounter{ficall}{1}\subsubsection*{(\theficall) \
#1}
\setcounter{secall}{0}
\setcounter{thicall}{0}
\setcounter{focall}{0}
\setcounter{fifcall}{0}
\setcounter{sixcall}{0}
\setcounter{sevcall}{0}
\setcounter{eigcall}{0}
\setcounter{nicall}{0}
\setcounter{tencall}{0}
\setcounter{elecall}{0}
}
\newcommand{\reficall}[1]{\subsubsection*{(\theficall) \
#1}}
\newcounter{fifinum}
\newcommand{\finumset}{\setcounter{fifinum}{\value{ficall}}}
\newcommand{\finum}{\thefifinum}
\newcounter{fifinumold}
\newcommand{\finumoldset}{
\setcounter{fifinumold}{\value{fifinum}}
}
\newcommand{\finumold}{\thesefinumold}
\newcounter{secall}
\setcounter{secall}{0}
\newcounter{sefinum}\newcounter{sesenum}
\newcommand{\senumset}{\setcounter{sefinum}{\value{ficall}}\setcounter{sesenum}{\value{secall}}}
\newcommand{\secall}[1]{\addtocounter{secall}{1}\subsubsection*{(\theficall.\thesecall) \ #1}
\setcounter{thicall}{0}
\setcounter{focall}{0}
\setcounter{fifcall}{0}
\setcounter{sixcall}{0}
\setcounter{sevcall}{0}
\setcounter{eigcall}{0}
\setcounter{nicall}{0}
\setcounter{tencall}{0}
\setcounter{elecall}{0}
}
\newcommand{\resecall}[1]{\subsubsection*{(\theficall.\thesecall) \ #1}}
\newcommand{\senum}{\thesefinum.\thesesenum}
\newcounter{sefinumold}
\newcounter{sesenumold}
\newcommand{\senumoldset}{
\setcounter{sefinumold}{\value{sefinum}}
\setcounter{sesenumold}{\value{sesenum}}
}
\newcommand{\senumold}{\thesefinumold.\thesesenumold}
\newcounter{thicall}
\setcounter{thicall}{0}
\newcounter{thifinum}\newcounter{thisenum}\newcounter{thithinum}
\newcommand{\thinumset}{\setcounter{thifinum}{\value{ficall}}\setcounter{thisenum}{\value{secall}}\setcounter{thithinum}{\value{thicall}}}
\newcommand{\thicall}[1]{\addtocounter{thicall}{1}\subsubsection*{(\theficall.\thesecall.\thethicall) \ #1}
\setcounter{focall}{0}
\setcounter{fifcall}{0}
\setcounter{sixcall}{0}
\setcounter{sevcall}{0}
\setcounter{eigcall}{0}
\setcounter{nicall}{0}
\setcounter{tencall}{0}
\setcounter{elecall}{0}
}
\newcommand{\rethicall}[1]{\subsubsection*{(\theficall.\thesecall.\thethicall) \ #1}}
\newcommand{\thinum}{\thethifinum.\thethisenum.\thethithinum}
\newcounter{focall}
\setcounter{focall}{0}
\newcounter{fofinum}\newcounter{fosenum}\newcounter{fothinum}\newcounter{fofonum}
\newcommand{\focall}[1]{\addtocounter{focall}{1}\subsubsection*{(\theficall.\thesecall.\thethicall.\thefocall) \ #1}
\setcounter{fifcall}{0}
\setcounter{sixcall}{0}
\setcounter{sevcall}{0}
\setcounter{eigcall}{0}
\setcounter{nicall}{0}
\setcounter{tencall}{0}
\setcounter{elecall}{0}
}
\newcommand{\fonumset}{\setcounter{fofinum}{\value{ficall}}\setcounter{fosenum}{\value{secall}}\setcounter{fothinum}{\value{thicall}}\setcounter{fofonum}{\value{focall}}}
\newcommand{\fonum}{\thefofinum.\thefosenum.\thefothinum.\thefofonum}
\newcommand{\refocall}[1]{\subsubsection*{(\theficall.\thesecall.\thethicall.\thefocall) \ #1}}
\newcounter{fifcall}
\setcounter{fifcall}{0}
\newcommand{\fifcall}[1]{\addtocounter{fifcall}{1}\subsubsection*{(\theficall.\thesecall.\thethicall.\thefocall.\thefifcall) \ #1}
\setcounter{sixcall}{0}
\setcounter{sevcall}{0}
\setcounter{eigcall}{0}
\setcounter{nicall}{0}
\setcounter{tencall}{0}
\setcounter{elecall}{0}
}
\newcounter{fiffinum}\newcounter{fifsenum}\newcounter{fifthinum}\newcounter{fiffonum}\newcounter{fiffifnum}
\newcommand{\fifnumset}{\setcounter{fiffinum}{\value{ficall}}\setcounter{fifsenum}{\value{secall}}\setcounter{fifthinum}{\value{thicall}}\setcounter{fiffonum}{\value{focall}}\setcounter{fiffifnum}{\value{fifcall}}}
\newcommand{\fifnum}{\thefiffinum.\thefifsenum.\thefifthinum.\thefiffonum.\thefiffifnum}
\newcommand{\refifcall}[1]{\subsubsection*{(\theficall.\thesecall.\thethicall.\thefocall.\thefifcall) \ #1}}
\newcounter{fiffinumold}
\newcounter{fifsenumold}
\newcounter{fifthinumold}
\newcounter{fiffonumold}
\newcounter{fiffifnumold}
\newcommand{\fifnumoldset}{
\setcounter{fiffinumold}{\value{fiffinum}}
\setcounter{fifsenumold}{\value{fifsenum}}
\setcounter{fifthinumold}{\value{fifthinum}}
\setcounter{fiffonumold}{\value{fiffonum}}
\setcounter{fiffifnumold}{\value{fiffifnum}}
}
\newcommand{\fifnumold}{\thefiffinumold.\thefifsenumold.\thefifthinumold.\thefiffonumold.\thefiffifnumold}
\newcounter{fiffinumoldold}
\newcounter{fifsenumoldold}
\newcounter{fifthinumoldold}
\newcounter{fiffonumoldold}
\newcounter{fiffifnumoldold}
\newcommand{\fifnumoldoldset}{
\setcounter{fiffinumoldold}{\value{fiffinum}}
\setcounter{fifsenumoldold}{\value{fifsenum}}
\setcounter{fifthinumoldold}{\value{fifthinum}}
\setcounter{fiffonumoldold}{\value{fiffonum}}
\setcounter{fiffifnumoldold}{\value{fiffifnum}}
}
\newcommand{\fifnumoldold}{\thefiffinumoldold.\thefifsenumoldold.\thefifthinumoldold.\thefiffonumoldold.\thefiffifnumoldold}
\newcounter{sixcall}
\setcounter{sixcall}{0}
\newcommand{\sixcall}[1]{\addtocounter{sixcall}{1}\subsubsection*{(\theficall.\thesecall.\thethicall.\thefocall.\thefifcall.\thesixcall) \ #1}
\setcounter{sevcall}{0}
\setcounter{eigcall}{0}
\setcounter{nicall}{0}
\setcounter{tencall}{0}
\setcounter{elecall}{0}
}
\newcounter{sixfinum}
\newcounter{sixsenum}
\newcounter{sixthinum}
\newcounter{sixfonum}
\newcounter{sixfifnum}
\newcounter{sixsixnum}
\newcommand{\sixnumset}{
\setcounter{sixfinum}{\value{ficall}}
\setcounter{sixsenum}{\value{secall}}
\setcounter{sixthinum}{\value{thicall}}
\setcounter{sixfonum}{\value{focall}}
\setcounter{sixfifnum}{\value{fifcall}}
\setcounter{sixsixnum}{\value{sixcall}}
}
\newcommand{\sixnum}{\thesixfinum.\thesixsenum.\thesixthinum.\thesixfonum.\thesixfifnum.\thesixsixnum}
\newcommand{\resixcall}[1]{\subsubsection*{(\theficall.\thesecall.\thethicall.\thefocall.\thefifcall.\thesixcall) \ #1}}
\newcounter{sevcall}
\setcounter{sevcall}{0}
\newcommand{\sevcall}[1]{\addtocounter{sevcall}{1}\subsubsection*{(\theficall.\thesecall.\thethicall.\thefocall.\thefifcall.\thesixcall.\thesevcall) \ #1}
\setcounter{eigcall}{0}
\setcounter{nicall}{0}
\setcounter{tencall}{0}
\setcounter{elecall}{0}
}
\newcounter{sevfinum}
\newcounter{sevsenum}
\newcounter{sevthinum}
\newcounter{sevfonum}
\newcounter{sevfifnum}
\newcounter{sevsixnum}
\newcounter{sevsevnum}
\newcommand{\sevnumset}{
\setcounter{sevfinum}{\value{ficall}}
\setcounter{sevsenum}{\value{secall}}
\setcounter{sevthinum}{\value{thicall}}
\setcounter{sevfonum}{\value{focall}}
\setcounter{sevfifnum}{\value{fifcall}}
\setcounter{sevsixnum}{\value{sixcall}}
\setcounter{sevsevnum}{\value{sevcall}}
}
\newcommand{\sevnum}{\thesevfinum.\thesevsenum.\thesevthinum.\thesevfonum.\thesevfifnum.\thesevsixnum.\thesevsevnum}
\newcommand{\resevcall}[1]{\subsubsection*{(\theficall.\thesecall.\thethicall.\thefocall.\thefifcall.\thesixcall.\thesevcall) \ #1}}
\newcounter{eigcall}
\newcounter{eigfinum}\newcounter{eigsenum}\newcounter{eigthinum}\newcounter{eigfonum}\newcounter{eigfifnum}\newcounter{eigsixnum}\newcounter{eigsevnum}\newcounter{eigeignum}
\setcounter{eigcall}{0}
\newcommand{\eignumset}{\setcounter{eigfinum}{\value{ficall}}\setcounter{eigsenum}{\value{secall}}\setcounter{eigthinum}{\value{thicall}}\setcounter{eigfonum}{\value{focall}}\setcounter{eigfifnum}{\value{fifcall}}\setcounter{eigsixnum}{\value{sixcall}}\setcounter{eigsevnum}{\value{sevcall}}\setcounter{eigeignum}{\value{eigcall}}}
\newcommand{\eignum}{\theeigfinum.\theeigsenum.\theeigthinum.\theeigfonum.\theeigfifnum.\theeigsixnum.\theeigsevnum.\theeigeignum}
\newcommand{\eigcall}[1]{\addtocounter{eigcall}{1}\subsubsection*{(\theficall.\thesecall.\thethicall.\thefocall.\thefifcall.\thesixcall.\thesevcall.\theeigcall) \ #1}
\setcounter{nicall}{0}
\setcounter{tencall}{0}
\setcounter{elecall}{0}
}
\newcommand{\reeigcall}[1]{\subsubsection*{(\theficall.\thesecall.\thethicall.\thefocall.\thefifcall.\thesixcall.\thesevcall.\theeigcall) \ #1}}
\newcounter{nicall}
\newcounter{nifinum}\newcounter{nisenum}\newcounter{nithinum}\newcounter{nifonum}\newcounter{nififnum}\newcounter{nisixnum}\newcounter{nisevnum}\newcounter{nieignum}\newcounter{nininum}
\setcounter{nicall}{0}
\newcommand{\ninumset}{\setcounter{nifinum}{\value{ficall}}\setcounter{nisenum}{\value{secall}}\setcounter{nithinum}{\value{thicall}}\setcounter{nifonum}{\value{focall}}\setcounter{nififnum}{\value{fifcall}}\setcounter{nisixnum}{\value{sixcall}}\setcounter{nisevnum}{\value{sevcall}}\setcounter{nieignum}{\value{eigcall}}\setcounter{nininum}{\value{nicall}}}
\newcommand{\ninum}{\thenifinum.\thenisenum.\thenithinum.\thenifonum.\thenififnum.\thenisixnum.\thenisevnum.\thenieignum.\thenininum}
\newcommand{\nicall}[1]{\addtocounter{nicall}{1}\subsubsection*{(\theficall.\thesecall.\thethicall.\thefocall.\thefifcall.\thesixcall.\thesevcall.\theeigcall.\thenicall)
\ #1}
\setcounter{tencall}{0}
\setcounter{elecall}{0}
}
\newcommand{\renicall}[1]{\subsubsection*{(\theficall.\thesecall.\thethicall.\thefocall.\thefifcall.\thesixcall.\thesevcall.\theeigcall.\thenicall)
\ #1}}
\newcounter{nifinumold}
\newcounter{nisenumold}
\newcounter{nithinumold}
\newcounter{nifonumold}
\newcounter{nififnumold}
\newcounter{nisixnumold}
\newcounter{nisevnumold}
\newcounter{nieignumold}
\newcounter{nininumold}
\newcommand{\ninumoldset}{
\setcounter{nifinumold}{\value{nifinum}}
\setcounter{nisenumold}{\value{nisenum}}
\setcounter{nithinumold}{\value{nithinum}}
\setcounter{nifonumold}{\value{nifonum}}
\setcounter{nififnumold}{\value{nififnum}}
\setcounter{nisixnumold}{\value{nisixnum}}
\setcounter{nisevnumold}{\value{nisevnum}}
\setcounter{nieignumold}{\value{nieignum}}
\setcounter{nininumold}{\value{nininum}}
}
\newcommand{\ninumold}{\thenifinumold.\thenisenumold.\thenithinumold.\thenifonumold.\thenififnumold.\thenisixnumold.\thenisevnumold.\thenieignumold.\thenininumold}
\newcounter{tencall}
\setcounter{tencall}{0}
\newcommand{\tencall}[1]{\addtocounter{tencall}{1}\subsubsection*{(\theficall.\thesecall.\thethicall.\thefocall.\thefifcall.\thesixcall.\thesevcall.\theeigcall.\thenicall.\thetencall)
\ #1}
\setcounter{elecall}{0}
}
\newcommand{\retencall}[1]{\subsubsection*{(\theficall.\thesecall.\thethicall.\thefocall.\thefifcall.\thesixcall.\thesevcall.\theeigcall.\thenicall.\thetencall)
\ #1}}
\newcounter{tenfinum}
\newcounter{tensenum}
\newcounter{tenthinum}
\newcounter{tenfonum}
\newcounter{tenfifnum}
\newcounter{tensixnum}
\newcounter{tensevnum}
\newcounter{teneignum}
\newcounter{tenninum}
\newcounter{tentennum}
\newcommand{\tennumset}{
\setcounter{tenfinum}{\value{ficall}}
\setcounter{tensenum}{\value{secall}}
\setcounter{tenthinum}{\value{thicall}}
\setcounter{tenfonum}{\value{focall}}
\setcounter{tenfifnum}{\value{fifcall}}
\setcounter{tensixnum}{\value{sixcall}}
\setcounter{tensevnum}{\value{sevcall}}
\setcounter{teneignum}{\value{eigcall}}
\setcounter{tenninum}{\value{nicall}}
\setcounter{tentennum}{\value{tencall}}}
\newcommand{\tennum}{\thetenfinum.\thetensenum.\thetenthinum.\thetenfonum.\thetenfifnum.\thetensixnum.\thetensevnum.\theteneignum.\thetenninum.\thetentennum}
\newcounter{elecall}
\setcounter{elecall}{0}
\newcommand{\elecall}[1]{\addtocounter{elecall}{1}\subsubsection*{(\theficall.\thesecall.\thethicall.\thefocall.\thefifcall.\thesixcall.\thesevcall.\theeigcall.\thenicall.\thetencall.\theelecall) \ #1}}
\newcounter{elefinum}
\newcounter{elesenum}
\newcounter{elethinum}
\newcounter{elefonum}
\newcounter{elefifnum}
\newcounter{elesixnum}
\newcounter{elesevnum}
\newcounter{eleeignum}
\newcounter{eleninum}
\newcounter{eletennum}
\newcounter{eleelenum}
\newcommand{\elenumset}{
\setcounter{elefinum}{\value{ficall}}
\setcounter{elesenum}{\value{secall}}
\setcounter{elethinum}{\value{thicall}}
\setcounter{elefonum}{\value{focall}}
\setcounter{elefifnum}{\value{fifcall}}
\setcounter{elesixnum}{\value{sixcall}}
\setcounter{elesevnum}{\value{sevcall}}
\setcounter{eleeignum}{\value{eigcall}}
\setcounter{eleninum}{\value{nicall}}
\setcounter{eletennum}{\value{tencall}}
\setcounter{eleelenum}{\value{elecall}}
}
\newcommand{\elenum}{\theelefinum.\theelesenum.\theelethinum.\theelefonum.\theelefifnum.\theelesixnum.\theelesevnum.\theeleeignum.\theeleninum.\theeletennum.\theeleelenum}
-15
View File
@@ -1,15 +0,0 @@
# Typinferenz für Java 8
## Programmablauf
1. SourceFile parst die Java-Dateien
2. SourceFile erstellt die Basic/Global Assumptions
3. Das Globale AssumptionSet wird anschließend jeder Klasse im Syntaxbaum mit dem TRProg aufruf übergeben
4. Jede Klasse verwaltet lokale Variablen in ihrem eigenen AssumptionSet. Das Globale ist Klassenübergreifend und jede AssumptionType darf darin nur einmalig gesetzt werden.
5. Haben alle Klassen ihrer Constraints erstellt können diese Unifiziert werden.
## Overloading
* Die Overloading Klasse generiert Constraints aus einem Methodenaufruf.
Binary file not shown.
+53
View File
@@ -0,0 +1,53 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java application project to get you started.
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
* User Manual available at https://docs.gradle.org/7.6/userguide/building_java_projects.html
*/
plugins {
// Apply the application plugin to add support for building a CLI application in Java.
antlr
application
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(19))
}
}
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
dependencies {
// Use JUnit test framework.
testImplementation("junit:junit:4.13.2")
// This dependency is used by the application.
implementation("com.google.guava:guava:31.1-jre")
implementation("commons-io:commons-io:2.6")
implementation("org.reflections:reflections:0.9.11")
implementation("org.ow2.asm:asm:7.0")
//implementation("org.antlr:antlr4:4.11.1")
antlr("org.antlr:antlr4:4.8-1")
}
tasks.withType<JavaCompile> {
options.compilerArgs.add("--enable-preview")
}
tasks.withType<Test> {
jvmArgs("--enable-preview")
}
tasks.withType<JavaExec> {
jvmArgs("--enable-preview")
}
application {
// Define the main class for the application.
mainClass.set("de.dhbwstuttgart.App")
}
+13
View File
@@ -0,0 +1,13 @@
class Box<A>{
void m(A a){}
}
class B { }
class Box_Main extends B {
m(b) {
b.m(new Box_Main());
b.m(new B());
}
}
+13
View File
@@ -0,0 +1,13 @@
class Box<A>{
A f;
}
class B { }
class Box_Main extends B {//Fehler Bugzilla Bug 230
m(b) {
b.f = new Box_Main();
b.f = new B();
}
}
+12
View File
@@ -0,0 +1,12 @@
import java.util.Vector;
import java.util.List;
import java.lang.Integer;
class FCTest1 extends Vector<Vector<Integer>> {
fc1() {
var y;
var z;
y.add(z);
return y;
}
}
+11
View File
@@ -0,0 +1,11 @@
import java.util.Vector;
import java.util.List;
import java.lang.Integer;
class FCTest2 extends Vector<Vector<Integer>> {
fc2(y) {
var z;
y.add(z);
return y;
}
}
+19
View File
@@ -0,0 +1,19 @@
import java.util.Vector;
import java.lang.Integer;
class FCTest3 extends Pair<Vector<Integer>, Vector<Integer>> {
fc2(x) {
x.snd().addElement(2);
}
fc2a() {
var y;
y.snd().addElement(2);
return y;
}
}
+10
View File
@@ -0,0 +1,10 @@
import java.lang.Integer;
import java.util.Vector;
public class GenTest {
main(x) {
var v = new Vector();
return 1 + v.elementAt(0);
}
}
+9
View File
@@ -0,0 +1,9 @@
class Generics {
a;
id(b) { return b; }
setA(x) {
a = x;
return a;
}
m(x,y) { x = id(y); }
}
+7
View File
@@ -0,0 +1,7 @@
import java.util.List;
class M {
void m(p, p2){
new addList().addLists(p, p2);
}
}
@@ -0,0 +1,9 @@
import java.util.Stack;
import java.util.Vector;
class OverloadingMain {
mmMain(x) { var y; return new O1().mm(y); }
}
@@ -0,0 +1,20 @@
import java.lang.Integer;
public class Overloading_Generics {
id1 (x) { return x; }
//Integer id (Integer x) { return x; }
}
class Overloading_Generics1 {
main(x) {
var olg = new Overloading_Generics();
return olg.id1(1);
}
}
@@ -0,0 +1,25 @@
import java.util.Vector;
import java.util.Stack;
class OverrideMain {
ovrMain(x) {
var overide;
overide.ovr(x);
}
}
/*
[
[(TPH L = java.util.Stack<TPH FTM>), (TPH N = java.lang.String), (TPH M = ? extends Override2), (TPH FTN, TPH FTM), (TPH K = void)],
[(TPH FTO, TPH FTP), (TPH M = ? extends Override2), (TPH N = java.lang.String), (TPH L = java.util.Stack<TPH FTP>), (TPH K = void)],
[(TPH M = ? extends Override2), (TPH N = java.lang.String), (TPH K = void), (TPH FTR, TPH FTQ), (TPH L = java.util.Vector<TPH FTQ>)],
[(TPH FTT, TPH FTS), (TPH M = ? extends Override2), (TPH L = java.util.Vector<TPH FTS>), (TPH K = void), (TPH N = java.lang.String)],
[(TPH L = java.util.Vector<TPH FTV>), (TPH M = ? extends Override2), (TPH N = java.lang.String), (TPH FTU, TPH FTV), (TPH K = void)],
[(TPH FTX, TPH FTW), (TPH M = ? extends Override2), (TPH L = java.util.Vector<TPH FTW>), (TPH K = void), (TPH N = java.lang.String)],
[(TPH M = ? extends Override2), (TPH L = java.util.Stack<TPH FTZ>), (TPH K = void), (TPH FTY, TPH FTZ), (TPH N = java.lang.String)],
[(TPH FUB, TPH FUA), (TPH K = void), (TPH M = ? extends Override2), (TPH N = java.lang.String), (TPH L = java.util.Vector<TPH FUA>)],
[(TPH N = java.lang.String), (TPH L = java.util.Vector<TPH FUC>), (TPH FUD, TPH FUC), (TPH M = ? extends Override2), (TPH K = void)],
[(TPH N = java.lang.String), (TPH FUF, TPH FUE), (TPH M = ? extends Override2), (TPH K = void), (TPH L = java.util.Vector<TPH FUE>)]]
[[(TPH M = ? extends Override2), (TPH MNX, TPH MNY), (TPH N = java.lang.String), (TPH K = void), (TPH L = java.util.Stack<TPH MNY>)], [(TPH L = java.util.Stack<TPH MOC>), (TPH N = java.lang.String), (TPH M = ? extends Override2), (TPH K = void), (TPH MOB, TPH MOC)], [(TPH M = ? extends Override2), (TPH N = java.lang.String), (TPH MNZ, TPH MOA), (TPH L = java.util.Vector<TPH MOA>), (TPH K = void)], [(TPH L = java.util.Vector<TPH MOE>), (TPH K = void), (TPH M = ? extends Override2), (TPH MOD, TPH MOE), (TPH N = java.lang.String)], [(TPH M = ? extends Override2), (TPH K = void), (TPH N = java.lang.String), (TPH MOF, TPH MOG), (TPH L = java.util.Stack<TPH MOG>)], [(TPH L = java.util.Vector<TPH MOI>), (TPH K = void), (TPH MOH, TPH MOI), (TPH M = ? extends Override2), (TPH N = java.lang.String)], [(TPH L = java.util.Vector<TPH MOK>), (TPH MOJ, TPH MOK), (TPH K = void), (TPH M = ? extends Override2), (TPH N = java.lang.String)], [(TPH MOL, TPH MOM), (TPH L = java.util.Stack<TPH MOM>), (TPH M = ? extends Override2), (TPH K = void), (TPH N = java.lang.String)], [(TPH L = java.util.Vector<TPH MOO>), (TPH MON, TPH MOO), (TPH N = java.lang.String), (TPH K = void), (TPH M = ? extends Override2)], [(TPH L = java.util.Stack<TPH MOP>), (TPH N = java.lang.String), (TPH M = ? extends Override2), (TPH MOQ, TPH MOP), (TPH K = void)]]
*/
@@ -0,0 +1,11 @@
import java.util.Vector;
import java.util.Stack;
class OverrideMainRet {
ovrMain() {
var overide;
var x;
overide.ovr(x);
return x;
}
}
+18
View File
@@ -0,0 +1,18 @@
class Pair<T, U> {
T x;
U y;
public Pair() { }
public Pair(T x, U y) {
this.x = x;
this.y = y;
}
public T fst () {
return x;
}
public U snd () {
return y;
}
}
+19
View File
@@ -0,0 +1,19 @@
import java.util.Vector;
import java.util.Stack;
class Put {
putElement(ele, v) {
v.addElement(ele);
}
putElement(ele, s) {
s.push(ele);
}
main(ele, x) {
putElement(ele, x);
}
}
+4
View File
@@ -0,0 +1,4 @@
class Test {
a;
Test b;
}
@@ -0,0 +1,12 @@
import java.util.ArrayList;
class TestSubTypless {
m(a){
var l = new ArrayList<>();
l.add(a);
return m2(l).get(0);
}
m2(a){
return m(a);
}
}
+3
View File
@@ -0,0 +1,3 @@
class Twice {
twice = f -> x -> f.apply(f.apply(x));
}
+5
View File
@@ -0,0 +1,5 @@
class Var {
var(x) { var y; }
}
@@ -0,0 +1,15 @@
import java.util.Vector;
import java.lang.Integer;
public class VectorConstAdd {
vectorAdd(v1) {
var i = 0;
var erg = new Vector<>();
while (i < v1.size()) {
erg.addElement(v1.elementAt(i) + 1);
i++;
}
return erg;
}
}
@@ -0,0 +1,8 @@
class Wildcard_Andi {
Test<? extends A> ex = new Test<>();
Test<? super A> sup = new Test<>();
}
+8
View File
@@ -0,0 +1,8 @@
import java.util.List;
class addList {
addLists(a, b){
a.add(b.get(0));
b.add(a.get(0));
}
}
@@ -0,0 +1,22 @@
import java.util.List;
import java.lang.Integer;
import java.lang.Object;
import java.lang.Boolean;
class wildcardPair {
make(l) {
var p = new Pair(l.get(0), l.get(1));
return p;
}
//<X>Boolean compare(Pair<X, X> x) { return true; }
void m(l) {
Object o = l.get(0);
//Pair<? extends Object, ? extends Object> p;
//List<?> b;
//this.compare(p); //1, type incorrect
make(l);
//this.compare(this.make(b)); //2, OK
}
}
+8
View File
@@ -0,0 +1,8 @@
import java.lang.Integer;
import java.lang.String;
public class AA {
m(Integer i) { return "AA"; }
m2(AA x) { return "AA"; }
}
@@ -0,0 +1,30 @@
import java.lang.Integer;
import java.lang.Boolean;
import java.lang.String;
import java.lang.Byte;
import java.lang.Short;
import java.lang.Long;
import java.lang.Float;
import java.lang.Double;
import java.lang.Character;
class AssignToLit {
void m(){
// String s = "Test";
// Boolean b = false;
// Byte byte1 = 5;
// Byte byte2 = 55;
// Short short1 = 5;
// Short short2 = 55;
// Integer int1 = 5;
// Integer int2 = 8888888;
// Long long1 = 1;
// Long long2 = 5;
// Long long3 = 89989898;
// Float float1 = 1;
// Float float2 = 55;
// Double d1 = 1;
// Double d2 = 55;
Character c = 'A';
}
}
+3
View File
@@ -0,0 +1,3 @@
import java.lang.Integer;
public class BB extends AA { }
@@ -0,0 +1,17 @@
import java.lang.Integer;
import java.lang.Double;
public class BinaryInMeth {
m(a){
return ++a;
}
m2(a,b){
return m(a+b);
}
m3(a) {
return m(++a);
}
}
+11
View File
@@ -0,0 +1,11 @@
import java.lang.Integer;
import java.lang.String;
public class CC extends BB {
m(Integer i) {
return "CC";
}
m2(CC x) { return "CC"; }
}
@@ -0,0 +1,8 @@
import java.lang.Integer;
public class ClassGenLam {
lam = x-> x;
// public ClassGenLam() {
// lam = x->x;
// }
}
@@ -0,0 +1,6 @@
class Cycle {
m(x, y) {
y = x;
x = y;
}
}
+4
View File
@@ -0,0 +1,4 @@
import java.lang.Integer;
public class DD extends CC { }
@@ -0,0 +1,11 @@
public class DuMethod{
method(a){
return a+a;
}
method(a){
return a;
}
}
@@ -0,0 +1,8 @@
public class EmptyMethod{
public void m1(){
System.out.println("test");
}
public void m2(){}
}
@@ -0,0 +1,9 @@
import java.lang.String;
public class Example {
public m() {
String x = "X";
return x;
}
}
@@ -0,0 +1,3 @@
public class Exceptions {
// m(Integer i) throws
}
+15
View File
@@ -0,0 +1,15 @@
import java.lang.Integer;
//import java.lang.Double;
public class Fac {
getFac(n){
var res = 1;
var i = 1;
while(i<=n) {
res = res * i;
i++;
}
return res;
}
}
@@ -0,0 +1,52 @@
import java.lang.Integer;
//import java.lang.Long;
//import java.lang.Short;
public class Faculty {
public fact;
Faculty() {
fact = (x) -> {
if (x == 1) {
return 1;
}
else {
return x * (fact.apply(x-1));
}
};
}
public getFact(x) {
return fact.apply(x);
}
}
// m (x) {
//
//// var fact = (x) -> {
//// if (x == 1) {
//// return x;
//// }
//// else {
//// return x * (fact.apply(x-1));
//// }
//// };
//// return fact;
//// var x = 13;
//// if(x>22) {
//// return 0;
//// }else if(x <1){
//// return x;
//// }else {
//// return 1;
//// }
//
// if (x < 0) {
// return 0;
// }else if(x<2) {
// return x;
// } else {
// return x * m(x-1);
// }
// }
//}
@@ -0,0 +1,10 @@
class Faculty2 {
m () {
var fact = (Integer x) -> {
return x;
};
return fact;
}
}
@@ -0,0 +1,9 @@
import java.lang.Integer;
public class Field {
public x = 5;
m(){
return x;
}
}
@@ -0,0 +1,4 @@
public class FieldTph {
a;
}
@@ -0,0 +1,12 @@
public class FieldTph2 {
a;
m(b){
b = a;
return b;
}
m2(c){
a = c;
}
}
@@ -0,0 +1,26 @@
public class FieldTphConsMeth {
a;
public FieldTphConsMeth(c) {
a = id(c);
}
id(b) {
return b;
}
setA(x) {
a = x;
return a;
}
m(x,y) {
x = id(y);
}
/*m2(x,y) {
x = setA(y);
return x;
}*/
}
@@ -0,0 +1,27 @@
import java.lang.Boolean;
public class FieldTphMMeth {
a;
public FieldTphMMeth(c,d,e) {
a = m(c,d,e);
}
m(b,d,e) {
if(e) {
return m3(b);
} else{
return m3(d);
}
}
m2(b) {
a = m3(b);
}
m3(b){
return b;
}
}
+30
View File
@@ -0,0 +1,30 @@
import java.lang.Integer;
import java.lang.Boolean;
class For{
Integer m(Integer x){
var c = x + 2;
// Boolean b = true;
// c = 5;
// c++;
// ++c;
// c--;
// --c;
// while(x<2){
// x = x +1;
// b = false;
// }
return c;
// for(int i = 0;i<10;i++) {
// x = x + 5;
// }
}
// m2(Integer x){
// if(x<2) {
// return 1;
// }else {
// return 2;
// }
// }
}
+12
View File
@@ -0,0 +1,12 @@
import java.util.Vector;
import java.lang.Integer;
import java.lang.String;
//import java.lang.Byte;
//import java.lang.Boolean;
public class FunOL {
add(f, y) {
return f.apply() + y;
}
}
+8
View File
@@ -0,0 +1,8 @@
import java.lang.Integer;
import java.util.Vector;
public class Gen{
Vector<Integer> m(Vector<Integer> v){
return v;
}
}
@@ -0,0 +1,17 @@
class Generics<B> {
Generics(B b){
}
B mt1(B b){
return mt1(b);
}
}
/*
Problem:
auto test = new List<String>();
auto test2 = new List<Integer>();
... //code, welcher möglicherweise test und test2 vertauscht
test.add("hallo");
*/
@@ -0,0 +1,6 @@
class Generics2<B extends String>{
<B extends Integer> B m1(B b){
return b;
}
}
@@ -0,0 +1,57 @@
import java.lang.Integer;
import java.lang.Long;
import java.lang.Float;
import java.lang.Double;
public class GreaterEqual {
gE(Integer a, Integer b){
var c = a>=b;
return c;
}
gE(Long a, Long b){
var c = a>=b;
return c;
}
gE(Float a, Float b){
var c = a>=b;
return c;
}
gE(Double a, Double b){
var c = a>=b;
return c;
}
gE(Long a, Integer b){
var c = a>=b;
return c;
}
gE(Float a, Integer b){
var c = a>=b;
return c;
}
gE(Double a, Integer b){
var c = a>=b;
return c;
}
gE(Float a, Long b){
var c = a>=b;
return c;
}
gE(Double a, Long b){
var c = a>=b;
return c;
}
gE(Double a, Float b){
var c = a>=b;
return c;
}
}
@@ -0,0 +1,56 @@
import java.lang.Integer;
import java.lang.Long;
import java.lang.Float;
import java.lang.Double;
public class GreaterThan {
gT(Integer a, Integer b){
var c = a>b;
return c;
}
gT(Long a, Long b){
var c = a>b;
return c;
}
gT(Float a, Float b){
var c = a>b;
return c;
}
gT(Double a, Double b){
var c = a>b;
return c;
}
gT(Long a, Integer b){
var c = a>b;
return c;
}
gT(Float a, Integer b){
var c = a>b;
return c;
}
gT(Double a, Integer b){
var c = a>b;
return c;
}
gT(Float a, Long b){
var c = a>b;
return c;
}
gT(Double a, Long b){
var c = a>b;
return c;
}
gT(Double a, Float b){
var c = a>b;
return c;
}
}
+20
View File
@@ -0,0 +1,20 @@
public class Id {
// a;
// id(b){
// return b;
// }
id2 = x -> x;
// id2 = () -> {
// var x = m(a);
// var y = x;
// var z = y;
// };
//
// m(a){
// return a;
// }
id3 (x) {
return id2.apply(x);
}
}
@@ -0,0 +1,15 @@
import java.lang.Integer;
import java.lang.Boolean;
import java.lang.String;
public class IfTest{
Integer m1(Boolean b) {
Integer i;
String b;
if(b) {
return i;
}else{
return b;
}
}
}
@@ -0,0 +1,8 @@
import java.util.Vector;
class Import {
void methode(){
Vector v = new Vector<>();
v.add("X");
}
}
+55
View File
@@ -0,0 +1,55 @@
public class Inf {
m(x,y,a){
var z;
var v;
var w;
var b;
y=x;
z=x;
v=y;
w=y;
y=a;
b=a;
}
}
/*
TPH M m(TPH N x, TPH O y, TPH P a)({
TPH Q z;
TPH R v;
TPH S w;
TPH T b;
(y)::TPH O = (x)::TPH N;
(z)::TPH Q = (x)::TPH N;
(v)::TPH R = (y)::TPH O;
(w)::TPH S = (y)::TPH O;
(y)::TPH O = (a)::TPH P;
(b)::TPH T = (a)::TPH P;
return;
})::TPH U
Inf()({
super(());
})::TPH X
}
// v::R w::S
// \ /
// z::Q y::O b::T
// \ / \ /
// x::N a::P
RESULT Final: [[(TPH O < TPH S), (TPH P < TPH O), (TPH O < TPH R), (TPH P < TPH T), (TPH M = void), (TPH N < TPH O), (TPH N < TPH Q)]]
Simplified constraints: [(TPH O < TPH S), (TPH P < TPH O), (TPH O < TPH R), (TPH P < TPH T), (TPH N < TPH O), (TPH N < TPH Q)]
m: [(TPH DDV = java.lang.Object), (TPH DDX = java.lang.Object), (TPH DDX < TPH DDV), (TPH N < TPH DDX), (TPH P < TPH DDX)]
Class Inf: []
Inf: []
Unify nach Oder-Constraints-Anpassung:
UND:[(void =. M, , -1 WC: false, IT: false), (N <. O, 1 WC: false, IT: false, 1 WC: false, IT: false), (P <. O, 1 WC: false, IT: false, 1 WC: false, IT: false), (N <. Q, 1 WC: false, IT: false, 0 WC: true, IT: false), (O <. S, 1 WC: false, IT: false, 0 WC: true, IT: false), (O <. R, 1 WC: false, IT: false, 0 WC: true, IT: false), (P <. T, 1 WC: false, IT: false, 0 WC: true, IT: false)]
isInherited = false
isStatement = false
ODER:
*/
@@ -0,0 +1,6 @@
class Infimum {
m(x, y, z) {
y = x;
z = x;
}
}
@@ -0,0 +1,18 @@
import java.util.Vector;
import java.lang.Integer;
import java.lang.String;
public class Inherit {
main(d, i) {
return d.m(i);
}
main(v, i) {
var aa = v.elementAt(0);
return aa.m(i);
}
}
@@ -0,0 +1,17 @@
import java.util.Vector;
import java.lang.Integer;
import java.lang.String;
public class Inherit2 {
main(d) {
return d.m2(d);
}
main(v) {
var aa = v.elementAt(0);
return aa.m2(aa);
}
}
@@ -0,0 +1,3 @@
public interface Interface1{
public void test();
}
@@ -0,0 +1,13 @@
public class KompTph {
public m(a, b, c) {
var d = a;
var e = a;
a = b;
c = b;
m2(a,c);
}
public m2(a,b){
m(a,a,b);
}
}
@@ -0,0 +1,9 @@
public class LamRunnable{
public LamRunnable(){
Runnable lam = () -> {System.out.println("lambda");};
lam.run();
}
}
@@ -0,0 +1,11 @@
import java.lang.Integer;
public class Lambda {
m () {
var lam1 = (x) -> {
return x;
};
return lam1;
}
}
@@ -0,0 +1,35 @@
import java.lang.String;
public class Lambda2
{
public static void main(List<String> args){
var listOfStrings = new List<String>();
var listOfObjects;
listOfObjects = map(listOfStrings, (a) -> a);
}
public map(a , b){
b.apply(a);
return a;
}
/*
public static <I,O> List<O> map(List<I> input, Function<I,O> func) {
List<O> output;
output = new List<O>();
output.add(func.apply(input.get()));
return output;
}
*/
}
class List<A>{
/* A get();
void add(A);
*/
}
/*
class Function<A,B>{
B apply(A a);
}
*/
@@ -0,0 +1,23 @@
public class Lambda2
{
/*
public static <A> List<A> map(List<? extends A> input,
Function<? super A, ? extends A> func){
input.add(func.apply(input.get()));
}
*/
public map(input,func){
input.add(func.apply(input.get()));
return map(new List<String>(), func);
}
}
class List<A>{
A get();
void add(A);
}
class Function<A,B>{
B apply(A a);
}
@@ -0,0 +1,18 @@
class Lambda{
methode(){
return ((f) -> f);
}
}
/*
interface Fun0<A>{
A apply();
}
interface Fun1<A,B>{
A apply(B b);
}
*/
interface Fun2<A,B,C>{
A apply(B b, C c);
}
@@ -0,0 +1,12 @@
import java.lang.Integer;
public class LambdaCapture {
Integer i = 8;
f;
public LambdaCapture(){
Integer w = 7;
f = j ->{
return w+i;};
}
}
@@ -0,0 +1,9 @@
import java.lang.Integer;
public class Lambda {
m () {
var lam1 = (x) -> { };
return lam1;
}
}
@@ -0,0 +1,56 @@
import java.lang.Integer;
import java.lang.Long;
import java.lang.Float;
import java.lang.Double;
public class LessEqual {
lessEqual(Integer a, Integer b){
var c = a<=b;
return c;
}
lessEqual(Long a, Long b){
var c = a<=b;
return c;
}
lessEqual(Float a, Float b){
var c = a<=b;
return c;
}
lessEqual(Double a, Double b){
var c = a<=b;
return c;
}
lessEqual(Long a, Integer b){
var c = a<=b;
return c;
}
lessEqual(Float a, Integer b){
var c = a<=b;
return c;
}
lessEqual(Double a, Integer b){
var c = a<=b;
return c;
}
lessEqual(Float a, Long b){
var c = a<=b;
return c;
}
lessEqual(Double a, Long b){
var c = a<=b;
return c;
}
lessEqual(Double a, Float b){
var c = a<=b;
return c;
}
}
@@ -0,0 +1,57 @@
import java.lang.Integer;
import java.lang.Long;
import java.lang.Float;
import java.lang.Double;
public class LessThan {
lessThan(Integer a, Integer b){
var c = a<b;
return c;
}
lessThan(Long a, Long b){
var c = a<b;
return c;
}
lessThan(Float a, Float b){
var c = a<b;
return c;
}
lessThan(Double a, Double b){
var c = a<b;
return c;
}
lessThan(Long a, Integer b){
var c = a<b;
return c;
}
lessThan(Float a, Integer b){
var c = a<b;
return c;
}
lessThan(Double a, Integer b){
var c = a<b;
return c;
}
lessThan(Float a, Long b){
var c = a<b;
return c;
}
lessThan(Double a, Long b){
var c = a<b;
return c;
}
lessThan(Double a, Float b){
var c = a<b;
return c;
}
}
@@ -0,0 +1,44 @@
import java.util.Vector;
import java.lang.Integer;
import java.lang.Float;
//import java.lang.Byte;
//import java.lang.Boolean;
public class Matrix extends Vector<Vector<Integer>> {
Matrix () {
}
Matrix(vv) {
Integer i;
i = 0;
while(i < vv.size()) {
// Boolean a = this.add(vv.elementAt(i));
this.add(vv.elementAt(i));
i=i+1;
}
}
mul(m) {
var ret = new Matrix();
var i = 0;
while(i < size()) {
var v1 = this.elementAt(i);
var v2 = new Vector<Integer>();
var j = 0;
while(j < v1.size()) {
var erg = 0;
var k = 0;
while(k < v1.size()) {
erg = erg + v1.elementAt(k)
* m.elementAt(k).elementAt(j);
k++; }
// v2.addElement(new Integer(erg));
v2.addElement(erg);
j++; }
ret.addElement(v2);
i++;
}
return ret;
}
}
@@ -0,0 +1,43 @@
import java.util.Vector;
import java.lang.Integer;
//import java.lang.Byte;
import java.lang.Boolean;
public class MatrixOP extends Vector<Vector<Integer>> {
MatrixOP () {
}
MatrixOP(vv) {
Integer i;
i = 0;
while(i < vv.size()) {
// Boolean a = this.add(vv.elementAt(i));
this.add(vv.elementAt(i));
i=i+1;
}
}
public mul = (m1, m2) -> {
var ret = new MatrixOP();
var i = 0;
while(i < m1.size()) {
var v1 = m1.elementAt(i);
var v2 = new Vector<Integer>();
var j = 0;
while(j < v1.size()) {
var erg = 0;
var k = 0;
while(k < v1.size()) {
erg = erg + v1.elementAt(k)
* m2.elementAt(k).elementAt(j);
k++; }
// v2.addElement(new Integer(erg));
v2.addElement(erg);
j++; }
ret.addElement(v2);
i++;
}
return ret;
};
}
+20
View File
@@ -0,0 +1,20 @@
import java.util.List;
import java.lang.Integer;
//import java.util.Collection;
class Merge {
merge(a, b) {
a.addAll(b);
return a;
}
sort(in){
var firstHalf = in.subList(1,2);
var secondHalf = in.subList(1,2);
return merge(sort(firstHalf), sort(secondHalf));
}
}
@@ -0,0 +1,14 @@
import java.lang.Integer;
class Methods {
m(a,b){
var c=a+b;
return c;
}
method2(x){
Integer i = this.m(x,2);
return i;
}
}
+32
View File
@@ -0,0 +1,32 @@
import java.lang.String;
import java.lang.Integer;
import java.lang.Double;
import java.lang.Boolean;
//import java.util.Vector;
public class OL {
java.lang.Double m(java.lang.Double x) { return x + x; }
java.lang.Integer m(java.lang.Integer x) { return x + x; }
java.lang.String m(java.lang.String x) { return x + x; }
java.lang.Boolean m(Boolean x) { return x; }
// if the class contains just this method, then correct BC will be generated.
// But if another methods are contained then the generated BC is not correct
// m(x) {
// //x.add(1);
// x.addAll(x);
// return x;
// }
}
public class OLMain {
main(x) {
var ol;
ol = new OL();
return ol.m(x);
}
}
+13
View File
@@ -0,0 +1,13 @@
import java.lang.String;
import java.lang.Integer;
import java.lang.Double;
import java.util.Vector;
import java.lang.Boolean;
public class OLFun {
//f = x -> {return x + x;};
m(f, x) {
x = f.apply(x+x);
}
}
@@ -0,0 +1,13 @@
import java.lang.String;
import java.lang.Integer;
import java.lang.Double;
import java.util.Vector;
import java.lang.Boolean;
public class OLFun2 {
x;
m(f){
x = f.apply(x + x)
}
}
+16
View File
@@ -0,0 +1,16 @@
import java.lang.Integer;
import java.lang.String;
import java.lang.Long;
import java.lang.Float;
import java.lang.Double;
import java.lang.Boolean;
import java.lang.Short;
import java.lang.Byte;
public class Op {
m(a, b) {
//var c = a+b;
return a+b;
}
}
+11
View File
@@ -0,0 +1,11 @@
import java.lang.Integer;
import java.lang.String;
public class Op2 {
m(){
var x = "";
var a = 5+x;
return a;
}
}
@@ -0,0 +1,11 @@
import java.util.Vector;
class OverlaodGen {
void method(Vector<Integer> v) {
// Integer i = v.get(0);
}
void method(Vector<String> v) {
// String s = v.get(0);
}
}
@@ -0,0 +1,18 @@
import java.lang.String;
public class Overloading{
test(x){
return x.methode();
}
methode(){
return "Overloading";
}
}
public class Overloading2{
methode(){
return "Overloading2";
}
}
+9
View File
@@ -0,0 +1,9 @@
import java.lang.Integer;
import java.lang.String;
public class Plus {
m(a,b) {
return a+b;
}
}
@@ -0,0 +1,27 @@
import java.lang.Integer;
public class PostIncDec {
m() {
var i = 0;
i++;
return i;
}
m2() {
var i = 0;
var j = i++;
return j;
}
d() {
var i = 0;
i--;
return i;
}
d2() {
var i = 0;
var j = i--;
return j;
}
}
@@ -0,0 +1,28 @@
import java.lang.Integer;
public class PreInc {
m() {
var i = 0;
++i;
return i;
}
m2() {
var i = 0;
var j = ++i;
return j;
}
d() {
var i = 0;
--i;
return i;
}
d2() {
var i = 0;
var j = --i;
return j;
}
}
+19
View File
@@ -0,0 +1,19 @@
import java.util.Vector;
import java.util.Stack;
public class Put {
putElement(ele, v) {
v.addElement(ele);
}
putElement(ele, s) {
s.push(ele);
}
main(ele, x) {
putElement(ele, x);
}
}
@@ -0,0 +1,5 @@
public class RecursiveMeth{
public Integer test(){
return this.test();
}
}

Some files were not shown because too many files have changed in this diff Show More