Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 © Amit Mitra & Amar Gupta Constraints Constraints shape the Lawful State Space of an object –Create polymorphisms Constraints on value –Homework: Read.

Similar presentations


Presentation on theme: "1 © Amit Mitra & Amar Gupta Constraints Constraints shape the Lawful State Space of an object –Create polymorphisms Constraints on value –Homework: Read."— Presentation transcript:

1 1 © Amit Mitra & Amar Gupta Constraints Constraints shape the Lawful State Space of an object –Create polymorphisms Constraints on value –Homework: Read Supplementary materials Module 3 The generic constraint –Supplementary materials Module 6

2 2 © Amit Mitra & Amar Gupta Attribute Value Constraint is a partition OBJECT.......PARTITION partitioned by [partition of] Partition based on State Attribute Value Constraint (Partition based on value of a single property) Inclusion SetExclusion Set Is a subtype of Subtyping Criteria Partition of a partition based on Inclusion/Exclusion of states

3 3 © Amit Mitra & Amar Gupta Value Range VALUE SET Range Union of 1 or more Value Set VALUE SET STATEFUL SUBSET OF A DOMAIN

4 4 © Amit Mitra & Amar Gupta NOMINAL DOMAINS Inclusion set: –Property may take any value in inclusion set, and no other. Eg: Person may only be Male or Female Playing card may only be Joker, Spade, Club, Heart or Diamond Exclusion set: –Property may not take a value in exclusion set. Eg: New Mexico Whiptail lizard may not be Male =May only be Female Irreducible fact normalized by inclusion set Irreducible fact normalized by exclusion set IMPOSSIBLE We know how many values the set has and what all of them are We know neither the cardinality, nor all the values in the set We know how many values the set has, but not what all of them are No. of values in Value Set Known Unknown Exhaustive Partition Eg. The set has 5 values, of which 2 are not known Exhaustive Partition? Eg. 3 values of an indeterminate number are known Non-exhaustive Partition We know every value but not how many there are Actual value Known Unknown IMPOSSIBLE “Optional” Attributes or Hermaphrodite

5 5 © Amit Mitra & Amar Gupta NOMINAL DOMAINS IMPOSSIBLE We know how many values the set has and what all of them are We know neither the cardinality, nor all the values in the set We know how many values the set has, but not what all of them are No. of values in Value Set Known Unknown Exhaustive Partition Eg. The set has 5 values, of which 2 are not known Exhaustive Partition? Eg. 3 values of an indeterminate number are known Non-exhaustive Partition We know every value but not how many there are Actual value Known Unknown IMPOSSIBLE Inclusion set: –Can sometimes, but not always be sure we are “lawful” –Often implemented in systems as “Optional” properties Exclusion set: –May spot violations, but cannot be sure we can catch them all –If the sole member of an exhaustive exclusion set is the Unknown Value, it is a mandatory property Is “Mandatory Attribute” a misnomer?: In this sense it means that the attribute value must be known, a stricter condition than asserting that the existence of the attribute must be mandatory. Known Risk? Unknown Risk

6 6 © Amit Mitra & Amar Gupta Attribute Value Attribute Must take only 1 Is valid/invalid for (constrain) AGGREGATE OBJECT SET OF VALUES ATOMIC RULES NORMALIZED BY AGGREGATE RELATIONSHIP Constraining Relationship (Object Class) Constraining Value Constraining Value Constraining Value Constraining Value Constraining Value OBJECT A Subtype of Attribute’s domain OBJECT C Constraining Set OBJECT B ( constrain ) is invalid (excluded by) Is valid (i.e., included by) SUBTYPE B1 Exclusion Relationship (Object Class) SUBTYPE B2 Inclusion Relationship (Object Class) Is subtype of Number of distinct Values Number of values “unknown” ATTRIBUTES OF VALUE SET

7 7 © Amit Mitra & Amar Gupta Example of “role” Same as “constrain” ? ? If both B1 and B2 are exhaustive, B will be exhaustive, but not vice-versa

8 8 © Amit Mitra & Amar Gupta Range Upper Bound Value The set cannot be empty Lower Bound Value (OPTIONAL) At most 1 (OPTIONAL) At most 1

9 9 © Amit Mitra & Amar Gupta Value Range VALUE SET Subtype of Attribute’s domain (Object A) THE STRUCTURE OF RANGE RANGE Lower Bound Value (OPTIONAL) At most 1 The set of bounds cannot be empty Upper Bound Value (OPTIONAL) At most 1 IMPLIES AGGREGATE OBJECT SET OF VALUES OR RANGES METAMODEL OF RANGE VALUE SET Value May be upper bound of 0 or more [May have 0 or one upper bound] May be lower bound of 0 or more [May have 0 or one lower bound] At least one must exist Range

10 10 © Amit Mitra & Amar Gupta Jane is a woman who adores blue cars, likes red cars a lot, green cars a little, is neutral about white cars, and dislikes black cars a little. Thus it is possible to rank Jane’s color preference in order of magnitude, but it is impossible to say how much she prefers one car color above another. ADORESLIKES A LOT LIKES A LITTLE NEUTRALDISLIKES A LITTLE Jim, the sales manager of a car showroom knows Jane’s car color preferences. He asks Charles, the car sales man, to show Jane cars of colors she is at least neutral about. Thus neutrality in preference for car colors is the lower bound of the range of car colors he will show Jane. In other words, the attribute is Person’s car color preference. The range is neutral or greater car color preference, and the lower bound of the range is neutral car color preference. The range has no upper bound. Charles, unfortunately, loathes Jane secretly because she had once turned him down for a date. Charles is a petty man who does not want to show Jane cars with colors she will like. On the other hand he is afraid of disobeying Jim. He strikes a secret compromise with himself. He decides he will show Jane cars with colors which, at worst she will dislike only a little, and at best colors she will like only a little. Thus Charles sets the upper bound of the car color preference range at Likes a little for cars he intends to show Jane, and the lower bound for the range at dislike a little. Thus a range may have an upper bound, a lower bound or both. This range constraint is an inclusion set. The cars Charles intended to show Jane had to take a value from in this range of car color preference. Ranges can also be exclusion sets. For example, Jim could have asked Charles not to show Jane cars of colors she neither likes nor dislikes, or worse (neutral car color preference or car colors she dislikes even a little). This would then be an exclusion set for car color preference with an upper bound (neutrality) - Jim would have excluded this range of Jane’s car color preference from cars he would show her, i.e., values in the range would not be permitted. ORDINAL DOMAINS

11 11 © Amit Mitra & Amar Gupta QUANTITATIVE DOMAINS Question: Are the following statements identical? 1.The thread must be two feet long or less 2.The thread must be less than two feet long Answer is No 1.is a range with a closed (upper) bound 2.is a range with an open (upper) bound –Upper and/or lower bounds of ranges of quantitative values may be open or closed In ordinal domains –The expression “must be less than the n th rank” is equivalent to “must be (n-1) th rank or less” –The expression “must be greater than the n th rank” is equivalent to “must be (n+1) th rank or more” –In ordinal domains, open and closed bounds are merely different expressions of the same meaning –This meaning is also an irreducible fact

12 12 © Amit Mitra & Amar Gupta Ordinal or quantitative Value Range BOUND May be 0 or more must have 1 to 2 Subtype (role) of Lower Bound Upper Bound Subtype of Upper/Lower Bound Partition Closed Bound Open Bound Subtype of Closed/Open Partition may have 0 or 1 Subtype of may have 0 or 1 Quantitative Value Quantitative Bound Subtype of

13 13 © Amit Mitra & Amar Gupta Is valid/invalid in (i.e., included/excluded from range) is subtype of Ordinal or Quantitative Value Limiting Value Range Value in a Range Limit 1 or more [limited by 1 or 2] is subtype of (ROLE) The two sets are equal Attribute (ROLE) A value in a domain need not be an attribute value, but those that are, are playing that role. They are subtypes of Value based on having that relationship with Attribute. Must take only 1 [may be value of 0 or more]

14 14 © Amit Mitra & Amar Gupta Limit 1 or more [limited by 1 or 2] Excluded from 0 or more Is subtype of OPEN BOUND Range If the limiting relationship exists, the other must, too and vice-versa (the two sets are equal) Must contain 1 or more [be contained in 1 or more] Is valid/invalid in 1 or more (I.e., included/excluded from range) [bounded by 1 or 2] The two sets are equal (the limiting value of a given range, must be either included or excluded from the range) Cannot exceed 0 or more [cannot be exceeded by 0 or 1] Cannot be exceeded by 0 or more [cannot exceed 0 or 1] Is subtype of LOWER BOUND UPPER BOUND BOUND (Aggregate Object) Limiting Value (Ordinal or Quantitative) Value in Range Included in 0 or more CLOSED BOUND

15 15 © Amit Mitra & Amar Gupta SAME OBJECT

16 16 © Amit Mitra & Amar Gupta Establishing the limits of a range is only one of several roles of an ordinal or quantitative value The pattern of information that defines the concept called “Bound” THE SEMANTICS OF “BOUND” (See Box 29 in Module 3 of supplementary materials)

17 17 © Amit Mitra & Amar Gupta Merging Value Sets Merging value sets creates a new perspective. –Perspective is an object. It changes state –The old value sets and ranges go away and are subsumed into the merged range/value set Identical values merge into one value –A set does not distinguish between identical members (a list does) –Ranges merge Open overlapping ranges cannot merge –The limiting value is excluded from the range, hence it will always divide a merger, or will cause a conflict –A conflict creates a Null State. Null represents lack of meaning, not magnitude (Nil) Open and Closed overlapping ranges may merge if an overlapping “edge” (limit) is the “Unknown Value” –Because Known values will override unknown values If an open limit is Known, the range will be divided at the limit(s) into separate ranges Inclusion sets may only merge with Inclusion sets Exclusion sets may only merge with exclusion sets Range

18 18 © Amit Mitra & Amar Gupta Metamodel of a simple value constraint How do constraints on objects flow to subtypes? –Subtypes may be more, but not less constrained than their supertype A constraint on the subtype/Polymorphism may be stricter than a constraint on its parent, but the subtype cannot violate the lawful state space of its parent Constraints on cardinality are an example of this RULE –The cardinality constraints of a subtype relationship may be stricter than its parent, but cannot violate the cardinality of the parent

19 19 © Amit Mitra & Amar Gupta MERGER IMPLIES UNION OF VALUE SETS SAME OBJECT

20 20 © Amit Mitra & Amar Gupta COMPLEX VALUE CONSTRAINTS

21 21 © Amit Mitra & Amar Gupta A Joint Constraint is the repository of a single atomic rule that mutually relates all participating attributes (objects) A quantitative relationship can contain a mathematical formula that involves each participating attribute (A single atomic rule that relates all participating attributes) Constraints that bind more than 2 objects Examples of a 3 way constraints between states Joint constraint Magnitude constraint RULE EXPRESSIONS A KIND OF INCLUSION SET Could have been an exclusion set Could have been ranges Could have been value sets Could have been ranges Could have been value sets Ordinal Rules values could lead to sequencing rules Duration of a process cannot be less than the duration of its longest subprocess

22 22 © Amit Mitra & Amar Gupta CFO’s Signature CEO’s Signature Payability of Check JOINT CONSTRAINT (relationship) A Joint Constraint is the repository of a single atomic rule that mutually relates all participating attributes

23 23 © Amit Mitra & Amar Gupta Rent Energy Fee Check Amount Amount=Rent + Energy fee (quantitative relationship) A quantitative relationship can contain a mathematical formula that involves each participating attribute (A single atomic rule that relates all participating attributes)

24 24 © Amit Mitra & Amar Gupta Value Of 1 or more Join with 1 or more [join with 0 or 1] Expression of Rule Inclusion/Exclusion Include Exclude Subtype of Inclusion/Exclusion Partition (RULE) CONSTRAIN Value Set May be used by 0 to many [involve values in 1] Value Set EXAMPLES OF STATIC RULES Percentages must add up to 100 The area of a rectangle is the product of its sides The height of a room cannot exceed the height of the building it is in These are parts of a car (a relationship between objects) EXAMPLES OF DYNAMIC RULES Assemble the car from its parts The check must be signed before it is payable PROCESS

25 25 © Amit Mitra & Amar Gupta Value Inclusion/Exclusion Of 1 or more Join with 1 or more [join with 0 or 1] Expression of Rule Include Exclude Subtype of Inclusion/Exclusion Partition (RULE) CONSTRAIN Value Set May be used by 0 to many [involve values in 1]

26 26 © Amit Mitra & Amar Gupta ORDER= No of Sets (Classes) involved DEGREE=No. of values (objects) involved STATIONARITY=Rule and/or value set changes over time RELATIONSHIPS BETWEEN ATTRIBUTES object Value A1 value C1 (image of value A1) RULE DOMAIN OF RULE CODOMAIN OF RULE SET A (set of all permitted values of attribute A) SET C (set of all permitted values of attribute C) object value C1 (image of combination of values) RULE DOMAIN OF RULE CODOMAIN OF RULE SET A Set of all permitted values of an attribute (attribute A) SET C Set of all permitted values of a different attribute (attribute C) Value A1 COMBINATION OF ATTRIBUTES’ VALUES SET B (set of all permitted values of a another attribute (attribute B) Value B1 DOMAIN OF RULE INVERSE OF RULE

27 27 © Amit Mitra & Amar Gupta Value Inclusion/Exclusion May be contained in 0 to many [contain 1 to many] Of 1 or more Attribute Must take only 1 [of 0 or more] DOMAIN FRAGMENT FROM METAMODEL OF ATTRIBUTE is a subtype of Equal sets of only 1 Expression of Rule term in 0 or more [conjoined via operator with 0 or more] RULE MEANING Expressed by 1 or more [expression of 1] Include Exclude Subtype of Inclusion/Exclusio n Partition CONSTRAIN Subtype of Value Set May be used by 0 to many [involve values in 1] CONSTRAIN Inclusion/ Exclusion Expression of Rule UML SYNTAX 1 0..* * Meaning of Rule 1 * Join with 1 or more [join with1 or more] E.g. Area of a rectangle (of sides of length “a” and “b”) UNKNOWN Business Process Automation Business Rules (Meaning) Layer TRANSFORM E.g. 1.(a+b) 2 2.a 2 +b 2 +2a.b Rule meaning may be used elsewhere Eg: the area of a square may be used to compute the volume of a cube The concept called “Constrain” depends on inclusion/Exclusion for its very existence Cardinality constraint Normalizing Ignorance Know two or more attributes are related, but not how Not know which attributes participate in a rule Know which attributes participate in a rule, but not all their values Not know whether to include or exclude Know the meaning of a rule, but not how it might be expressed/calculated –Eg: know exposure to advertising will influence sales, but not how, or all the variables involved When the co-domain is quantitative, know some, but not all terms of the rule expression –Assign “Don’t Know” value to some terms

28 28 © Amit Mitra & Amar Gupta RULE Expression of Rule RULE MEANING Expressed by 1 or more [expression of 1] Normal Form of expression Subtype of Equivalent to 0 or 1 [equivalent to of 0 or more different]

29 29 © Amit Mitra & Amar Gupta IMPLICATION COUNT Add the flow of time House Town Located in 1 [location of 1 or more] LIVE IN 1 [LIVED IN BY 0 OR MORE] Person Live in 1 [lived in by 0 or more] EXAMPLE OF IMPLICATION (TRANSITIVITY) WITH OBJECT CLASSES SET OF NUMBERS SET OF INSTANCE IDENTIFIERS SET OF NUMBERS RULE: MAP EACH INSTANCE IDENTIFIER TO THE NUMBER “1” RULE: SUM ALL MAPPED NUMBERS IMPLIED (RESULTING) RULE ADD ONE FOR EACH INSTANCE IDENTIFIER EXAMPLE OF IMPLICATION (TRANSITIVITY) WITH DOMAINS

30 30 © Amit Mitra & Amar Gupta Include/Exclude May be contained in 0 to many [contain 1 to many] Value 1 or more [constrained by 0 or more] Join with 1 or more [join with 0 or 1] Expression of Rule term in 0 or more [conjoined via operator with 0 or more] Value Set May be used in 0 to many [involve values in 1] RULE MEANING Expressed by 1 or more [express 1] IRREFLEXIVE RELATIONSHIP ORDER OF A CONSTRAINT When a constraint constrains another constraint (Constraining set) Constraining set RECURSIVE RELATIONSHIP CONSTRAINING STATE SPACE Collections of constraints may define the lawful state space of an object The collection is an object Collections may merge Members of the original collection will merge, constrained by the rules we have discussed

31 31 © Amit Mitra & Amar Gupta READING ASSIGNMENT Module 3

32 32 © Amit Mitra & Amar Gupta Attribute Constraint (Partition based on value of a single attribute) Inclusion Set Exclusion Set Is a subtype of Partition based on Inclusion/Exclusion of states merger of 0 or more (inherited) merger of 0 or more (inherited) X merger not permitted

33 33 © Amit Mitra & Amar Gupta PARAMETER OF contained in value set limit of bound PARAMETER OF contained in value set limit of bound PARAMETER OF limit of bound contained in value set PARAMETER OF limit of bound contained in value set

34 34 © Amit Mitra & Amar Gupta Value Constraint (Partition based on value of a single attribute) Inclusion Set Exclusion Set Is a subtype of Partition based on Inclusion/Exclusion of states merger of 0 or more (inherited) merger of 0 or more (inherited) merger not permitted may merge with only 0 [may merge with only 0] Value constrain Parameter of limit of bound contained in value set

35 35 © Amit Mitra & Amar Gupta Contains 1 or more [contained in 0 or more] (Inherited relationship) Range BOUND must have 1 to 2 Lower Bound Upper Bound Upper/Lower Bound Partition Closed Bound Open Bound Subtype of Closed/Open Partition may have 0 or 1 Subtypes of may have 0 or 1 Subtype of Ordinal or quantitative Value Subtype of Value Set Union of 0 or more Value Subtype of Contains 1 or more [contained in 0 or more] Attribute Must take only 1 Limit of 0 or more [must specify 1 limiting] Subtype of Limit all values in 1 or more [values limited by 1 or 2] Sets are equal Constrains 0 or more [constrained by 0 or more] VALUE CONSTRAINT DOMAIN FRAGMENT FROM METAMODEL OF ATTRIBUTE is a subtype of Equal sets

36 36 © Amit Mitra & Amar Gupta Value Include/Exclude Value Attribute DOMAIN FRAGMENT FROM METAMODEL OF ATTRIBUTE is a subtype of Equal sets of only 1 Include Exclude Subtype of Inclusion/Exclusi on Partition CONSTRAIN 1 0..* Rule Expression (Only) Ordinal or Nominal Rule Expression (Only) Nominal Rule Expression Subtype of Must take only 1 [of 0 or more] Ordinal Value Nominal Value Subtype of Domain based (nonexhaustive) Partition (inherited) term in 0 or more [conjoined via operator with 0 or more] Join with 1 or more [join with 0 or 1] Subset of Include/Exclude (inherited) Subtype of may merge with only 0 [may merge with only 0] 1 or more [constrained by 0 or more] May participate in 0 to many [contain 1 to many] Value Set May be used in 0 to many [involve values in 1] RULE MEANING * * Expressed by 1 or more [expression of 1] 1 Nominal Terms Ordinal Terms * 1..* * (inherited)

37 37 © Amit Mitra & Amar Gupta Value Include/Exclude Value Attribute DOMAIN FRAGMENT FROM METAMODEL OF ATTRIBUTE is a subtype of Equal sets of only 1 Include Exclude Subtype of Inclusion/Exclusion Partition CONSTRAIN 1 0..* Rule Expression (Only) Ordinal or Nominal Rule Expression (Only) Nominal Rule Expression Subtype of Must take only 1 [of 0 or more] Ordinal Value Nominal Value Subtype of Domain based (nonexhaustive) Partition (inherited) term in 0 or more [conjoined via operator with 0 or more] Join with 1 or more [join with 0 or 1] Subset of Include/Exclude (inherited) Subtype of may merge with only 0 [may merge with only 0] 1 or more [constrained by 0 or more] May participate in 0 to many [contain 1 to many] Value Set May be used in 0 to many [involve values in 1] RULE MEANING * * Expressed by 1 or more [expression of 1] 1 Exclude terms with Arithmetic operators Exclude terms with ranking operations

38 38 © Amit Mitra & Amar Gupta Include/Exclude Value Attribute DOMAIN FRAGMENT FROM METAMODEL OF ATTRIBUTE is a subtype of Equal sets of only 1 Include Exclude Subtype of Inclusion/Exclusion Partition CONSTRAIN 1 0..* Rule Expression (Only) Ordinal or Nominal Rule Expression (Only) Nominal Rule Expression Subtype of Must take only 1 [of 0 or more] Ordinal Value Nominal Value Subtype of Domain based (nonexhaustive) Partition (inherited) term in 0 or more [conjoined via operator with 0 or more] Join with 1 or more [join with 0 or 1] Subset of Include/Exclude (inherited) Subtype of may merge with only 0 [may merge with only 0] May participate in 0 to many [contain 1 to many] Value Set May be used in 0 to many [involve values in 1] RULE MEANING * * Expressed by 1 or more [expression of 1] 1 Exclude rules with Arithmetic operators Exclude rules with ranking operations Value 1 or more [constrained by 0 or more]

39 39 © Amit Mitra & Amar Gupta Limit 1 or more [limited by 1 or 2] Excluded from 0 or more Is subtype of OPEN BOUND Range Must contain 1 or more [be contained in 1 or more] Is valid/invalid in 1 or more (i.e., included/excluded from range) [bounded by 1 or 2] Cannot exceed 0 or more [cannot be exceeded by 0 or 1] Cannot be exceeded by 0 or more [cannot exceed 0 or 1] Is subtype of LOWER BOUND UPPER BOUND Limiting Value (Ordinal or Quantitative) Value in Range Included in 0 or more CLOSED BOUND The two sets are equal

40 40 © Amit Mitra & Amar Gupta MERGER IMPLIES UNION OF VALUE SETS SAME OBJECT

41 41 © Amit Mitra & Amar Gupta SAME OBJECT

42 42 © Amit Mitra & Amar Gupta SAME OBJECT

43 43 © Amit Mitra & Amar Gupta SAME OBJECT

44 44 © Amit Mitra & Amar Gupta SAME OBJECT WINDOW INTO CONSTRAIN VALUE CONSTRAINT SAME OBJECT

45 45 © Amit Mitra & Amar Gupta SAME OBJECT WINDOW INTO CONSTRAIN VALUE CONSTRAINT SAME OBJECT

46 46 © Amit Mitra & Amar Gupta SAME OBJECT WINDOW INTO CONSTRAIN VALUE CONSTRAINT SAME OBJECT Subtype of BOUND SAME OBJECT

47 47 © Amit Mitra & Amar Gupta SAME OBJECT WINDOW INTO CONSTRAIN VALUE CONSTRAINT SAME OBJECT Subtype of BOUND SAME OBJECT


Download ppt "1 © Amit Mitra & Amar Gupta Constraints Constraints shape the Lawful State Space of an object –Create polymorphisms Constraints on value –Homework: Read."

Similar presentations


Ads by Google