/** * Returns a deep clone of this {@link AMapMapType} node. * @return a deep clone of this {@link AMapMapType} node */ public AMapMapType clone() { return new AMapMapType( _location, _resolved, _definitions, _from, _to, _empty ); }
/** * Creates a deep clone of this {@link AMapMapType} node while putting all * old node-new node relations in the map {@code oldToNewMap}. * @param oldToNewMap the map filled with the old node-new node relation * @return a deep clone of this {@link AMapMapType} node */ public AMapMapType clone(Map<INode,INode> oldToNewMap) { AMapMapType node = new AMapMapType( _location, _resolved, _definitions, _from, _to, _empty ); oldToNewMap.put(this, node); return node; }
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)); }
AMapMapType mapType = new AMapMapType(); mapType.setFrom(new ANatNumericBasicType()); mapType.setTo(settype.getSetof().clone());