-=-=-=-=-=-=-=-=-=-=-=-= Older notes -=-=-=-=-=-=-=-=-=-=

Am reusit echivalenta intre urmatoarele programe
(prove9symbolic.minfun):

((fix f (lambda x . (lambda y . fif (x f== 0) fthen
                                  y
                                felse
				  (let nx = x f- 1 in
				   (let ny = y f+ x in
                                    (L2FExp mylabel : ((f nx) ny)))))))
                                     #symInt(ni)) #symInt(se)

si (sum9symbolic.minimp):

skip ~> ( while i i< n do (
       ( s := s i+ i ;
         i := i i+ 1 ) ;
       L1Stmt mylabel : skip
))

cu configuratia (sum9symbolic.cfg)

i |-> #symInt(i)
n |-> #symInt(n)
s |-> #symInt(s)


Folosind egalitatile:

0 <= i <= n
ni = n - i
se * 2 = (n + ni + 1) * i  -- suma ultimelor i numere pana la n
s * 2 = i * (i - 1)         -- suma primelor i - 1 numere

Liniile de comanda:

kompile runechiv --kcells "k1 k2" --symbolic

si

krun --search sum9symbolic.minimp -cCFG "`cat sum9symbolic.cfg`" -cPGM2 "`cat prove9symbolic.minfun`" -cPC "(0 <=Int #symInt(i)) andBool (#symInt(i) <=Int #symInt(n)) andBool (#symInt(ni) ==Int #symInt(n) -Int #symInt(i)) andBool (2 *Int #symInt(s) ==Int (#symInt(i) *Int (#symInt(i) -Int 1))) andBool (((2 *Int #symInt(se)) ==Int ((#symInt(n) +Int #symInt(ni) +Int 1) *Int #symInt(i))))" --parser "kast -groundParser" --compiled-def ./runechiv-kompiled/

Demonstreaza circularitatea in cauza.






      rule <k1>
                LFExp Label:Id : (((fix F:Id (lambda X:Id .
(lambda Y:Id . (fif (X f== 0) fthen Y felse 
		   (let NIName:Id = X f- 1 in
		    (let SEName:Id = Y f+ X in
		  (LFExp Label :
                        ((F NIName) SEName)))))))) NI:Int)
                         SE:Int) => .K
           </k1>
<t2> <k2> LStmt Label:Id : skip ~> (while (IName:Id i< NName:Id) do (((SName:Id := (SName i+ IName))
                  ; (IName := (IName i+ 1))) ; (LStmt Label : skip))) => .K
           </k2>
      	   <env2>... 
      	   	     (IName |-> I:Int)
		     (NName |-> N:Int)
      	             (SName |-> S:Int)
           ...</env2>
      	   </t2>
	   when
                         (NI ==Int (N -Int I))
			 andBool ((2 *Int SE) ==Int ((N +Int NI +Int 1) *Int I))
			 andBool ((2 *Int S) ==Int (I *Int (I -Int 1)))
