Method for verifying five-prevention logic expression through reverse Polish notation
A logical expression and anti-polish technology, which is applied in the direction of logical operation inspection, faulty computer hardware detection, etc., can solve problems affecting the life safety of operators, substation switching operation errors, and incomplete consideration, etc., to reduce test pressure , improve the accuracy and ensure the effect of correctness
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment Construction
[0034] Such as figure 1 As shown in , the general algorithm for converting an ordinary inorder expression to a reverse Polish expression is:
[0035] (1) First construct an operator stack S1 and a reverse Polish stack S2. Operators in the operator stack S1 follow the principle that the higher the priority toward the top of the stack, the higher the priority.
[0036] (2) Read in a simple arithmetic expression represented by infix, and scan the arithmetic expression from left to right.
[0037] (3) If the current character is a number, the end of the number string is analyzed and the number string is directly output and pushed into the reverse Polish stack S2; if it is not a number, the character is an operator, and the priority relationship needs to be compared at this time, The method is as follows: compare the character with the precedence of the operator at the top of the operator stack S1, if the precedence of the character is higher than that of the operator at the top o...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 