]> matita.cs.unibo.it Git - helm.git/commitdiff
Added step machine for universal machine.
authorWilmer Ricciotti <ricciott@cs.unibo.it>
Thu, 17 May 2012 14:12:45 +0000 (14:12 +0000)
committerWilmer Ricciotti <ricciott@cs.unibo.it>
Thu, 17 May 2012 14:12:45 +0000 (14:12 +0000)
matita/matita/lib/turing/universal/uni_step.ma [new file with mode: 0644]

diff --git a/matita/matita/lib/turing/universal/uni_step.ma b/matita/matita/lib/turing/universal/uni_step.ma
new file mode 100644 (file)
index 0000000..6ba1aa2
--- /dev/null
@@ -0,0 +1,55 @@
+(*
+    ||M||  This file is part of HELM, an Hypertextual, Electronic   
+    ||A||  Library of Mathematics, developed at the Computer Science 
+    ||T||  Department of the University of Bologna, Italy.           
+    ||I||                                                            
+    ||T||  
+    ||A||  
+    \   /  This file is distributed under the terms of the       
+     \ /   GNU General Public License Version 2   
+      V_____________________________________________________________*)
+
+
+(* COMPARE BIT
+
+*)
+
+include "turing/universal/copy.ma".
+
+(*
+
+step :
+
+if is_true(current) (* current state is final *)
+   then nop
+   else 
+   (* init_match *)
+   mark;
+   adv_to_grid_r;
+   move_r;
+   mark;
+   move_l;
+   adv_to_mark_l
+   (* /init_match *)
+   match_tuple;
+   if is_marked(current) = false (* match ok *)
+      then 
+           (* init_copy *)
+           move_l;
+           init_current;
+           move_r;
+           adv_to_mark_r;
+           adv_mark_r;
+           (* /init_copy *)
+           copy;
+           move_r;
+           (* move_tape *)
+           by cases on current: 
+             case bit false: move_tape_l
+             case bit true: move_tape_r
+             case null: adv_to_grid_l; move_l; adv_to_grid_l;
+           move_r;
+           (* /move_tape *)
+      else sink;
+        
+*)
\ No newline at end of file