configuration([
   extension("languages/pico/syntax/Pico-Syntax", ".pico"),
   extension("Pico-typecheck", ".ptc"),
   extension("Pico-eval", ".pev"),
   extension("Pico-compile", ".ptr"),
   extension("Booleans", ".bool"),

   button("languages/pico/syntax/Pico-Syntax",
          [description(term-editor, menu(["Pico","PrettyPrint"]))],
          [push-active-module,
	   get-root,
           push-string("PROGRAM"),
           check-sort,
           push-term(true),
           if-equal([push-modulename("Pico-pretty"),
                     reduce,
	             push-active-module,
                     pretty-print,
                     set-root,
                     push-active-module,
                     parse-action],
		    [])]),

   button("languages/pico/syntax/Pico-Syntax",
          [description(term-editor, menu(["Pico","TypeCheck"]))],
          [push-active-module,
	   get-root,
           push-string("PROGRAM"),
           check-sort,
           push-term(true),
           if-equal([apply("tcp", "Boolean", 1),
                     push-modulename("Pico-typecheck"),
                     reduce,
                     push-filename("reduct.out"),
                     push-modulename("Pico-typecheck"),
	             close-editor,
                     push-filename("reduct.out"),
                     push-modulename("Pico-typecheck"),
                     activate-editor],
		    [])]),

   button("languages/pico/syntax/Pico-Syntax",
          [description(term-editor, menu(["Pico","Evaluate"]))],
          [push-active-module,
	   get-root,
           push-string("PROGRAM"),
           check-sort,
           push-term(true),
           if-equal([apply("tcp", "Boolean", 1),
                     push-modulename("Pico-typecheck"),
                     reduce,
	             push-string("true"),
	             parse("basic/Booleans", "Boolean"),
	             if-equal([push-active-module,
	                       get-root,
                               apply("evp", "VALUE-ENV", 1),
                               push-modulename("Pico-eval"),
                               reduce,
                               push-filename("reduct.out"),
                               push-modulename("Pico-eval"),
	                       close-editor,
                               push-filename("reduct.out"),
                               push-modulename("Pico-eval"),
                               activate-editor],
		              [message("Program contains type error")])],
                    [])]),

   button("languages/pico/syntax/Pico-Syntax",
          [description(term-editor, menu(["Pico","Compile"]))],
          [push-active-module,
	   get-root,
           push-string("PROGRAM"),
           check-sort,
           push-term(true),
           if-equal([apply("tcp", "Boolean", 1),
                     push-modulename("Pico-typecheck"),
                     reduce,
	             push-string("true"),
	             parse("basic/Booleans", "Boolean"),
	             if-equal([push-active-module,
	                       get-root,
                               apply("trp", "Instrs", 1),
                               push-modulename("Pico-compile"),
                               reduce,
                               push-filename("reduct.out"),
                               push-modulename("Pico-compile"),
	                       close-editor,
                               push-filename("reduct.out"),
                               push-modulename("Pico-compile"),
                               activate-editor],
		              [message("Program contains type error")])],
                    [])]),

   button("languages/pico/syntax/Pico-Syntax",
          [description(term-editor,menu(["Pico","SimplifyExpression"]))],
          [get-focus,
           push-string("EXP"),
           check-sort,
           push-term(true),
           if-equal([apply("simplify", "EXP", 1),
                     push-modulename("SimplifyExpr"),
                     reduce,
                     set-focus],
                    [])])
  ])
