********************* loaddefs link d_Qndfs 'types atomic.ndf' - defines atomic data [typ, lay, basic test]s returns null if condition is true (not l!) Predefine local ops to avoid sequencing problems with initial qnial loaddefs ToDos +-----+ isTyp : 6 atomic types, individually or [L, LL, A] - returns OR[null (true), faultL] : focus is on basic structural types, [A, AA] for delving into first 2 levels of ary isTypBolL IS OP bolL - sequence of integers isTypBolLL IS OP bolLL - lst of bolL isTypBolA IS OP bolA - ary of integers (TOP level) isTypChrL IS OP chrL - str, different from isString QNial core optr (null if true) isTypChrLL IS OP chrLL - lst of str isTypChrLLL IS OP chrLLL - lst of strL isTypChrLA IS OP chrLA - ary of str isTypChrLLA IS OP chrLLA - ary of strL isTypChrLN IS OP chrLN - nry of str, inadequate!! - must use nry ops!! isTypFltL IS OP fltL - sequence of integers isTypFltLL IS OP fltLL - lst of fltL isTypFltA IS OP fltA - ary of integers (TOP level) isTypIntL IS OP intL - sequence of integers isTypIntLL IS OP intLL - lst of intL isTypIntA IS OP intA - ary of integers (TOP level only - ary of atms all ints) isTypIntLA IS OP intLA - ary of intL (TOP level only) isTypPhrL IS OP phrL - sequence of integers isTypPhrLL IS OP phrLL - lst of phrL isTypPhrA IS OP phrA - ary of integers (TOP level) isTypReaL IS OP reaL - sequence of integers isTypReaLL IS OP reaLL - lst of reaL isTypReaA IS OP reaA - ary of integers (TOP level) isTypVerBar IS OP itm - picture of ary yields transpose (3 1 reshape '+|+') +-----+ isLay[Atm, Ary, Itm, Slc, Sng, Sol, Sub, etc] - returns OR[null (true), faultL] : focus is on basic structural types, [A, AA] for delving into first 2 levels of ary isLayAry IS OP ary - ensure ary is compatible with address optrs ary : cannot use addresses with ary is[Null, Fault, Atm, Solitary, Single] isLayAryIdx IS OP ary idx - ensure idx is compatible with address optrs isLayAryIdxL IS OP ary idxL - test if idxL conforms to format of a full slice isIntLL(idxL) where idxL[axi] MUST be OR[full slice, [int]]! example idxL := (1 0 0) (1 0 1) (1 0 2) (1 0 3), result [1, 0, 0 1 2 3] isLayAryItm IS OP ary itm - ensure itm is compatible with address optrs, I can't think of any faults other than looking for null isLayAryPat IS OP ary pat - ensure pattern (sub) is compatible with address optrs pat has nulls for "don't care" itms, can fit subIrr (irregular) : non-rectangular sub want to regexpr capability in future I define patterns as "special" subs, so same tests apply isLayAryPL IS OP aryPairL - check if aryPairs of same valence??? isLayArySlc IS OP ary slc - ensure slc is compatible with ary isLayArySub IS OP ary sub - check [val, shp] compatible [ary, sub], doesn't check posnFit isLayAtm IS OP atm - res ipsa loquitor, seems that = [isLayAtmOlde, isLaySingle], now I use isLaySingle defn atoms (atmTop) may be of 6 types [bool, chr, int, real, phr, fault] (no more complex#) 03Jul2022 I retain BOTH [isLayAtm, isLaySingle] optrNames in case I find a difference between the two isLayAtmL IS OP atmL - null (true) if ALL itms of atmL are atomic isLayAtmA IS OP atmA - true if ALL itms of atmA are atomic (TOP level only) isLayLst IS OP lst - check if lst is a list isLayLstL IS OP lstL - true if ALL itms are lstA (lstL of lstA) isLayLstA IS OP lstA - null (true) if ALL itms of lstA are lists isLaySimple IS OP ary - tests TOP level of ary only, null if ary is simple isLaySimpleA IS OP simpleA - tests TOP level of simpleA only, null if ALL itms are simple arys isLaySingle IS OP single - true if single (array with shape Null holding an single) isLaySlc IS OP slc - ensure slc is correct format isLaySolitary IS OP sol - true if sol is a solitary (list of length one holding an sol) isLaySolitaryA IS OP solitaryA - true if ALL itms are solitary (TOP level only!) +-----+ ary_[atm, itm, sub]_in - returns OR[null, faultL] : 02Dec2021 missing slc ary_atm_in IS OP ary atm - whether atom is itm of ary (TOP level only) ary_atmA_anyIn IS OP ary atmA - boolean indication of whether any of atmATop are in strA ary_itm_in IS OP ary itm - whether item is in 1st-level of ary ary_itmA_anyIn IS OP ary itmA - boolean version whether any of atmATop are in ary because itmA_anyIn_ary does NOT use grep, it easily handles '$.*/[\]^' characters, ary_sub_in IS OP ary sub - may be better to use?: ary_sub_get_idxL (more general) returns OR[null (true), faultL] ary_subA_anyIn IS OP ary subA - returns null (true) if ANY of subA are in ary +-----+ tbl compatibility with [Dat, titLL, keyAxiTit, selAxiTitL, itmLL] : isLayTbl IS OP datTbl titLL - are [datTbl, titLL] compatible? tbl_keyAxiTit_selAxiTitL_fit IS OP tbl keyAxiTit selAxiTitL - generate slice that specifies idxA for each itm of sub the slice is for a larger ary, so slice idxs can be greater than allowed by sub +-----+ Special typOptrs ary_get_typPure IS OP ary - typ of homogeneous ary itms, returns OR(faultL, resFltL) all ary itms must have same typ!!! or end up with "ary +-----+ _chkAppOp : ary_[idx, itm, sub, slc] : check args, apply opPhr if fit often just does compatibility check, but can do more ary_idx_chkAppOp IS OP ary idx optrPhr - returns OR[op result, faultL] ary_idxL_chkAppOp IS OP ary idxL optrPhr - returns OR[op result, faultL] ary_idxA_chkAppOp IS OP ary idxA optrPhr - returns OR[op result, faultL] ary_itm_chkAppOp IS OP ary itm optrPhr - returns OR[op result, faultL] ary_slc_chkAppOp IS OP ary slc optrPhr - ary_sub_chkAppOp IS OP ary sub optrPhr - higher axes are added to sub so (= EACH valence sub ary) (i.e. same dimensionality) ary_sub_makeVlcSame_chkAppOp IS OP ary sub optrPhr - higher axes are added to sub so (= EACH valence sub ary) (i.e. same dimensionality)