SCP 4 you: brief Comments to Demo-Examples


For a lot of other examples , please see a SCP4 User's Guide (in Russian).


Draft

Contents:

Please, pay your attention that the supercompiler can looping forever (by definition) under a combination of keys to run. Default keys are such combination.
There are a number of reasons for that.  In the archive (to be downloaded) version of the documentation we give a number of such examples.

It is not a good idea to see this Web-page in a small window. The MST-schemes can be shown incorrectly in such window. 


Bottom The online demonstration

Example #1 (Fab):

<Scp4  .......  >
       <Fab e.1>  ;

Example #2 (Fabc):

<Scp4 ............................. >
       <Fcd <Fbc <Fab 'aebfc' e.1>>>  ;

Top Bottom The online demonstration

Example #3 (Sq):

<Scp4 .................>
       <Arith Sq(e.1)>   ;

Example #4 (Power):

<Scp4 .................. >
       <Arith Power(e.1)>   ;

Example #5 (Fact):

<Scp4 .................. >
       <Arith Fact(e.1)>   ;

Top Bottom The online demonstration

Example #6 (Cl_AN):

<Scp4 ..........>
       <F e.1>    ;

Example #7 (Cl_AK) by  Andrei V. Klimov :

<Scp4 ..........>
       <F e.1>    ;

Example #8 (Permsp) by Alexandr Korljukov:

<Scp4    .. .........................    >
        <Perm ( ( s.a s.b ) ('45') ) e.1 >  ;

Top Bottom The online demonstration

Example #9 (Permcm) by Alexandr Korljukov:

<Scp4 ............................................................................ >
           <Perm (('12345')('67890')) <Perm (('123')) <Perm (('12')('45')) e.1>>>      ;

Example #10 (Sum2a) by Alexandr Korljukov:

<Scp4 ................... >
       <Sum2 ( e.1 ) '1' >  ;

Top Bottom The online demonstration

Example #11 (Sum2b) by Alexandr Korljukov:

<Scp4 ..................... >
         <Sum2 ( '1' ) e.2 >  ;

Example #12 (Bashe)  by Alexandr Korljukov:

<Scp4 ..................... >
       <Bashe ( '1' ) e.1 >   ;

Top Bottom The online demonstration

Example #13 (Equal):

<Scp4 ............................................................................. >
           <Equal ('a' t.1 'b') ('a' t.1 'b')> <Equal ('ac' t.3 'b') ('ab' t.2 'c')>   ;

Example #14 (F8_i2a) by Alexandr Korljukov:

<Scp4 ...................................................... >
         <F8_Int Add ( '1011' ) ( s.1 s.2 s.3 ) s.4 s.5 s.6 >   ;

Example #15 (F8_i2m) by Alexandr Korljukov:

<Scp4 ...................................................... >
         <F8_Int Mul ( '1011') ( s.1 s.2 s.3 ) s.4 s.5 s.6 >   ;

Top Bottom The online demonstration

Example #16 (F8_i2i) by Alexandr Korljukov:

<Scp4 ....................................... >
           <F8_Int Inv ( '1011' ) s.1 s.2 s.3 >   ;

Example #17 (Tur_br) by Alexandr Korljukov.  Here the MST-scheme is not full correct. The second level must be just on a single line. Our next version the MST-schemes language allows to write large MST-schemes in some convenient fashion, the available version does not.

<Scp4 .................................................................................. >
  <TUR 'a' ( e.1 )  ('a**>b') ('bLL>b') ('bRR>b') ('b((>b') ('b* <d') ('b)R<c')
('cLL<c') ('cRR<c') ('c(L>b') ('c*0>z')
                           ('dL(<d') ('dR)<d') ('d(0>z') ('d*1>z')                      >   ;

Example #18 (Tur_rv)  by Alexandr Korljukov. Here the MST-scheme is not full correct. The second level must be just on  a single line. Our next version the MST-schemes language allows to write large MST-schemes in some convenient fashion, the available version does not.

<Scp4 ............................................................ >
 <TUR 'a' ( e.1 ) ('a11>a') ('a22>a') ('a 5<b') ('a$$>a')
                         ('b12<b') ('b21<b') ('b 6>z') ('b$0<b') >    ;

Top Bottom The online demonstration

Example #19 (Div3) by Alexandr Korljukov:

<Scp4 ....................... >
         <Divide 3 (e.number)>   ;

Example #20 (Div11) by Alexandr Korljukov:

<Scp4 ....................... >
         <Divide 11 (e.number)>   ;

Top Bottom The online demonstration

Example #21 (Div37) by Alexandr Korljukov:

<Scp4 ....................... >
         <Divide 37 (e.number)>   ;

Top Bottom The online demonstration

Example #22 (Div10) by Alexandr Korljukov:

<Scp4 ....................... >
         <Divide 10 (e.number)>   ;

Example #23 (Div125) by Alexandr Korljukov:

<Scp4 ........................ >
         <Divide 125 (e.number)>   ;

Example #24 (Div18) by Alexandr Korljukov:

<Scp4 ....................... >
         <Divide 18 (e.number)>   ;

Top Bottom The online demonstration

Example #25 (Div999) by Alexandr Korljukov:

<Scp4 ........................ >
         <Divide 999 (e.number)>   ;

Top Bottom The online demonstration

Example #26 (RegeKK) by Arkadij Klimov and  Alexandr Korljukov:

<Scp4 .............................................................. >
          <Allows (ALT (CAT 'Korlukov') (ITER (CAT 'Klimov'))) e.expr>   ;

Example #27 (RegeAB) by Arkadij Klimov and  Alexandr Korljukov:

<Scp4 .................................................... >
          <Allows (ITER (CAT (ITER 'A') (ITER 'B'))) e.expr>   ;

Example #28 (Rege12) by Arkadij Klimov and  Alexandr Korljukov:

<Scp4 ............................................................... >
          <Allows (ITER (ITER 'A') (ALT '1' '2') (ITER 'B')) e.expr>     ;

Example #29 (RegABi) by Arkadij Klimov and  Alexandr Korljukov:

<Scp4 ........................................ >
          <Allows (ITER (ITER 'A') 'B') e.expr>     ;

Example #30 (RegAB2)  by Arkadij Klimov and  Alexandr Korljukov:

<Scp4 ................................................ >
          <Allows (ITER (ITER 'AB') (ITER 'AB')) e.expr>     ;

Top Bottom The online demonstration

Example #31 (Formi) by Alexandr Korljukov:

<Scp4 ............................................ >
          <FPInt Inv ((eb) (ea)) (( 1 )( 0 )( 1 )) >   ;

Example #32 (Formc) by Alexandr Korljukov:

<Scp4 ........................................................... >
          <FPInt s.Oper ((e1) (e2)) ((ea) (eb)) (( 1 )( 0 )( 1 )) >   ;

Example #33 (Form2) by Alexandr Korljukov:

<Scp4 ............................................................... >
          <FPInt s.Oper ((e1) (e2)) ((ea) (eb)) (( 1 )( 0 )( '-' 2 )) >   ;

Top Bottom The online demonstration

Example #34  (Open):

<Scp4 .....................................>
        <OpenDemo ('12345' (e.1) '678') e.3>   ;

<Scp4 .............................. >
        <OpenDemo ('12345a678') e.3>   ;

 

<Scp4 ........................... >
        <OpenDemo (e.1) 'c' e.3>   ;

Example #35 (Search)  by Alexandr Korljukov:

<Scp4 ..................................  >
          <Search ('abcabcacab') e.string>  ;

Top The online demonstration

 

nemytykh@math.botik.ru