Appendix A: System Routines — Logic
739
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
push_and
Declaration:
void
push_and
(EStackIndex
i
, EStackIndex
j
)
Category(ies):
Logic
Description:
Pushes onto the estack the internally-simplified form of the logical “and” of
the Boolean expressions indexed by
i
and
j
.
Boolean expressions generally simplify to a disjunctive form a1 and a2
and . . . or b1 and b2 and . . . or . . . .
Example: a and (b or c<d) simplifies to a and b or a and c<d.
Inputs:
i
,
j
—
Indices of the top tags of an internally-simplified comparisons,
Boolean expressions or aggregates thereof.
Outputs:
None
Assumptions:
None
Side Effects:
None
Availability:
On AMS 2.02 and higher.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also: and_onto_top, replace_top2_with_and
Example:
void and_onto_top (EStackIndex i)
/* i and top_estack index Boolean expressions.
Replaces the latter expression with the logical And of the 2 expressions.
*/
{ Access_AMS_Global_Variables;
EStackIndex old_top = top_estack;
if (FALSE_TAG == ESTACK (old_top) ||
TRUE_TAG == ESTACK (i) ||
are_expressions_identical (i, old_top) )
return;
if (TRUE_TAG == ESTACK (old_top) || FALSE_TAG == ESTACK (i))
{ top_estack = next_expression_index (top_estack);
push_expression (i);
}
else
{ push_and (i, old_top);
delete_expression (old_top);
}
}