Examples of ForAll


Examples of com.sun.tools.javac.code.Type.ForAll

        /** Obtain a method type with given argument types.
         */
        Type newMethTemplate(List<Type> argtypes, List<Type> typeargtypes) {
            MethodType mt = new MethodType(argtypes, null, null, syms.methodClass);
            return (typeargtypes == null) ? mt : (Type)new ForAll(typeargtypes, mt);
        }
View Full Code Here

Examples of com.sun.tools.javac.code.Type.ForAll

        // If selected expression is polymorphic, strip
        // type parameters and remember in env.info.tvars, so that
        // they can be added later (in Attr.checkId and Infer.instantiateMethod).
        if (tree.selected.type.tag == FORALL) {
            ForAll pstype = (ForAll)tree.selected.type;
            env.info.tvars = pstype.tvars;
            site = tree.selected.type = pstype.qtype;
        }

        // Determine the symbol represented by the selection.
View Full Code Here

Examples of com.sun.tools.javac.code.Type.ForAll

                           sym.name != names._this && sym.name != names._super)
                    ? types.memberType(site, sym)
                    : sym.type;

                if (env.info.tvars.nonEmpty()) {
                    Type owntype1 = new ForAll(env.info.tvars, owntype);
                    for (List<Type> l = env.info.tvars; l.nonEmpty(); l = l.tail)
                        if (!owntype.contains(l.head)) {
                            log.error(tree.pos(), "undetermined.type", owntype1);
                            owntype1 = types.createErrorType(owntype1);
                        }
View Full Code Here

Examples of net.java.quickcheck.junit.ForAll

  private final ForAll annotation;

  public QuickCheckMethodRoadie(Object test, QuickCheckTestMethod method,
      RunNotifier notifier, Description description) {
    super(test, method, notifier, description);
    ForAll annotation = method.getMethod().getAnnotation(ForAll.class);
    this.annotation = annotation;
    generator = new RoundRobinGenerator<Object>(createGenerator(test,
        annotation));
    this.test = test;
    this.method = method;
View Full Code Here

Examples of net.java.quickcheck.junit.ForAll

  }

  private static void addTesters(TestSuite suite, Class<?> testClass,
      Method characteristicMethod) {

    ForAll annotation = characteristicMethod.getAnnotation(ForAll.class);
    Object testClassInstance = GeneratorFactory.newInstance(testClass);
    suite.addTest(new CharacteristicsTester(testClassInstance,
        new RoundRobinGenerator<Object>(createGenerator(
            testClassInstance, annotation)), characteristicMethod,
        annotation.runs(), annotation.verbose()));
  }
View Full Code Here

Examples of org.drools.core.rule.Forall

     * @inheritDoc
     */
    public void build(final BuildContext context,
                      final BuildUtils utils,
                      final RuleConditionElement rce) {
        final Forall forall = (Forall) rce;
        context.pushRuleComponent( forall );

        // forall can be translated into
        // not( basePattern and not( <remaining_patterns>+ ) )
        // so we just do that:

        final GroupElement and = GroupElementFactory.newAndInstance();
        and.addChild( forall.getBasePattern() );

        final GroupElement not2 = GroupElementFactory.newNotInstance();
        not2.setForallBaseObjectType( forall.getBasePattern().getObjectType() );
        if ( forall.getRemainingPatterns().size() == 1 ) {
            if ( forall.isEmptyBetaConstraints() ) {
                // The reason why this is here is because forall can inject a
                //  "this == " + BASE_IDENTIFIER $__forallBaseIdentifier
                // Which we don't want to actually count in the case of forall node linking               
                context.setEmptyForAllBetaConstraints( true );
            }
            not2.addChild( (Pattern) forall.getRemainingPatterns().get( 0 ) );
            and.addChild( not2 );
        } else if ( forall.getRemainingPatterns().size() > 1 ) {
            final GroupElement and2 = GroupElementFactory.newAndInstance();
            for ( final Iterator it = forall.getRemainingPatterns().iterator(); it.hasNext(); ) {
                and2.addChild( (Pattern) it.next() );
            }
            not2.addChild( and2 );
            and.addChild( not2 );
        }
View Full Code Here

Examples of org.drools.core.rule.Forall

        if ( basePattern == null ) {
            return null;
        }

        final Forall forall = new Forall( basePattern );

        // adding the newly created forall CE to the build stack
        // this is necessary in case of local declaration usage
        context.getBuildStack().push( forall );

        for ( final Iterator it = forallDescr.getRemainingPatterns().iterator(); it.hasNext(); ) {
            final Pattern anotherPattern = (Pattern) patternBuilder.build( context,
                                                                           (PatternDescr) it.next() );
            forall.addRemainingPattern( anotherPattern );
        }
       
       
        if ( forallDescr.getDescrs().size() == 1 ) {
            // An optimization for unlinking, where we allow unlinking if the resulting 'not' node has no constraints
            // we need to record this here, due to getRemainingPatterns injecting "this == " + BASE_IDENTIFIER $__forallBaseIdentifier
            // which we wish to ignore
            PatternDescr p = ( PatternDescr ) forallDescr.getDescrs().get( 0 );
            if ( p.getConstraint().getDescrs().isEmpty() ) {
                forall.setEmptyBetaConstraints( true );
            }
        }       

        // poping the forall
        context.getBuildStack().pop();
View Full Code Here

Examples of org.drools.rule.Forall

     * @inheritDoc
     */
    public void build(final BuildContext context,
                      final BuildUtils utils,
                      final RuleConditionElement rce) {
        final Forall forall = (Forall) rce;
        context.pushRuleComponent( forall );

        // forall can be translated into
        // not( basePattern and not( <remaining_patterns>+ ) )
        // so we just do that:

        final GroupElement and = GroupElementFactory.newAndInstance();
        and.addChild( forall.getBasePattern() );

        final GroupElement not2 = GroupElementFactory.newNotInstance();
        not2.setForallBaseObjectType( forall.getBasePattern().getObjectType() );
        if ( forall.getRemainingPatterns().size() == 1 ) {
            if ( forall.isEmptyBetaConstraints() ) {
                // The reason why this is here is because forall can inject a
                //  "this == " + BASE_IDENTIFIER $__forallBaseIdentifier
                // Which we don't want to actually count in the case of forall node linking               
                context.setEmptyForAllBetaConstraints( true );
            }
            not2.addChild( (Pattern) forall.getRemainingPatterns().get( 0 ) );
            and.addChild( not2 );
        } else if ( forall.getRemainingPatterns().size() > 1 ) {
            final GroupElement and2 = GroupElementFactory.newAndInstance();
            for ( final Iterator it = forall.getRemainingPatterns().iterator(); it.hasNext(); ) {
                and2.addChild( (Pattern) it.next() );
            }
            not2.addChild( and2 );
            and.addChild( not2 );
        }
View Full Code Here

Examples of org.drools.rule.Forall

        if ( basePattern == null ) {
            return null;
        }

        final Forall forall = new Forall( basePattern );

        // adding the newly created forall CE to the build stack
        // this is necessary in case of local declaration usage
        context.getBuildStack().push( forall );

        for ( final Iterator it = forallDescr.getRemainingPatterns().iterator(); it.hasNext(); ) {
            final Pattern anotherPattern = (Pattern) patternBuilder.build( context,
                                                                           (PatternDescr) it.next() );
            forall.addRemainingPattern( anotherPattern );
        }

        // poping the forall
        context.getBuildStack().pop();
View Full Code Here

Examples of org.drools.rule.Forall

     * @inheritDoc
     */
    public void build(final BuildContext context,
                      final BuildUtils utils,
                      final RuleConditionElement rce) {
        final Forall forall = (Forall) rce;

        // forall can be translated into
        // not( basePattern and not( <remaining_patterns>+ ) )
        // so we just do that:

        final GroupElement and = GroupElementFactory.newAndInstance();
        and.addChild( forall.getBasePattern() );

        final GroupElement not2 = GroupElementFactory.newNotInstance();
        if ( forall.getRemainingPatterns().size() == 1 ) {
            not2.addChild( (Pattern) forall.getRemainingPatterns().get( 0 ) );
            and.addChild( not2 );
        } else if ( forall.getRemainingPatterns().size() > 1 ) {
            final GroupElement and2 = GroupElementFactory.newAndInstance();
            for ( final Iterator it = forall.getRemainingPatterns().iterator(); it.hasNext(); ) {
                and2.addChild( (Pattern) it.next() );
            }
            not2.addChild( and2 );
            and.addChild( not2 );
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.