protected AApplyExp getApplyExp(PExp root, PType type, PExp... arglist) { AApplyExp exp = getApplyExp(root, arglist); exp.setType(type.clone()); return exp; }
private PExp generateBody(AExplicitFunctionDefinition postdef, List<PExp> params, PExp body) { // post(params, body) AApplyExp applyExp = new AApplyExp(); applyExp.setType(new ABooleanBasicType()); AVariableExp varExp = getVarExp(postdef.getName()); varExp.setType(postdef.getType().clone()); applyExp.setRoot(varExp); List<PExp> args = params; args.add(body.clone()); applyExp.setArgs(args); return applyExp; }
apply_exp.setType(actualResult.clone());
apply_exp.setType(actualResult.clone()); apply_exp.setArgs(args); return apply_exp;
private PExp generatePredicate(AExplicitFunctionDefinition predef, AExplicitFunctionDefinition postdef, List<PExp> params, PExp body) { if (predef != null) { // pre(params) => AApplyExp applyExp = new AApplyExp(); applyExp.setType(new ABooleanBasicType()); applyExp.setArgs(cloneListPExp(params)); AVariableExp varExp = getVarExp(predef.getName().clone()); varExp.setType(predef.getType().clone()); applyExp.setRoot(varExp); return AstExpressionFactory.newAImpliesBooleanBinaryExp(applyExp, generateBody(postdef, params, body)); } return generateBody(postdef, params, body); }
node.setType(node.getRoot().apply(THIS, new TypeCheckInfo(question.assistantFactory, question.env, question.scope, node.getArgtypes()))); node.setType(results.getType(node.getLocation())); return question.assistantFactory.createPTypeAssistant().possibleConstraint(question.constraint, node.getType(), node.getLocation());