% Spinach file for the notgate class % module andgatespi. import typechecker, wiresig, gatesig, bigatesig, andgatesig, spinach. % Extension % extends andgate bigate. % Typechecker stuff %%%%%%%%%%%%%%%%%%% % Generated by: otype andgate ref wire -> ref wire -> ref wire -> class. % tcheck Theta andgate Cont tmod TC :- popmod (andgate InwireA InwireB Outwire) M, pi C\ tcheck ((tp C (tref andgate))::Theta) (M C) Cont tprog TC. tcheck Theta (new (andgate InwireA InwireB Outwire) P) Cont tcmd TC :- tcheck Theta InwireA nil (tref wire) nil, tcheck Theta InwireB nil (tref wire) nil, tcheck Theta Outwire nil (tref wire) nil, pi C\ tcheck ((tp C (tref andgate))::Theta) (P C) Cont tcmd TC. tcheck Theta (cons G (andgate InwireA InwireB Outwire)) Cont theadin TC :- tcheck Theta G nil (tref andgate) nil, tcheck ((tp InwireA (tref wire))::(tp InwireB (tref wire)):: (tp Outwire (tref wire))::Theta) none Cont dot TC. tcheck Theta (cons G (andgate InwireA InwireB Outwire)) Cont theadout TC :- tcheck Theta none Cont dot TC. tcheck Theta (super C (andgate InwireA InwireB Outwire)) Cont tcmd TC :- tcheck Theta InwireA nil (tref wire) nil, tcheck Theta InwireB nil (tref wire) nil, tcheck Theta Outwire nil (tref wire) nil, tcheck Theta none Cont dot TC. % Spinacher stuff %%%%%%%%%%%%%%%%% % Generated by: otype andgate ref wire -> ref wire -> ref wire -> class. % spinach Theta Mu (tref andgate) "Andgate". spinach Theta Mu andgate Java :- popmod (andgate InwireA InwireB Outwire) P, extends andgate O, spinach nil nil (tref O) SO, pi C\ spinach ((tp C (tref andgate))::Theta) ((np C "this")::Mu) (P C) JP, Java is "public class " ^ "Andgate" ^ " extends " ^ SO ^ "{\n" ^ JP ^ "}\n". spihead Theta Mu (cons G (andgate InwireA InwireB Outwire)) (InwireA::InwireB::Outwire::nil) Java "" :- spinach nil nil (tref wire) STW, spinach Theta Mu InwireA SInwireA, spinach Theta Mu InwireB SInwireB, spinach Theta Mu Outwire SOutwire, Java is "Andgate" ^ "(" ^ STW ^ " " ^ SInwireA ^ ", " ^ STW ^ " " ^ SInwireB ^ ", " ^ STW ^ " " ^ SOutwire ^ "){\n". spinach Theta Mu (popnew (andgate InwireA InwireB Outwire) S P) Java :- pi O\ spinach ((tp Outwire (tref andgate))::nil) ((np O S)::Mu) (P O) JP, spinach nil nil (tref andgate) JS, spinach Theta Mu InwireA SInwirea, spinach Theta Mu InwireB SInwireb, spinach nil nil Outwire SOutwire, Java is JS ^ " " ^ S ^ " = new " ^ JS ^ "(" ^ SInwirea ^ ", " ^ SInwireb ^ ", " ^ SOutwire ^ ");\n" ^ JP. spinach Theta Mu (super C (andgate InwireA InwireB Outwire)) Java :- spinach Theta Mu InwireA JIA, spinach Theta Mu InwireB JIB, spinach Theta Mu Outwire JO, Java is "super(" ^ JIA ^ ", " ^ JIB ^ ", " ^ JO ^ ");\n".