-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpred.java
32 lines (30 loc) · 1.02 KB
/
pred.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import java.util.*;
public class MyClass {
public static Dictionary pred = new Hashtable();
public static void predicate(String name, String ptype, String ctype){
List<String> funForm = new ArrayList<String>();
String fun = "";
fun += name + ":<" + symb.get(ptype) + ",t>";
System.out.println(fun);
funForm.add(fun);
fun = "";
fun += name + ":<" + symb.get(ptype) + "," + symb.get(ctype) + ">";
System.out.println(fun);
funForm.add(fun);
fun = "";
fun += name + ":<" + symb.get(ptype) + ",<" + symb.get(ptype) + ",t>>";
System.out.println(fun);
funForm.add(fun);
fun = "";
fun += name + ":<t,<" + symb.get(ptype) + "," + symb.get(ctype) + ">>";
System.out.println(fun);
funForm.add(fun);
pred.put(name,funForm);
}
public static void main(String args[]) {
int x=10;
int y=25;
int z=x+y;
System.out.println("Sum of x+y = " + z);
}
}