class interface FACTOR

creation

make (ind: INDETERMINATE; exp: INTEGER)

— does not make a deep copy of ind; change the data of ind and you change this factor also!

require

exp >= 0

make_variable_exponent (var: STRING; exp: INTEGER)

— here the label on var will be Void

require

exp >= 0

ensure

indet.label = Void

make_variable_label_exponent (var: STRING; lab: STRING; exp: INTEGER)

require

exp >= 0

feature(s) from FACTOR

indet: INDETERMINATE

exponent: INTEGER

make (ind: INDETERMINATE; exp: INTEGER)

— does not make a deep copy of ind; change the data of ind and you change this factor also!

require

exp >= 0

make_variable_exponent (var: STRING; exp: INTEGER)

— here the label on var will be Void

require

exp >= 0

ensure

indet.label = Void

make_variable_label_exponent (var: STRING; lab: STRING; exp: INTEGER)

require

exp >= 0

is_equal (other: like Current): BOOLEAN

— Is other attached to an object considered equal to
— current object ?

require

other /= Void

ensure

generating_type = other.generating_type implies Result = other.is_equal(Current)

has_same_name (other: FACTOR): BOOLEAN

set_exponent (exp: INTEGER)

require

exp >= 0

add_to_exponent (incr: INTEGER)

require

incr >= 0

sub_from_exponent (decr: INTEGER)

require

decr >= 0 and exponent - decr >= 0

deep_twin: like Current

— Return a new object with the dynamic type of Current.
— The new object structure is recursively duplicated from the one
— attached to Current.

print_text

print_latex

print_html

invariant

exponent >= 0;

end of FACTOR