What is the difference between Inclusive and Exclusive OR?
Asked Answered
P

9

21

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.

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

Petronella answered 14/7, 2010 at 12:51 Comment(3)
This isn't programming, this is "English". While I understand that it occurs in a programming context, it's really an English language question, not a programming question.Inhumane
I understand but please see my comment to Mark extracted from the text I am reading. Its very technical English.Petronella
Please put your "comment to Mark" in the question so that the question is complete and readable and understandable by everyone.Inhumane
L
51
  • Inclusive or (A ∨ B): A or B or both.
  • Exclusive or (A ⊻ B): Either A or B but not both.

Lifeordeath answered 14/7, 2010 at 12:53 Comment(2)
Still apply?- 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 BPMNPetronella
The truth table is good, but explaining this by taking a real-life analogy would be appreciated.Memberg
F
18
A B OR XOR  
1 0  1  1  
1 1  1  0  
0 1  1  1  
0 0  0  0  
Frae answered 14/7, 2010 at 12:54 Comment(0)
L
12

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

Inclusive OR 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.

Whereas Exclusive OR 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.

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.

Lotz answered 26/9, 2014 at 12:13 Comment(0)
C
7

The difference is what happens with both components are true. With inclusive or, the result is also true. With exclusive or, the result is false.

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

Charlinecharlock answered 14/7, 2010 at 12:54 Comment(0)
P
4

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 false if both are true, cause its exclusive means A or B but not both

Personage answered 14/7, 2010 at 12:55 Comment(0)
M
4

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').

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'.

Muricate answered 3/3, 2014 at 1:58 Comment(0)
P
0

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

Pazia answered 24/1, 2012 at 19:58 Comment(1)
That is not correct. Resorting to fuzzy English Language analogies to explain precise technical terms is rarely helpful.Vishinsky
R
0

In inclusive OR, the condition is atleast one of the two must be true. Whereas, in exclusive OR, BOTH cannot be true,atleast one must be true.

Ruebenrueda answered 1/7, 2021 at 4:9 Comment(0)
R
0

As a philosophy graduate, this topic used to catch-out even very good graduates.

It is an issue of grammar, more than anything.

Would you like to visit France or Italy?

If one replied 'yes' it wouldean that one would happily visit both countries.

vs

Would you like to visit France...or Italy? (meaning choose between the two).

Russel answered 18/7, 2022 at 20:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.