/* -*- Mode: maxima; Package: MAXIMA -*- */
/*
;; Copyright Leo Butler (leo.butler@member.fsf.org) 2013
;; Released under the terms of GPLv2
*/

load("smath.lisp")$

/*
o = set of operands
in_or_out=true  -> test if op is in o
in_or_out=false -> test if op is not o
*/
sm_check_for_ops(o,in_or_out) ::= buildq([o:if atom(o) then {o} else o, in_or_out:in_or_out],
  lambda([e],
    is(numberp(e) and e<0 and e#-1) or is(not(atom(e)) and member(op(e),o)=in_or_out)));

/*
sm_brace_in_exponent -> put a brace around all exponents
*/
apply(matchdeclare,[[sm_x],true,sm_y,sm_check_for_ops({set},false)]);
defrule(sm_brace_in_exponent,sm_x^sm_y,sm_x^{sm_y});
sm_rules:['sm_brace_in_exponent];

/* end of smath.mac */
