lojix/prolog/src/main/com/thesett/aima/logic/fol/prolog/builtins/Call.java
public boolean proofStep(ResolutionState state)
    {
        Functor goalTerm = state.getGoalStack().poll().getFunctor();
        Term argument = goalTerm.getArgument(0).getValue();

        // Check that the argument is not a free variable.
        if (argument.isVar())
        {
            throw new IllegalStateException(
                "instantiation_error, 'call' expects a fully instantiated term to unify against.");
        }

        // Check that the argument is callable.
        if (!argument.isFunctor() && !argument.isAtom())
        {
            throw new IllegalStateException("type_error, callable expected as argument to 'call'.");
        }

        // Set up the argument to call as a new goal.
        state.getGoalStack().offer(state.getBuiltInTransform().apply((Functor) argument));

        return true;
    }
public boolean proofStep(ResolutionState state)
    {
        Functor goalTerm = state.getGoalStack().poll().getFunctor();
        Term argument = goalTerm.getArgument(0).getValue();

        // Check that the argument is not a free variable.
        if (argument.isVar())
        {
            throw new IllegalStateException(
                "instantiation_error, 'call' expects a fully instantiated term to unify against.");
        }

        // Check that the argument is callable.
        if (!argument.isFunctor() && !argument.isAtom())
        {
            throw new IllegalStateException("type_error, callable expected as argument to 'call'.");
        }

        // Set up the argument to call as a new goal.
        state.getGoalStack().offer(state.getBuiltInTransform().apply((Functor) argument));

        return true;
    }
public boolean proofStep ( ResolutionState state ) { Functor goalTerm = state . getGoalStack ( ) . poll ( ) . getFunctor ( ) ; Term argument = goalTerm . getArgument ( 0 ) . getValue ( ) ; // Check that the argument is not a free variable. if ( argument . isVar ( ) ) { throw new IllegalStateException ( "instantiation_error, 'call' expects a fully instantiated term to unify against." ) ; } // Check that the argument is callable. if ( ! argument . isFunctor ( ) && ! argument . isAtom ( ) ) { throw new IllegalStateException ( "type_error, callable expected as argument to 'call'." ) ; } // Set up the argument to call as a new goal. state . getGoalStack ( ) . offer ( state . getBuiltInTransform ( ) . apply ( ( Functor ) argument ) ) ; return true ; }
{@inheritDoc}
{