maplemint - Maple Programming Help

Home : Support : Online Help : Programming : Debugging : maplemint

maplemint

procedural mint

 Calling Sequence maplemint(Procedure);

Parameters

 Procedure - a Maple procedure

Description

 • The call maplemint(Procedure) generates semantic information for a procedure and displays code that can never be executed.
 • maplemint generates reports for:
 – system name/declared parameter conflicts
 – system name/declared local variable conflicts
 – system name/declared global variable conflicts
 – constants that are assigned a value
 – declared global variables that begin with '_'
 – declared global variables that are never used
 – global variables that are used but not declared
 – declared local variables that are never used
 – declared local variables that are assigned a value, but unused
 – local variables that are used before being assigned a value
 – unused parameters
 – loop variables that are used repeatedly in nested loops
 – unreachable code
 – equations used as statements
 – break or next found outside of loop
 – missing '*'  -  as in 2(x+1)
 • Currently, maplemint has no knowledge of Maple's module system or exception handling, and is not able to analyze procedures that use these language features.

Examples

 > a:=proc()    local b; global c;    if (b=5) then       b:=6;       return(true);       lprint(test);    end if; end proc:
 > $\mathrm{maplemint}\left(a\right)$
 This code is unreachable:       lprint(test)     These global variables were declared, but never used:       c     These local variables were used before they were assigned a value:       b
 > a:=proc() local b,i;    b:=6;    while (b>0) do       for i from 1 to 6 do          break;          printf(%d,i);       end do;       for i in [1,3,5] do          lprint(i);          break;          lprint(test);       end do;       b:=b-1;    end do; end proc:
 > $\mathrm{maplemint}\left(a\right)$
 This code is unreachable:       printf(%d,i)     This code is unreachable:       lprint(test)
 > a:=proc() local i;    for i from 1 to 10 do       lprint(i);       for i from 1 to 6 do          lprint(i);       end do;    end do; end proc:
 > $\mathrm{maplemint}\left(a\right)$
 These variables were used as the same loop variable for nested loops:       i
 > a:=proc() local i;   i:=5;   while(i<10) do      lprint(test);   end do; end proc:
 > $\mathrm{maplemint}\left(a\right)$
 These names were used as global names, but were not declared:       test
 > a:=proc() global _abc; end proc:
 > $\mathrm{maplemint}\left(a\right)$
 These global variables start with an '_':       _abc     These global variables were declared, but never used:       _abc
 > a:=proc();    5=6; end proc:
 > $\mathrm{maplemint}\left(a\right)$
 This equation was used as a statement:       5 = 6
 > a:=proc(); 2(x+1); end proc:
 > $\mathrm{maplemint}\left(a\right)$
 This expression may be missing an operator like '*':       2(x+1)     These names were used as global names, but were not declared:       x
 > a:=proc() local T,i;    T[i]:=8; end proc:
 > $\mathrm{maplemint}\left(a\right)$
 These local variables were assigned a value, but otherwise unused:       T, i