500 likes | 648 Views
A Core Course on Modeling. Week 2 – the Art of Omitting. Organizing concepts trees tables Organizing meaning objects semantics Notation Mapping ACCEL aggregation: vectors quantified expressions user defined functions. A Core Course on Modeling. Week 2 – the Art of Omitting.
E N D
A Core Course on Modeling Week 2 – the Art of Omitting • Organizingconcepts • trees • tables • Organizingmeaning • objects • semantics • Notation • Mapping • ACCEL • aggregation: vectors • quantified expressions • user defined functions
A Core Course on Modeling Week 2 – the Art of Omitting concepts: trees ‘Where do you live?’
A Core Course on Modeling Week 2 – the Art of Omitting Organizing concepts: trees country (e.g., Netherlands) province (e.g., North Brabant) city (e.g., Eindhoven) quarter (e.g., Woensel)
A Core Course on Modeling Week 2 – the Art of Omitting Organizing concepts: trees partOf() country (e.g., Netherlands) province (e.g., North Brabant) city (e.g., Eindhoven) quarter (e.g., Woensel)
A Core Course on Modeling Week 2 – the Art of Omitting Organizing concepts: trees isA() kingdom (e.g., animalia) phylum (e.g., chordata) class (e.g., mammalia) order (e.g., cetacea) family (e.g., delphinidae), genus (e.g., orcinus), species (e.g., orca)
A Core Course on Modeling Week 2 – the Art of Omitting Organizing concepts: trees Extensional definition: • enumerate existing things • grouping in (sub)sets isA()
A Core Course on Modeling Week 2 – the Art of Omitting Organizing concepts: trees Hierarchy: often too restrictive Subsets often relate to meaning Several hierarchies co-exist
A Core Course on Modeling Week 2 – the Art of Omitting Organizing concepts: tables A B Alternative: table C X Y Z
A Core Course on Modeling Week 2 – the Art of Omitting Organizing concepts: tables 9 A B Alternative: table C X Y Z property P values A,B,C property Q values x,y,z
A Core Course on Modeling Week 2 – the Art of Omitting Organizing concepts: tables 10 A B Example: set of vehicles; P = ‘medium’, A,B,C= ‘land’, ‘water’, ‘air’, Q = ‘payload’, X,Y,Z = ‘passengers’, ‘freight’, ‘mail’. C X Y Z property P values A,B,C property Q values x,y,z
A Core Course on Modeling Week 2 – the Art of Omitting Organizing concepts: tables A B C X Y Z property P values A,B,C (group) property Q values x,y,z (period)
A Core Course on Modeling Week 2 – the Art of Omitting Organizing concepts: tables A B what to do with >2 properties? C X Y Z property P values A,B,C property Q values x,y,z
A Core Course on Modeling Week 2 – the Art of Omitting Organizing concepts: tables A B c4, c5 are undistinguishable [P:B, Q:Y] does not occur C X Y Z
A Core Course on Modeling Week 2 – the Art of Omitting Organizing concepts: tables 14 A B P Q … Q C X c1 A X M … Y c2 B X M … Z c3 C X … M c4 A Y … N c5 A Y … M c6 C Y … N c7 A Z … N c8 C Z … N c9 C Z … M orthogonal table: every property applies to each concept
A Core Course on Modeling Week 2 – the Art of Omitting Organizing concepts: tables 15 Not every tree leads to an orthogonal table (Orthogonal) table: better compression than tree Orthogonal table: with N properties, distinguish O(2N) concepts or log(M) properties for M concepts. (Arbitrary) tree: N internal nodes for N leaves.
A Core Course on Modeling Week 2 – the Art of Omitting Organizing concepts: tables 16 orthogonal table ontology: helps explore option space image: http://www.emiliosanfilippo.it/?page_id=1172
A Core Course on Modeling Week 2 – the Art of Omitting Organizing concepts: tables 17 orthogonal table ontology: helps explore option space image: http://www.emiliosanfilippo.it/?page_id=1172
A Core Course on Modeling Week 2 – the Art of Omitting Organizing meaning: objects 18 ice1 = [taste:vanilla, holder:cone, cream:yes, topping:smarties, cherry:red] coneIce = [taste:{vanilla, choc, strawberry}, holder:cone, cream:{yes, no}, topping:{smarties, hazelnut}, cherry:{red, green, none}] ice = [taste:{vanilla, choc, strawberry}, holder:{cone, stick, bowl}, cream:{yes, no}, topping:{smarties, hazelnut}] image: http://www.emiliosanfilippo.it/?page_id=1172
A Core Course on Modeling Week 2 – the Art of Omitting Organizing meaning: objects 19 Intensional definition: • specifiy things by properties • irrespective existence • extensional intensional image: http://gagfunny.com/gag/index.php/tag/living-shadows-illusion/ image: http://www.emiliosanfilippo.it/?page_id=1172
A Core Course on Modeling Week 2 – the Art of Omitting Organizing meaning: objects 20 x : Y means: if x and Y are sets: x Y if x is an element: x Y abbreviate ‘{a}’ by ‘a’ isA(x,Y) means: for every P in Y, x.P : Y.P. isA(x,Y): inheritance; x inherits from Y x is more concrete, Y is more abstract image: http://www.emiliosanfilippo.it/?page_id=1172
A Core Course on Modeling Week 2 – the Art of Omitting Organizing meaning: objects 21 ice1 = [taste:vanilla, holder:cone, cream:yes, topping:smarties, cherry:red] coneIce = [taste:{vanilla, choc, strawberry}, holder:cone, cream:{yes, no}, topping:{smarties, hazelnut}, cherry:{red, green, none}] ice = [taste:{vanilla, choc, strawberry}, holder:{cone, stick, bowl}, cream:{yes, no}, topping:{smarties, hazelnut}] examples isA( ): ice1: coneIce; conIce : ice; isA(ice1, coneIce); isA(coneIce, ice); isA(ice, [holder:{cone, stick, bowl}]) isA(ice, [ ]) isA(coneIce, [ ]) a concept with just a single property (‘holder’) a very abstract concept, having no properties at all (‘a thing’) image: http://www.emiliosanfilippo.it/?page_id=1172
A Core Course on Modeling Week 2- conceptual modeling Organizing meaning: objects 22 The anatomy of concepts: a concept can be an item (a concrete, unique thing)
A Core Course on Modeling Week 2- conceptual modeling Organizing meaning: objects 23 The anatomy of concepts: a concept can be an item (a concrete, unique thing) or a concept can be a class
designer: gustaveEiffel location: ChampsDeMars height: 320 m A Core Course on Modeling Week 2- conceptual modeling Organizing meaning: objects 24 The anatomy of concepts: a concept can be an item (a concrete, unique thing) an item can have properties a concept can be a class … with values that may be concepts with properties of their own
such as: ‘bunch of steel girders’ such as:’monuments in Paris’ A Core Course on Modeling Week 2- conceptual modeling Organizing meaning: objects 25 The anatomy of concepts: a concepts can be an item (a concrete, unique thing) an item can have properties a concept can be a class … with values that may be concepts with properties of their own a class can be an aggregation or a class can be an abstraction
A Core Course on Modeling Week 2- conceptual modeling Organizing meaning: objects 26 The anatomy of concepts: a concepts can be an item (a concrete, unique thing) an item can have properties a concept can be a class … with values that may be concepts with properties of their own a class can be an aggregation … of all similar things, called elements or members (sometimes numbered) a class can be an abstraction
A Core Course on Modeling Week 2- conceptual modeling Organizing meaning: objects 27 The anatomy of concepts: a concepts can be an item (a concrete, unique thing) an item can have properties a concept can be a class … with values that may be concepts with properties of their own a class can be an aggregation … or all different things (elements, members - sometimes named) a class can be an abstraction
A Core Course on Modeling Week 2- conceptual modeling Organizing meaning: objects 28 The anatomy of concepts: a concepts can be an item (a concrete, unique thing) an item can have properties a concept can be a class … with values that may be concepts with properties of their own a class can be an aggregation … or all different things (sometimes named) a class can be an abstraction
A Core Course on Modeling Week 2- conceptual modeling Organizing meaning: objects 29 The anatomy of concepts: a concepts can be an item (a concrete, unique thing) an item can have properties a concept can be a class … with values that may be concepts with properties of their own a class can be an aggregation … or all different things (sometimes named) a class can be an abstraction … that typicaly has less properties than its concreter instances
A Core Course on Modeling Week 2- conceptual modeling Organizing meaning: objects 30 The anatomy of concepts: a concepts can be an item (a concrete, unique thing) an item can have properties a concept can be a class … with values that may be concepts with properties of their own a class can be an aggregation … or all different things (sometimes named) a class can be an abstraction … that can be instantiated by a more concrete concept
A Core Course on Modeling Week 2- conceptual modeling Organizing meaning: objects 31 The anatomy of concepts: a concepts can be an item (a concrete, unique thing) an item can have properties a concept can be a class use the right terms for the right things: • concept • item • class • aggregation, element • abstraction, instance • property … with values that may be concepts with properties of their own a class can be an aggregation … or all different things (sometimes named) a class can be an abstraction … that can be instantiated by a more concreteconcept
A Core Course on Modeling Week 2- conceptual modeling Notation: denote aggregation 32 v = {1, 2, 3}, a set with three numerical elements – not separately accessible p = [1, 2, 3], an array with three numbered numerical elements, p[0] = 1 q = [a, b, c], an array with 3 numbered concepts, q[0] = a r = [‘a’, ’b’, ’c’], an array with three numbered strings, r[0] = ‘a’ s = [‘x’:1, ’y’:2, ’z’:3], an array with three named numerical elements, s[‘x’] = 1 {1, 2, 3} == {3, 2, 1} [1, 2, 3] != [3, 2, 1] whereas [‘x’:1, ‘y’:2, ‘z’:3 ] == [‘y’:2, ‘z’:3, ‘x’:1] image:http://www.robertpeake.com/archives/419-manuscript-anxiety.html
A Core Course on Modeling Week 2- conceptual modeling Notation: denote aggregation 33 v = {1, 2, 3}, a set with three numerical elements – not separately accessible p = [1, 2, 3], an array with three numbered numerical elements, p[0] = 1 q = [a, b, c], an array with 3 numbered concepts, q[0] = a r = [‘a’, ’b’, ’c’], an array with three numbered strings, r[0] = ‘a’ s = [ x :1, y :2, z :3], an array with three named numerical elements, s[‘x’] = 1 {1, 2, 3} == {3, 2, 1} [1, 2, 3] != [3, 2, 1] whereas [‘x’:1, ‘y’:2, ‘z’:3 ] == [‘y’:2, ‘z’:3, ‘x’:1] • Quotes are optional for the names of properties image:http://www.robertpeake.com/archives/419-manuscript-anxiety.html
A Core Course on Modeling Week 2- conceptual modeling Notation: denote aggregation 34 p = [1, 2, 3], an array with three numbered numerical elements, p[0] = 1 is an abbreviation for p = ['0': 1, '1': 2, '2': 3] which is the same as p = ['1': 2, '0': 1, '2': 3] (order doesn't matter) But in the abbreviation, naming ('0':…, '1':…, '2':…) is left out. To know which of [1, 2, 3] or [2, 1, 3] is meant, order convention is required. image:http://www.robertpeake.com/archives/419-manuscript-anxiety.html
A Core Course on Modeling Week 2- conceptual modeling Notation: denote aggregation there is no notation to access an individual element 35 only use for numbers, weekdays, … but only for values that have total ordering. Sets, lists, concepts and accessing elements: P=[a, b, c]: ordered list, [a, b, c] [b, a, c] access elements: P[0] == a, etc. P={a, b, c}: set (unordered), {a, b, c} == {b, a, c} P={a… b}: set containing all x, a x b P=['john':a, 'pete':b, 'suzy': c]: named list or concept access elements: P['pete'] == b, alternative: P.pete == b ['john':a, 'pete':b, 'suzy': c] == ['pete':b, 'john':a, 'suzy': c] image:http://www.robertpeake.com/archives/419-manuscript-anxiety.html
A Core Course on Modeling Week 2 – the Art of Omitting Mapping 36 p = [1, 2, 3] q = [10, 20, 30] vector addition: sum = [p[0]+q[0], p[1]+q[1], p[2]+q[2]] = [11, 22, 33] Easier: sum = p + q ACCEL applies mapping whenever possible. image: http://www.corporatienl.nl/hoe-slaat-u-twee-vliegen-in-een-klap/
A Core Course on Modeling Week 2 – the Art of Omitting ACCEL • Why ACCEL? • compare to MS Excel, not to BASIC, C++, Matlab, … • low threshold for non-programmers • follows to-do-list approach from Lectures • built-in features (chapters 5 & 6) • Pareto Genetic Optimization • Sensitivity Analysis with Condition Numbers • .. why NOT ACCEL?
A Core Course on Modeling Week 2 – the Art of Omitting ACCEL: aggregation • allagregationbyvectors • vectorsaggregatearbitraryquantities • e.g.: v = [1, 2, 3]; v[1] : 2 • e.g.: v = [‘x’:1, ‘y’:2, ‘z’:3]; v[’y’] : 2 (v.y : 2) • also: v = [x:1, y:2, z:3]but NOT v[y] instead of v[‘y’] • e.g.: v = [1, [10, 20], 3]; v[0] : 1 v[1] : [10,20] v[1][1] : 20 v[0][1] :undefined … but ACCEL triesnot to disappointitsusers
A Core Course on Modeling Week 2 – the Art of Omitting ACCEL: aggregation 39 index1=slider(0,0,10) index2=slider(0,0,10) printB=b printC=c printD=d a=[1,[10,20],3] b=a[index1] c=b[index2] d=a[index1][index2] … but ACCEL tries not to disappoint its users
A Core Course on Modeling Week 2 – the Art of Omitting ACCEL: aggregation 40 netherlands=[… ,'provinces':p, …] p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li] gr=['cap':'groningen', 'pop':582161,'area':2960.03] fr=['cap':'leeuwarden','pop':647239,'area':5748.74] dr=['cap':'assen','pop': 489912, 'area':2680.37] ov=['cap':'zwolle','pop':1138571, 'area':3420.86] gl=['cap':'arnhem','pop':2013903 , 'area':5136.51] ut=['cap':'utrecht','pop':1243161 , 'area':1449.12] nh=['cap':'haarlem','pop':2719764 , 'area':4091.76] zh=['cap':'den haag','pop':3560205 , 'area':3418.50] zl=['cap':'middelburg','pop':381202 , 'area':2933.89] nb=['cap':'den bosch','pop':2470184 , 'area':5081.76] li=['cap':'maastricht','pop':1121483 , 'area':2209.22]
A Core Course on Modeling Week 2 – the Art of Omitting ACCEL: aggregation 41 netherlands=[…, 'provinces':p, …] p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li] gr=['cap':'groningen', 'pop':582161,'area':2960.03] …. prov0=p[0] prov1= … prov2= … pop0=prov0.pop pop1= … pop2= … totPop=pop0 + pop1 + … what is the exact population? sum over provinces image: http://www.dontpaniconline.com/magazine/radar/a-boring-conference
A Core Course on Modeling Week 2 – the Art of Omitting ACCEL: quantified expressions 42 netherlands=[…, 'provinces':p, …] p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li] gr=['cap':'groningen', 'pop':582161,'area':2960.03] …. Alternative: quantified expressions totPop = #(dummy, seq, term, operation) dummy: a quantity that assumes subsequent values from seq seq: a set of values. E.g., vSequence(0,11) = [0,1,2,3,4,5,6,7,8,9,10] term: an expression,perhaps depending on dummy operation:what to do with the values ofterm
A Core Course on Modeling Week 2 – the Art of Omitting ACCEL: quantified expressions 43 netherlands=[…, 'provinces':p, …] p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li] gr=['cap':'groningen', 'pop':582161,'area':2960.03] …. Alternative: quantified expressions totPop = #(dummy, seq, term, operation) totPop = #(i , [1,2,3] ,i,add) totPop = 6 t = [3,4,5,6,7] totPop = #(i , [1,2,3],t [i],add) totPop = t [1] + t [2] + t [3] = 4 + 5 + 6 = 15 u = [[1,2],[3,4],[5,6]] totPop = #(i , [0,1,2],u[i][1],add) totPop = ([1,2])[1] + ([3,4])[1] + ([5,6])[1] = 2 + 4 + 6 = 12
A Core Course on Modeling Week 2 – the Art of Omitting ACCEL: quantified expressions 44 netherlands=[…, 'provinces':p, …] p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li] gr=['cap':'groningen', 'pop':582161,'area':2960.03] …. Alternative: quantified expressions totPop = #(dummy, seq, term, operation) totPop = #(i, vSequence(0,11), p [i] . pop, add) maxPop = #(i, vSequence(0,11), p [i] . pop, max) minArea = #(i, vSequence(0,11), p [i] .area,min) … but suppose we need the most spacious province?
A Core Course on Modeling Week 2 – the Art of Omitting ACCEL: quantified expressions 45 netherlands=[…, 'provinces':p, …] p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li] gr=['cap':'groningen', 'pop':582161,'area':2960.03] …. Alternative: quantified expressions totPop = #(dummy, seq, term, operation) totPop = #(i, vSeq(0,11), p [i] . pop, add) maxPop = #(i, vSeq(0,11), p [i] . pop, max) minArea = #(i, vSeq(0,11), p [i] .area,min) … but suppose we need the most spacious province?
A Core Course on Modeling Week 2 – the Art of Omitting ACCEL: quantified expressions 46 netherlands=[…, 'provinces':p, …] p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li] gr=['cap':'groningen', 'pop':582161,'area':2960.03] …. spaciousness = area / population http://www.panoramio.com/photo/12605032
A Core Course on Modeling Week 2 – the Art of Omitting ACCEL: user defined functions 47 netherlands=[…, 'provinces':p, …] p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li] gr=['cap':'groningen', 'pop':582161,'area':2960.03] …. maxSpaciousness = #(i, vSeq(0,11), spaciousness(i), max) … but spaciousness is not a single quantity: depends on i, so takes different values during computation. Quantities that depend on other quantities:user defined functions. spaciousness(i) = p[i] . area / p[i] . pop Notice: i takes various values during the compuation; is not a quantity. Instead i is called a dummy.
A Core Course on Modeling Week 2 – the Art of Omitting ACCEL: user defined functions 48 netherlands=[…, 'provinces':p, …] p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li] gr=['cap':'groningen', 'pop':582161,'area':2960.03] …. maxSpaciousness=#(i,vSeq(0,11),spaciousness(i),max) spaciousness(i)=p[i].area/p[i].pop p=[Pgr,Pfr,Pdr,Pov,Pgl,Put,Pnh,Pzh,Pzl,Pnb,Pli] Pgr=['cap':'groningen','pop':582161,'area':2960.03] . . . Pli=['cap':'maastricht','pop':1121483,'area':2209.22] so the most spacious province offers 8900 m2/person ! … But which province is that?
A Core Course on Modeling Week 2 – the Art of Omitting ACCEL: user defined functions 49 netherlands=[…, 'provinces':p, …] p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li] gr=['cap':'groningen', 'pop':582161,'area':2960.03] …. As follows: maxSpaciousness=#(i,vSeq(0,11),spaciousness(i),max) spaciousness(i)=p[i] . area / p[i] . pop mostSpacious=#(i,vSeq(0,11),if(spaciousness(i)==maxSpaciousness,i,0),max) capitalOfMostSpacious=p[mostSpacious] . cap curious for result? Try yourself!
A Core Course on Modeling Week 2 – the Art of Omitting ACCEL: user defined functions 50 idea: expression that is evaluated more than once in a computation: user-defined functions • can be used whenever quantities are used • can have arbitrary arguments (one or more) • … with arbitrary names (no name clashes) • can return whatever you want, e.g. myFunc(a,b) = ['x':a,'y':b] p=myFunc(3,4) gives result p=['x':3,'y':4] p=myFunc(3,4)['x'] and myFunc(3,4).x both give result p=3 • use to organize your thinking • use to keep script readible • use to shorten script • use to keep formal and conceptual models similar