dismantle - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Low-level Manipulation : dismantle

dismantle

display a Maple data structure, optionally with addresses

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

dismantle(expr);

dismantle[hex](expr);

dismantle[dec](expr);

dismantle[oct](expr);

Parameters

expr

-

expression to display

Description

• 

The dismantle functions display the structure of a Maple expression, showing each sub-expression, its length (in decimal), and optionally its address (in hexadecimal, decimal, or octal). The length corresponds to the number of terms in the sequence of addresses (see disassemble) of the sub-expression.

• 

The dismantle[hex] function displays the addresses of each subexpression in hexadecimal, preceding the length.

• 

The dismantle[dec] function displays the addresses of each subexpression in decimal, preceding the length.

• 

The dismantle[oct] function displays the addresses of each subexpression in octal, preceding the length.

• 

There are two additional options to dismantle that can be used in combination with the hex, dec, and oct options above to alter its behavior.

• 

The dismantle[...,string] function outputs the dismantle data as a string rather than as output to the session.

• 

The dismantle[...,address] function can be used with only a single argument that represents the address (see addressof) of the object to be dismantled. This is useful to display the structure of objects that cannot be passed as arguments (assignments for example).

• 

The dismantle functions are intended as extra tools for the "hackware package". It is assumed that the user is familiar with Maple's internal representation, and can make use of the information provided by dismantle.

• 

Maple names, integers, rationals, and floats are displayed on one line, as they would appear when typed or printed by lprint. For example, NAME(7): `This is a string`.

• 

Local variables and parameters are displayed on one line, as the ordinal number of the variable or parameter in square brackets. For example, LOCAL(2): [3].

• 

The exponents in a series are displayed on one line, as integers in square brackets.

• 

A non-existent object (not to be confused with the Maple object NULL) is displayed as [NIL].

• 

Other structures are printed as a header, followed by the components of the structure indented 3 spaces below the header.

• 

The dismantle function is intended solely as an aid to debugging and/or understanding the internal structures of Maple. For example, it can be useful when writing external code using the OpenMaple API. As such, dismantle simply prints its output; it does not return a result. To produce an easily-manipulated inert form of a Maple structure, use ToInert instead.

Examples

f := proc(x) if x < 2 then x^2 else x^3 end if end proc:

dismantlef


NAME(4): f

dismantleopf


PROC(11)
   EXPSEQ(2)
      NAME(4): x
   EXPSEQ(1)
   EXPSEQ(1)
   EXPSEQ(1)
   IF(4)
      LESSTHAN(3)
         PARAM(2): [1]
         INTPOS(2): 2
      PROD(3)
         PARAM(2): [1]
         INTPOS(2): 2
      PROD(3)
         PARAM(2): [1]
         INTPOS(2): 3
   EXPSEQ(1)
   EXPSEQ(1)
   EXPSEQ(1)
   BINARY(2)
      1
   EXPSEQ(5)
      LIST(2)
         EXPSEQ(5)
            INTPOS(2): 0
            INTPOS(2): 1
            INTPOS(2): 6
            INTPOS(2): 55
      LIST(2)
         EXPSEQ(5)
            INTPOS(2): 0
            INTPOS(2): 1
            INTPOS(2): 14
            INTPOS(2): 46
      LIST(2)
         EXPSEQ(5)
            INTPOS(2): 0
            INTPOS(2): 1
            INTPOS(2): 28
            INTPOS(2): 32
      LIST(2)
         EXPSEQ(5)
            INTPOS(2): 0
            INTPOS(2): 1
            INTPOS(2): 37
            INTPOS(2): 41

fa&plus;b2&plus;a&plus;b3

f:=a&plus;b2&plus;a&plus;b3

(1)

dismantle&lsqb;hex&rsqb;f


SUM(100007FC5E0C81F4E,5)
   PROD(100007FC5E0FB1A66,3)
      SUM(100007FC5E0C81EFE,5)
         NAME(100007FC5E0C660FE,4): a
         INTPOS(10000000000000001,2): 1
         NAME(100007FC5E0C7159E,4): b
         INTPOS(10000000000000001,2): 1
      INTPOS(10000000000000003,2): 2
   INTPOS(10000000000000001,2): 1
   PROD(100007FC5E0FB1A7E,3)
      SUM(100007FC5E0C81EFE,5)
         NAME(100007FC5E0C660FE,4): a
         INTPOS(10000000000000001,2): 1
         NAME(100007FC5E0C7159E,4): b
         INTPOS(10000000000000001,2): 1
      INTPOS(10000000000000005,2): 3
   INTPOS(10000000000000001,2): 1

dismantle&lsqb;hex&comma;string&rsqb;f

SUM(100007FC5E0C81F4E,5) PROD(100007FC5E0FB1A66,3) SUM(100007FC5E0C81EFE,5) NAME(100007FC5E0C660FE,4): a INTPOS(10000000000000001,2): 1 NAME(100007FC5E0C7159E,4): b INTPOS(10000000000000001,2): 1 INTPOS(10000000000000003,2): 2 INTPOS(10000000000000001,2): 1 PROD(100007FC5E0FB1A7E,3) SUM(100007FC5E0C81EFE,5) NAME(100007FC5E0C660FE,4): a INTPOS(10000000000000001,2): 1 NAME(100007FC5E0C7159E,4): b INTPOS(10000000000000001,2): 1 INTPOS(10000000000000005,2): 3 INTPOS(10000000000000001,2): 1

(2)

An assignment

fassemblekerneloptsdagtag&equals;ASSIGN&comma;addressofa&comma;addressofb

f:=18446884561569954958

(3)

dismantle&lsqb;address&rsqb;f


ASSIGN(3)
   NAME(4): a
   NAME(4): b

evalpointtof

b

(4)

See Also

addressof

assemble

debugger

disassemble

kernelopts

pointto

ToInert

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam