Skip to main content
. 2017 Jul 3;12(7):e0180179. doi: 10.1371/journal.pone.0180179

Table 2. Definitions of Zsyntax formalization.

Name Formalized Form Description
Elimination of Z-Conjunction Rule ⊢ ∀ l x. zsyn_conjun_elimin l x =
  if MEM x l then [x] else l
  • MEM x l: True if x is a member of list l

Introduction of Z-Conjunction and Z-Interaction ⊢ ∀ l x y. zsyn_conjun_intro l x y =
   CONS (FLAT [EL x l; EL y l]) l
  • FLAT l: Flatten a list of lists l to a single list

  • EL y l: yth element of list l

  • CONS: Adds a new element to the top of the list

Reactants Deletion ⊢ ∀ l x y. zsyn_delet l x y = if x > y
  then delet (delet l x) y
  else delet (delet l y) x
  • delet l x: Deletes the element at index x of the list l

Element Deletion ⊢ ∀ l. delet l 0 = TL l ∧
  ∀ l y. delet l (y + 1) =
    CONS (HD l) ( delet (TL l) y)
  • HD l: Head element of list l

  • TL l: Tail of list l

EVF Matching ⊢ ∀ l e x y. zsyn_EVF l e 0 x y =
   if FST (EL 0 e) = HD l
   then (T,zsyn_delet (APPEND (TL l) (SND (EL 0 e))) x y)
   else (F,TL l) ∧
    ∀ l e p x y. zsyn_EVF l e (p + 1) x y =
   if FST (EL (p + 1) e) = HD l
   then (T,zsyn_delet (APPEND (TL l) (SND (EL (SUC p) e))) x y)
   else zsyn_EVF l e p x y
  • FST: First component of a pair

  • SND: Second component of a pair

  • APPEND: Merges two lists

  • zsyn_delet: Reactants deletion

Recursive Function to model the argument y in function zsyn_EVF ⊢ ∀ l e x. zsyn_recurs1 l e x 0 =
   zsyn_EVF (zsyn_conjun_intro l x 0) e (LENGTH e - 1) x 0 ∧
   ∀ l e x y.
   zsyn_recurs1 l e x (y + 1) =
if FST (zsyn_EVF (zsyn_conjun_intro l x (y + 1))
     e (LENGTH e - 1) x (y + 1)) ⇔ T
  then zsyn_EVF (zsyn_conjun_intro l x (y + 1))
     e (LENGTH e - 1) x (y + 1)
  else zsyn_recurs1 l e x y
  • LENGTH e: Length of list e

  • zsyn_EVF: EVF Matching

  • zsyn_conjun_intro: Introduction of Z-Conjunction and Z-Interaction

Recursive Function to model the argument x in function zsyn_EVF ⊢ ∀ l e y. zsyn_recurs2 l e 0 y =
  if FST (zsyn_recurs1 l e 0 y) ⇔ T
   then (T,SND (zsyn_recurs1 l e 0 y))
   else (F,SND (zsyn_recurs1 l e 0 y)) ∧
   ∀ l e x y. zsyn_recurs2 l e (x + 1) y =
  if FST (zsyn_recurs1 l e (x + 1) y) ⇔ T
   then (T,SND (zsyn_recurs1 l e (x + 1) y))
   else zsyn_recurs2 l e x (LENGTH l - 1)
  • zsyn_recurs1: Recursive function to model the augment y in zsyn_EVF

Final Recursion Function for Zsyntax ⊢ ∀ l e x y. zsyn_deduct_recurs l e x y 0 = (T,l) ∧
   ∀ l e x y q. zsyn_deduct_recurs l e x y (q + 1) =
   if FST (zsyn_recurs2 l e x y) ⇔ T
   then zsyn_deduct_recurs (SND (zsyn_recurs2 l e x y)) e
    (LENGTH (SND (zsyn_recurs2 l e x y))—1)
    (LENGTH (SND (zsyn_recurs2 l e x y))—1) q
   else (T,SND (zsyn_recurs2 l e (LENGTH l - 1)
    (LENGTH l- 1)))
  • zsyn_recurs2: Recursive function to model the augment x in zsyn_EVF

Final Deduction Function for Zsyntax ⊢ ∀ l e. zsyn_deduct l e =
SND (zsyn_deduct_recurs l e (LENGTH l- 1)
    (LENGTH l - 1) LENGTH e)
  • zsyn_deduct_recurs: Recursive Function for calling zsyn_EVF