Npda

Description

Specializing an NPDA

Source: The Art of Prolog

Download

Program source code: npda.pl

Listing

    program(npda,[(accept(Xs1) :-  initial(Q1), accept(Xs1,Q1,[ ])),
 
        (accept([_],Q2,S2) :-  delta(Q2,_,S2,Q12,S12),
 
        accept(_,Q12,S12)), (accept([ ],_,[ ]) :-  true)]).
 
 
 
    should_unfold(initial(_)).
 
    should_unfold(final(_)).
 
    should_unfold(delta(_,_,_,_,_)).
 
 
 
    should_fold(accept(Q,Xs,Q1),palindrome(Q,Xs,Q1)).
 
    should_fold(accept(Xs),palindrome(Xs)).
 
 
 
%    Program 18.4: Specializing an 
 
PDA

Comments

pl/prolog/pllib/npda.txt · ostatnio zmienione: 2017/07/17 08:08 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0