Index: examples1.txt =================================================================== --- examples1.txt (revision 2797) +++ examples1.txt (revision 2798) @@ -5,7 +5,7 @@ # Assert that any two components are closer than 25 mm to each other rule sensitive RF elements - let e1 (@.p.type == type(element)) && (@.a.group == "RF") + let e1 (type(@, element)) && (@.a.group == "RF") let e2 e1 assert (distance(e1, e2) < 25 mm) @@ -16,7 +16,7 @@ # Assert that any two net lengths are matched within 2 mm rule matched length dram traces - let e1 (@.p.type == type(net)) && (@.a.group == "dram_data_0") + let e1 (type(@, net)) && (@.a.group == "dram_data_0") let e2 e1 assert abs(netlen(e1) - netlen(e2)) < 2 mm @@ -28,8 +28,8 @@ # rule isolation gap 1 - let hv (@.p.type == type(net)) && (@.a.high_voltage) - let lv (@.p.type == type(net)) && !(@.a.high_voltage) + let hv (type(@, net)) && (@.a.high_voltage) + let lv (type(@, net)) && !(@.a.high_voltage) assert !is_closer(lv, hv, 4 mm) # Example 4: check if isolation gap is maintained between any HV and LV nets @@ -48,7 +48,7 @@ # - if there was a valid (low voltage) cp object found, rule isolation gap 2 - let hv (@.p.type == type(net)) && (@.a.high_voltage) + let hv (type(@, net)) && (@.a.high_voltage) let hvo lobjs(hv) - let cp (@.p.type == type(copper)) + let cp (type(@, copper)) assert !is_closer(lcomplement(cp, hvo), hv, 4 mm) Index: proposal1.txt =================================================================== --- proposal1.txt (revision 2797) +++ proposal1.txt (revision 2798) @@ -22,7 +22,7 @@ P6 - the board P7 - a layer P8 - a board drawing primitive (line, arc, polygon, via, text) -P9 - an element primitive (element line, element arc, pin, pad, element name) +P9 - an element primitive (element line, element arc(?), pin, pad, element name) P10 - an element as a whole P11 - a net @@ -204,3 +204,14 @@ P59 netobjs(EXPR) Creates and returns a list of objects consists of a net. + +P60 type(EXPR, TYPENAME) + EXPR is an object. Returns the object if it's type matches TYPENAME, else + returns void (a.k.a. false). This call is useful to decide whether an + object is of a specific type. TYPENAME is one of: + - drawing primitive type: arc, line, polygon, text, via, element + - element primitive type: element_line, element_name, pin, pad + - misc type: layer, net + - meta-type, or a group: + - copper: primitive that results in copper (arc, line, polygon, text (on copper), via, pin, pad) + - drilled: anything that drills the board (via, pin)