fun BagToSet(b: Value): Value? { val fcn: FcnRcdValue = FcnRcdValue.convert(b) ?: throw EvalException( EC.TLC_MODULE_APPLYING_TO_WRONG_VALUE, arrayOf("BagToSet", "a function with a finite domain", Value.ppr(b.toString())) ) return fcn.getDomain() }
// For now , we do not override SubBag . So , We are using the TLA+ definition . public static Value SubBag ( Value b ) { FcnRcdValue fcn = FcnRcdValue.convert ( b ) ; if ( fcn == null ) { String msg = `` Applying SubBag to the following value , which is\n '' + `` not a function with a finite domain : \n '' + Value.ppr ( b.toString ( ) ) ; throw new EvalException ( msg ) ; } throw new EvalException ( `` SubBag is not implemented . `` ) ; }