public static AMapMapType newAMapMapType(ILexLocation location, PType from, PType to) { AMapMapType result = new AMapMapType(); initType(result, location); result.setFrom(from); result.setTo(to); result.setEmpty(false); return result; }
public static AMapMapType newAMapMapType(ILexLocation location) { AMapMapType result = new AMapMapType(); initType(result, location); result.setFrom(AstFactory.newAUnknownType(location)); result.setTo(AstFactory.newAUnknownType(location)); result.setEmpty(true); return result; }
public FiniteMapObligation(AMapCompMapExp exp, PType mapType, IPOContextStack ctxt, IPogAssistantFactory af) throws AnalysisException { super(exp, POType.FINITE_MAP, ctxt, exp.getLocation(), af); ILexNameToken finmap = getUnique("finmap"); ILexNameToken findex = getUnique("findex"); // eg. { a |-> b | a:A, b:B & p(a,b) }, gives... // // exists m:map nat to map A to B & // forall a:A, b:B & // p(a,b) => exists idx in set dom m & // m(idx) = { a |-> b } AExistsExp existsExp = new AExistsExp(); AMapMapType natmaptype = new AMapMapType(); natmaptype.setFrom(new ANatNumericBasicType()); natmaptype.setTo(mapType.clone()); existsExp.setBindList(getMultipleTypeBindList(natmaptype, finmap)); existsExp.setPredicate(getForallExp(exp.clone(), finmap, findex)); stitch = existsExp.clone(); valuetree.setPredicate(ctxt.getPredWithContext(existsExp)); }
mapType.setFrom(new ANatNumericBasicType()); mapType.setTo(settype.getSetof().clone());