正在加载图片...
4. Where one connective symbols is used repeatedly, grouping is to the right All these explicit rules make our parsing algorithm complicated if you want to accommodate the right proposition other than well-defined ones for convenience. Furthermore, you should prove that explicit rule would not result in ambiguity 4. 3 Polish notation Rules are not convenient. However there is a smart way to get rid of parentheses permanently, it is just the Polish notation. As we have already known, any connective is just a function with one or two parameters. We can represent a proposition as following without any parentheses 2. D(a, B)=VaB 3.DA(a,B)=∧aB 4.D→(a,B)=→aB 5.D4(a,B)=+aB It is called Polish notation. Actually, it can be expanded to any n-ary function Consider the following example, which is translated from a well-defined proposition Example 4. Determine the well defined proposition of →∧AD∨→BCB It is easy to recover the well-defined form. Do it as an exercise Yah! We do eliminate parentheses successfully. But what is your feeling about Polish notation when you try to figure out what it represents. In fact, it is an approach very suitable for machine but human. To us, the well-defined way is much better There are several approached to translate Polish representation into regular one, which is left as 5 Appendix: Inductive definition In our class, many definitions are defined recursively or inductively. We just introduce Definition 6. A set s is closed under a single operation f(s1, .. Sn)if and only if every s1,..., Sn E n)∈S Definition 7. The clo of a set S under(all) the operations in a set t is the smallest C such4. Where one connective symbols is used repeatedly, grouping is to the right. All these explicit rules make our parsing algorithm complicated if you want to accommodate the right proposition other than well-defined ones for convenience. Furthermore, you should prove that explicit rule would not result in ambiguity. 4.3 Polish notation Rules are not convenient. However there is a smart way to get rid of parentheses permanently, it is just the Polish notation. As we have already known, any connective is just a function with one or two parameters. We can represent a proposition as following without any parentheses: 1. D¬(α) = ¬α. 2. D∨(α, β) = ∨αβ. 3. D∧(α, β) = ∧αβ. 4. D→(α, β) =→ αβ. 5. D↔(α, β) =↔ αβ. It is called Polish notation. Actually, it can be expanded to any n-ary function. Consider the following example, which is translated from a well-defined proposition. Example 4. Determine the well defined proposition of → ∧AD ∨ ¬B ↔ CB. It is easy to recover the well-defined form. Do it as an exercise. Yah! We do eliminate parentheses successfully. But what is your feeling about Polish notation when you try to figure out what it represents. In fact, it is an approach very suitable for machine but human. To us, the well-defined way is much better. There are several approached to translate Polish representation into regular one, which is left as an exercise. 5 Appendix: Inductive definition In our class, many definitions are defined recursively or inductively. We just introduce Definition 6. A set S is closed under a single operation f(s1, . . . , sn) if and only if every s1, . . . , sn ∈ S, f(s1, . . . , sn) ∈ S Definition 7. The closure of a set S under (all) the operations in a set T is the smallest C such that 5
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有