- 论坛徽章:
- 11
|
本帖最后由 superwujc 于 2013-06-08 10:37 编辑
回复 33# sacry
楼上几位大神的论述已经远远超出了小弟的认知范围,只能望其项背
小弟没学过离散高数之类的理论,如果要说到对这个问题认知的理论基础,只能是高中数学中简单的逻辑基础
小弟之所以会想到这个问题,是因为在学习Linux系统调用有关各种进程ID时,看到了setreuid(2),该调用对saved set-user-ID的影响有一条规则:- For both privileged and unprivileged processes, the saved set-user-ID is also set
- to the same value as the (new) effective user ID if either of the following is true:
- a) ruid is not –1 (i.e., the real user ID is being set, even to the same value it
- already had), or
- b) the effective user ID is being set to a value other than the value of the real
- user ID prior to the call.
复制代码- Put conversely, if a process uses setreuid() only to change the effective user ID
- to the same value as the current real user ID, then the saved set-user-ID is left
- unchanged, and a later call to setreuid() (or seteuid()) can restore the effective
- user ID to the saved set-user-ID value.
复制代码 由于这么长的文字实在不适合理解,加之上面提到a或b之一为true时会更改saved set-user-ID,所以小弟觉得用条件之间的逻辑关系来理解更为合理,把文字描述转化为公式,以后遇到此类问题只要套用一下就可以了
说下小弟的看法,
因为a和b都可以作为逻辑条件,非是即非,没有第三种状态,而后面还提到put conversely怎样怎样,所以觉得当a或b两者任一条件成立时都会更改进程的saved set-user-ID,而当put conversely之后的条件为真时却不会,因此小弟大胆的认为put conversely之前和之后描述的结果互否
正如28楼hwrd_et和33楼sacry所说,
∵1
∴2
由“逻辑条件为真,则命题为真”推导出“逻辑条件为假,则命题的否命题为真”,小弟只是想求证一下自己的想法,所以来请教各位,仅此而已
说下小弟的推导过程:
∵ (!A || !B) => C
∴ !(!A || !B) => !C //类似于等式两边同时怎样怎样后依然相等,如同时乘以-1?
∴ !!A && !!B => !C //类似于乘法分配率?
∴ A && B => !C //类似于负负得正,正负得负,所以非非得是,非或得与?
不知道这样的理解方式和推导过程是否有漏洞,或者某个步骤完全错误,尽请各位大神拍砖
|
|