fork download
  1. declare fun {GetLast S}
  2. if S.2 == nil then S.1 else {GetLast S.2} end
  3. end
  4. declare fun {And c1 c2}
  5. if c1 then
  6. if c2 then
  7. true
  8. else
  9. false
  10. end
  11. else
  12. false
  13. end
  14. end
  15. % Assemble a Beta Reduction
  16. % B is a string that contains already done inclusions
  17. % A is the list that needs to have I between each member
  18. fun {B_Assemble I B A}
  19. {Browse [I B A]}
  20. if A == nil then B else {B_Assemble I {Append {Append B I} A.1} A.2} end
  21. end
  22.  
  23. % Beta Reduction Main Function
  24. % V is the variable such that \x where V = x
  25. % E is the function expression e such that \x.e
  26. % A is the function application expression e1 suc hthat \x.e e1
  27.  
  28.  
  29. fun {Beta V E A}
  30. if {And (E.1 == V.1) ({GetLast E} == V.1)} then
  31. {B_Assemble A "" {Append {Append [""] {String.tokens E V.1} [""]}}}
  32. else
  33. if {E.1 == V.1} then
  34. {B_Assemble A "" {Append [""] {String.tokens E V.1}}}
  35. else if {GetLast E} == V.1 then
  36. {B_Assemble A "" {Append {String.tokens E V.1} [""]}}
  37. else
  38. {B_Assemble A "" {String.tokens E V.1}}
  39. end
  40. end
  41. end
  42.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Mozart Compiler 1.4.0 (20080704) playing Oz 3

%%% feeding file prog.oz

%*************************** parse error ************************
%**
%** syntax error, unexpected T_ENDOFFILE, expecting T_end
%**
%** in file "./prog.oz", line 42, column 0
%** ------------------ rejected (1 error)
stdout
Standard output is empty