Literate Prolog 
Author Message
 Literate Prolog

Here is a shar file for my version of Literate Prolog.  This works
with{*filter*}and any brand of Prolog.  We at Xilinx have been using it
with Quintus Prolog to build a commercial product (X-BLOX).

We use{*filter*}rather than TeX, because the section, table, figure, etc
macros have already been written and documented and debugged.  We did
not use Web, because (1) the formating commands are cryptic and Prolog
doesn't need the code reordering that Pascal and C do.

This Literate Prolog package allows the coder to write a .tex file
containing \begin{prolog} ... \end{prolog} sections which are the
actual code.  These sections are typeset in the Courier font so they
are distinguishable from the surrounding text.  \begin{prologdisplay}
... \end{prologdisplay} is like the verbatim environment, except that
the text is typeset in Courier Italic so that that text can be easily
identified as being Prolog code, but not executable Prolog nor just
text.  Smaller sections of text can be typeset as Prolog-like with the
{\pl ...} environment (no Prolog code is generated from this) and with
the {\pli ...} environment (Prolog italic).

If there's any interest, I'll post the emacs macros for adding section
and index entries.


\\ `   Xilinx                                   FAX: (408)559-7114
//     2100 Logic Drive
\\/.\  San Jose, California 95124

---- Cut Here and unpack ----
#!/bin/sh
# shar: Shell Archiver  (v1.22)
#
#       Run the following text with /bin/sh to create:
#         latex2pl.tar.Z
#
sed 's/^X//' << 'SHAR_EOF' > s2_temp_.tmp &&
Xbegin 600 latex2pl.tar.Z







XM8:L51D<8IG%7U5<<=NBAAPHH($023A"1A!0]O+"?'"^<U2!"8A2F`!5%8,%$





XMN;7>.H6Z+;P1[K&'>CMN?&PDJ\`8$(7A1I9NOA"C&R_(T49\<LBFPI9?+DQ'
XMDB`XK&#$=):YL+P+DZL`A1?F"ZZ]A\)1UEEGN#`''7FXR7&0A[;P7[;?FCMB
XMB2?V`:FXR2:PLL<BFX66R2BO2Z.-..I8\PL]DPQTRCJ3U_&A%XHAG1QBA-?&


XM"B!4,82M(!`A4!C/E3%&'1&&GAH>G']$16?SY?O&'86E-02V`=81QAF>B5Q&






XM#,H!(JM9`G[<4`;L'&$N02(.%!Q3AC6P0(1!R!<2H5/!/XX'.Z`90P9)$SJJ


XM#68IP_O`684B2%!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\&Y%0E]`;P!!LN.TO:*OO^#R^35HC
XM_]I%7E+]6Z+<O_EOZL7_2AY,V=#!"QN/`S`3;`![2:.7`MS!\6<-L(T&`8,/




XM-<*$A_P;"6NX5G.0)UQ8PBT1)MP'5YR;,"'<";.NG_#:O$..R%LO*1SVF<+V


XMY/#<TS2?P\Z6.JP.L\-"<\I&/B#-$Y)QN#1WS1XPTVP.$R;;9?;I#Y<!V>:V
XM*1"?FP3Q5YP=DY(F\G#,?6Z]A7$YY!#;Q_)F3]D;R<9:9KZY;V[%1276628K
XM!A^QJ1D2)[DC,4/:<*K!$*=U+'&J#A3G#JD28YPM,:CX$G^<CJIW'!:#Q^BQ
XM>/QUJIQG)WR<'K_':S%."1H3Q5CQ:FP8)\5`YU(\=#K%1J?].14/T)=Q4;P;
XM4YW<LV>)=7K%XF;]#&]^QW.GHED67YG8L]EY'L></?'<O![GQ.TQFRD7Q\=V
XMIUU<'^/%WK)>+",+GGXQDZD^#\;F<V'L>"+0D6?P>2$PQJNQ8VS?P!/:963<
XM>4[&Y;%E;!77JKGQY9EZSLR?<6L<"OG080#M61H+!*<QVVD5J\:<<1-=&P^?
XM\O$..177QM`D%,T:EYY(]&P<:?+&\4'UN3R;75;#LXD0$\(ILF&)6"K'+S+Y

XMQ6(Q"<U"A\]YY`M]'[.>X>?)L!_?6/UQO_4?CY_VLH"<,!/(NZ^!?*.(280P

XM6PTE\AR]]=;1+F5RW"(OQS!R:>E'T\A6)[QY(U>\VS$GS",'NL*SODL/#<D.

X:983)2A>3^3W;N&BRJ3D0V,D$=4%M4!_4W1<5
X`
Xend
SHAR_EOF
uudecode < s2_temp_.tmp && rm -f s2_temp_.tmp &&
chmod 0644 latex2pl.tar.Z || echo "restore of latex2pl.tar.Z fails"
exit 0
--

\\ `   Xilinx                                   FAX: (408)559-7114
//     2100 Logic Drive
\\/.\  San Jose, California 95124



Mon, 14 Aug 1995 04:48:03 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Literate Prolog

2. Q: Literate Prolog?

3. Literate Prolog

4. Literate Forth (was Literate Project)

5. APLWEB and Literate Programming in APL

6. Literate programming

7. US-MA:Cambridge:Smalltalk literate QA people needed

8. Would Eiffel benefit from literate programming?

9. Literate Programming in Forth

10. Literate Programming in Forth

11. literate computers

12. literate programming and functional languages

 

 
Powered by phpBB® Forum Software