Abc language enhancement

Description

Enhancing the language a*b*c

Source: The Art of Prolog

Download

Program source code: abc_language_enhancement.pl

Listing

        s(N) --> a(NA), b(NB), c(NC), {N is NA+NB+NC}.
 
        a(N) --> [a], a(N1), {N is N1+1}.
        a(0) --> [ ].
 
        b(N) --> [b], b(N1), {N is N1+1}.
        b(0) --> [ ].
 
        c(N) --> [c], c(N1), {N is N1+1}.
        c(0) --> [ ].
 
%     Program 19.1:  Enhancing the language a*b*c

Comments

pl/prolog/pllib/abc_language_enhancement.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