Category : Miscellaneous Language Source Code
Archive   : PROLOG19.ZIP
Filename : BICYCLE.PRO
are given (basicpart). Then a description of various subassemblies.
Ask: ?-partsof( hub, P ). to get all the basic parts required to make a hub.
Ask: ?-partsof( bike, P ). for the whole bike. */
basicpart( rim ).
basicpart( rearframe ).
basicpart( gears ).
basicpart( nut ).
basicpart( spoke ).
basicpart( handles ).
basicpart( bolt ).
basicpart( fork ).
assembly( bike, [quant( wheel, 2 ), quant( frame, 1 )] ).
assembly( wheel, [quant( spoke, 20 ), quant( rim, 1 ), quant( hub, 1)] ).
assembly( frame, [quant( rearframe, 1), quant( frontframe, 1 ) ] ).
assembly( frontframe, [quant( fork, 1 ), quant( handles, 1 )] ).
assembly( hub, [quant( gears, 1 ), quant( axle, 1 ) ] ).
assembly( axle, [quant( bolt, 1 ), quant( nut, 2) ] ).
partsof( X, [X] ) :- basicpart( X ).
partsof( X, P ) :- assembly( X, Subparts ),
partsoflist( Subparts, P ).
partsoflist( [], [] ).
partsoflist( [quant( X,N ) | Tail ], Total ) :-
partsof( X, Headparts ),
partsoflist( Tail, Tailparts ),
append( Headparts, Tailparts, Total ).
append( [], L, L ).
append( [X|L1], L2, [X|L3] ) :- append( L1, L2, L3 ).
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/