xml 包含和异或的区别是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3246249/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-06 13:12:10  来源:igfitidea点击:

What is the difference between Inclusive and Exclusive OR?

xmlbpelbpmn

提问by fwc

I have been studying some Business Process Execution Language (BPEL) and the associated modelling system (BPMN) where the designer needs to learn about inclusive and exclusive gateways for process flow. Thanks very much for any help and a general explanation of the terms would be enough assuming the same rules apply.

我一直在研究一些业务流程执行语言 (BPEL) 和相关的建模系统 (BPMN),其中设计人员需要了解流程流的包容性和专属性网关。非常感谢您的任何帮助,假设适用相同的规则,对这些术语的一般解释就足够了。

This is some technical text I am trying to understand in response to Mark- For simple links that join two activities, the status defaults to true so the target activity always gets executed. However, if a transition condition is applied to the link, such as a test of the value contained in a process variable, the status may be set to 'false', blocking the execution of any target activities. If a target has multiple links then the decision to execute or block is based on the OR of the individual link status values. Only one link status need be true for the target to execute; hence transition conditions can be used to map the Inclusive OR gateway of BPMN

这是我在回应 Mark时试图理解的一些技术文本- 对于连接两个活动的简单链接,状态默认为 true,因此目标活动总是被执行。但是,如果将转换条件应用于链接,例如测试流程变量中包含的值,则状态可能会设置为“假”,从而阻止任何目标活动的执行。如果目标具有多个链接,则执行或阻止的决定基于各个链接状态值的 OR。目标执行只需一个链接状态为真;因此可以使用转换条件来映射 BPMN 的 Inclusive OR 网关

回答by Mark Byers

  • Inclusive or: A or B or both.
  • Exclusive or: Either A or B but not both.
  • 包括或:A 或 B 或两者。
  • Exclusive or:A 或 B,但不能同时兼有。

回答by Josef Jetmar

A B OR XOR  
1 0  1  1  
1 1  1  0  
0 1  1  1  
0 0  0  0  

回答by Salmaniac

Considering the value for the statement "A OR B":

考虑语句“A OR B”的值:

InclusiveOR allows both possibilities as well as either of them. So, if either A or B is True, or if both are True, then the statement value is True.

包含OR 允许两种可能性以及其中一种。因此,如果 A 或 B 为真,或者两者都为真,则语句值为真。

Whereas ExclusiveOR only allows one possibility. So if either A or B is true, then and only then is the value True. If both A and B are True, even then the statement's value will be False.

ExclusiveOR 只允许一种可能性。因此,如果 A 或 B 为真,则且仅此为真。如果 A 和 B 都为 True,即使如此,语句的值也将为 False。

Example for Exclusive OR: At a restaurant, you are offered a coupon which entitles you to eat either a Sandwich OR a Burger. This is an exclusive OR statement in English language. You can choose either one of them, but not both.

Exclusive OR 示例:在一家餐厅,您会收到一张优惠券,您可以在其中吃三明治或汉堡。这是英文的独占 OR 语句。您可以选择其中之一,但不能同时选择两者。

回答by T.E.D.

The difference is what happens with both components are true. With inclusiveor, the result is also true. With exclusiveor, the result is false.

不同之处在于两个组件都发生了什么true。与包含或,结果也是true。使用或,结果是false

Exclusive or is kinda like Highlander: There can be only one. :-)

独家或有点像汉兰达:只能有一个。:-)

回答by Prof G MUTHURAMAN

INCLUSIVE 'OR' : Logic OR means its output is 'ON' if any of the input is 'ON'. It includes 'both' inputs are 'ON' (At least one input is 'ON').

INCLUSIVE 'OR' :逻辑或表示如果任何输入为“ON”,则其输出为“ON”。它包括“两个”输入都为“ON”(至少一个输入为“ON”)。

EXCLUSIVE 'OR' : It is same as Inclusive OR, with the (only) EXCEPTION is while 'both' inputs are 'ON' then the output goes OFF, (NOT ON as in the Inclusive OR) and hence the name EXCLUSIVE 'OR'.

EXCLUSIVE 'OR' :它与 Inclusive OR 相同,(唯一的)EXCEPTION 是当 'both' 输入为 'ON' 然后输出关闭,(不像在 Inclusive OR 中那样打开),因此名称为 EXCLUSIVE 'OR '。

回答by oezi

as a result table:

结果表:

inclusive or:

包括或:

A B Result
0 0 0
1 0 1
0 1 1
1 1 1

exclusive or:

独家或:

A B Result
0 0 0
1 0 1
0 1 1
1 1 0

so, aus you can see, an exclusive or give falseif both are true, cause its exclusive means A or B but not both

所以, aus 你可以看到,false如果两者都是, 一个排斥或给予true, 导致它的排斥意味着A 或 B 但不是两者

回答by sheila

well on a totally different note - and getting back to everyday English conversation the inclusive/exclusive thing can be made clearer:

在一个完全不同的音符上 - 回到日常英语对话中,可以更清楚地说明包容性/排他性:

Do you want tea or coffee? (meaning, fancy something to drink?) = inclusive or Do you want tea or coffee? (meaning you have to choose between the two) = exclusive

你要茶还是咖啡?(意思是想喝点什么?)= 包容性或你想要茶还是咖啡?(意味着您必须在两者之间进行选择)= 独占