A sample of writing a loop in Action Semantic codes

int i = 0;
for(; i<10; ++i)
{ do something; }
 
   allocate a cell  -- 这里没有类型化的内存分配
then
   bind i to the given Cell
then
   give the Cell bound to i
then
   store the value of 0 in the given Cell -- 注意这里0是字符值
then
   unfolding
      give the Integer bound to i
        and then give(the given Integer is less than the value of 10)
           then
                check(the given TruthValue is true)
                   and then execute do something
                      and then give the Integer bound to i
                         and then give sum(the value of 1, the given Integer)
                            and then store the given Integer in the Cell bound to i
                              and then unfold
            or
                check(the given TrueValue is false) and then complete

and then, and, then, or的语义示意图: 

   

posted on 2004-11-07 02:22  阿飞外传  阅读(642)  评论(0编辑  收藏  举报

导航