lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/machine/WAMEngine.java
public void reset()
    {
        // Reset the resolver to completely clear out its domain.
        resolver.reset();

        // Create a token source to load the model rules from.
        Source<Token> tokenSource =
            TokenSource.getTokenSourceForInputStream(WAMEngine.class.getClassLoader().getResourceAsStream(
                    BUILT_IN_LIB));

        // Set up a parser on the token source.
        Parser<Clause, Token> libParser = new SentenceParser(interner);
        libParser.setTokenSource(tokenSource);

        // Load the built-ins into the domain.
        try
        {
            while (true)
            {
                Sentence<Clause> sentence = libParser.parse();

                if (sentence == null)
                {
                    break;
                }

                compiler.compile(sentence);
            }

            compiler.endScope();
        }
        catch (SourceCodeException e)
        {
            // There should not be any errors in the built in library, if there are then the prolog engine just
            // isn't going to work, so report this as a bug.
            throw new IllegalStateException("Got an exception whilst loading the built-in library.", e);
        }
    }
public void reset()
    {
        // Reset the resolver to completely clear out its domain.
        resolver.reset();

        // Create a token source to load the model rules from.
        Source<Token> tokenSource =
            TokenSource.getTokenSourceForInputStream(WAMEngine.class.getClassLoader().getResourceAsStream(
                    BUILT_IN_LIB));

        // Set up a parser on the token source.
        Parser<Clause, Token> libParser = new SentenceParser(interner);
        libParser.setTokenSource(tokenSource);

        // Load the built-ins into the domain.
        try
        {
            while (true)
            {
                Sentence<Clause> sentence = libParser.parse();

                if (sentence == null)
                {
                    break;
                }

                compiler.compile(sentence);
            }

            compiler.endScope();
        }
        catch (SourceCodeException e)
        {
            // There should not be any errors in the built in library, if there are then the prolog engine just
            // isn't going to work, so report this as a bug.
            throw new IllegalStateException("Got an exception whilst loading the built-in library.", e);
        }
    }
public void reset ( ) { // Reset the resolver to completely clear out its domain. resolver . reset ( ) ; // Create a token source to load the model rules from. Source < Token > tokenSource = TokenSource . getTokenSourceForInputStream ( WAMEngine . class . getClassLoader ( ) . getResourceAsStream ( BUILT_IN_LIB ) ) ; // Set up a parser on the token source. Parser < Clause , Token > libParser = new SentenceParser ( interner ) ; libParser . setTokenSource ( tokenSource ) ; // Load the built-ins into the domain. try { while ( true ) { Sentence < Clause > sentence = libParser . parse ( ) ; if ( sentence == null ) { break ; } compiler . compile ( sentence ) ; } compiler . endScope ( ) ; } catch ( SourceCodeException e ) { // There should not be any errors in the built in library, if there are then the prolog engine just // isn't going to work, so report this as a bug. throw new IllegalStateException ( "Got an exception whilst loading the built-in library." , e ) ; } }
{@inheritDoc}

<p/>Loads the built-in library resource specified by {@link #BUILT_IN_LIB}.
{ @inheritDoc }