-
Notifications
You must be signed in to change notification settings - Fork 21
Prover column after TXN_DATA
redesign
#796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
bb227bc
7e051bc
bf4279e
be2dff9
a122ce2
7e6efc5
379eacd
30ed81e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
(module rlptxn) | ||
|
||
|
||
|
||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
;; ;; | ||
;; Constraints verification ;; | ||
;; ;; | ||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
|
||
|
||
|
||
(defcolumns | ||
( prover___USER_TXN_NUMBER_MAX :i16 ) | ||
) | ||
|
||
(defalias | ||
USRMAX prover___USER_TXN_NUMBER_MAX | ||
) | ||
|
||
|
||
|
||
(defconstraint prover-column-constraints---USER_TXN_NUMBER_MAX---constancy () | ||
(if-not-zero USER_TXN_NUMBER | ||
(will-remain-constant! USRMAX))) | ||
|
||
(defconstraint prover-column-constraints---USER_TXN_NUMBER_MAX---finalization | ||
(:domain {-1}) ;; "" | ||
(eq! USRMAX USER_TXN_NUMBER)) | ||
|
||
|
||
|
||
;; TOTL|USER|SYSF|SYSI|prover |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
(module txndata) | ||
|
||
|
||
|
||
(defun | ||
(block-constancy COL) | ||
(if-not-zero (- (next BLK_NUMBER) (+ 1 BLK_NUMBER)) | ||
(eq! (next COL) COL))) | ||
(defun | ||
(conflation-constancy COL) | ||
(if-not-zero (perspective-sum) | ||
(eq! (next COL) COL))) | ||
(defun | ||
(transaction-constancy COL) | ||
(if-not-zero (- (next TOTL_TXN_NUMBER) (+ 1 TOTL_TXN_NUMBER)) | ||
(eq! (next COL) COL))) | ||
(defun | ||
(user-transaction-constancy COL) | ||
(if-not-zero (* (next USER ) USER ) | ||
(eq! (next COL ) COL ))) | ||
|
||
|
||
|
||
|
||
(defcomputedcolumn ( prover___RELATIVE_USER_TXN_NUMBER :i16 :fwd ) | ||
(if-eq-else BLK_NUMBER (prev BLK_NUMBER) | ||
;; BLK# equality case | ||
(* USER (+ (prev prover___RELATIVE_USER_TXN_NUMBER) (- USER_TXN_NUMBER (prev USER_TXN_NUMBER)))) | ||
;; BLK# change case | ||
0 | ||
)) | ||
|
||
(defcomputedcolumn ( prover___IS_LAST_USER_TXN_OF_BLOCK :binary@prove :bwd ) | ||
(if-eq-else (next TOTL_TXN_NUMBER) TOTL_TXN_NUMBER | ||
;; TOTL transaction number equality case | ||
(next prover___IS_LAST_USER_TXN_OF_BLOCK) | ||
;; BLK# change case | ||
(* (next SYSF) USER) | ||
)) | ||
|
||
(defalias | ||
RELUSR prover___RELATIVE_USER_TXN_NUMBER | ||
LSTUSR prover___IS_LAST_USER_TXN_OF_BLOCK | ||
) | ||
|
||
|
||
|
||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
;; ;; | ||
;; Property verification ;; | ||
;; ;; | ||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
|
||
|
||
|
||
(defproperty prover-column-constraints---RELATIVE_USER_TXN_NUMBER---const (transaction-constancy RELUSR)) | ||
(defproperty prover-column-constraints---RELATIVE_USER_TXN_NUMBER---vanish (if-zero (perspective-sum) (vanishes! RELUSR))) | ||
(defproperty prover-column-constraints---RELATIVE_USER_TXN_NUMBER---transition (if-not-zero (- (next BLK_NUMBER) BLK_NUMBER) (vanishes! RELUSR))) | ||
(defproperty prover-column-constraints---RELATIVE_USER_TXN_NUMBER---increment (if-not-zero (- (next BLK_NUMBER) (+ BLK_NUMBER 1)) | ||
(eq! (next RELUSR) | ||
(* (next USER) (+ RELUSR (- (next USER_TXN_NUMBER) USER_TXN_NUMBER)))))) | ||
|
||
(defproperty prover-column-constraints---IS_LAST_USER_TXN_OF_BLOCK---const (transaction-constancy LSTUSR) ) | ||
(defproperty prover-column-constraints---IS_LAST_USER_TXN_OF_BLOCK---vanish (if-zero USER (vanishes! LSTUSR)) ) | ||
(defproperty prover-column-constraints---IS_LAST_USER_TXN_OF_BLOCK---last (if-not-zero (- TOTL_TXN_NUMBER (prev TOTL_TXN_NUMBER)) | ||
(eq! (prev LSTUSR) | ||
(* (prev USER) SYSF))) | ||
) | ||
|
||
|
||
|
||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
;; ;; | ||
;; Constraints verification ;; | ||
;; ;; | ||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
|
||
|
||
|
||
(defcolumns | ||
( prover___RELATIVE_USER_TXN_NUMBER_MAX :i16 ) | ||
( prover___USER_TXN_NUMBER_MAX :i16 ) | ||
) | ||
|
||
(defalias | ||
RELMAX prover___RELATIVE_USER_TXN_NUMBER_MAX | ||
USRMAX prover___USER_TXN_NUMBER_MAX | ||
) | ||
|
||
|
||
|
||
(defconstraint prover-column-constraints---RELATIVE_USER_TXN_NUMBER_MAX---const () (user-transaction-constancy RELMAX)) | ||
(defconstraint prover-column-constraints---RELATIVE_USER_TXN_NUMBER_MAX---zero () (if-zero (perspective-sum) | ||
(vanishes! RELMAX))) | ||
(defconstraint prover-column-constraints---RELATIVE_USER_TXN_NUMBER_MAX---setting () (if-not-zero (* (- 1 (prev SYSF)) SYSF) | ||
(eq! (prev RELMAX) (prev RELUSR)))) | ||
|
||
(defconstraint prover-column-constraints---USER_TXN_NUMBER_MAX () | ||
(begin | ||
(conflation-constancy USRMAX) | ||
(if-zero (perspective-sum) | ||
(vanishes! USRMAX)) | ||
)) | ||
|
||
(defconstraint prover-column-constraints---USER_TXN_NUMBER_MAX---finalization | ||
(:domain {-1}) ;; "" | ||
(eq! USRMAX USER_TXN_NUMBER)) | ||
|
||
|
||
|
||
;; TOTL|USER|SYSF|SYSI|prover |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
(module txndata) | ||
|
||
|
||
|
||
(defun | ||
(block-constancy COL) | ||
(if-not-zero (- (next BLK_NUMBER) (+ 1 BLK_NUMBER)) | ||
(eq! (next COL) COL))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Block Constancy Condition MismatchThe Additional Locations (3) |
||
(defun | ||
(conflation-constancy COL) | ||
(if-not-zero (perspective-sum) | ||
(eq! (next COL) COL))) | ||
(defun | ||
(transaction-constancy COL) | ||
(if-not-zero (- (next TOTL_TXN_NUMBER) (+ 1 TOTL_TXN_NUMBER)) | ||
(eq! (next COL) COL))) | ||
(defun | ||
(user-transaction-constancy COL) | ||
(if-not-zero (* (next USER ) USER ) | ||
(eq! (next COL ) COL ))) | ||
|
||
|
||
|
||
|
||
(defcomputedcolumn ( prover___RELATIVE_USER_TXN_NUMBER :i16 :fwd ) | ||
(if-eq-else BLK_NUMBER (prev BLK_NUMBER) | ||
;; BLK# equality case | ||
(* USER (+ (prev prover___RELATIVE_USER_TXN_NUMBER) (- USER_TXN_NUMBER (prev USER_TXN_NUMBER)))) | ||
;; BLK# change case | ||
0 | ||
)) | ||
|
||
(defcomputedcolumn ( prover___IS_LAST_USER_TXN_OF_BLOCK :binary@prove :bwd ) | ||
(if-eq-else (next TOTL_TXN_NUMBER) TOTL_TXN_NUMBER | ||
;; TOTL transaction number equality case | ||
(next prover___IS_LAST_USER_TXN_OF_BLOCK) | ||
;; BLK# change case | ||
(* (next SYSF) USER) | ||
)) | ||
|
||
(defalias | ||
RELUSR prover___RELATIVE_USER_TXN_NUMBER | ||
LSTUSR prover___IS_LAST_USER_TXN_OF_BLOCK | ||
) | ||
|
||
|
||
|
||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
;; ;; | ||
;; Property verification ;; | ||
;; ;; | ||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
|
||
|
||
|
||
(defproperty prover-column-constraints---RELATIVE_USER_TXN_NUMBER---const (transaction-constancy RELUSR)) | ||
(defproperty prover-column-constraints---RELATIVE_USER_TXN_NUMBER---vanish (if-zero (perspective-sum) (vanishes! RELUSR))) | ||
(defproperty prover-column-constraints---RELATIVE_USER_TXN_NUMBER---transition (if-not-zero (- (next BLK_NUMBER) BLK_NUMBER) (vanishes! RELUSR))) | ||
(defproperty prover-column-constraints---RELATIVE_USER_TXN_NUMBER---increment (if-not-zero (- (next BLK_NUMBER) (+ BLK_NUMBER 1)) | ||
(eq! (next RELUSR) | ||
(* (next USER) (+ RELUSR (- (next USER_TXN_NUMBER) USER_TXN_NUMBER)))))) | ||
|
||
(defproperty prover-column-constraints---IS_LAST_USER_TXN_OF_BLOCK---const (transaction-constancy LSTUSR) ) | ||
(defproperty prover-column-constraints---IS_LAST_USER_TXN_OF_BLOCK---vanish (if-zero USER (vanishes! LSTUSR)) ) | ||
(defproperty prover-column-constraints---IS_LAST_USER_TXN_OF_BLOCK---last (if-not-zero (- TOTL_TXN_NUMBER (prev TOTL_TXN_NUMBER)) | ||
(eq! (prev LSTUSR) | ||
(* (prev USER) SYSF))) | ||
) | ||
|
||
|
||
|
||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
;; ;; | ||
;; Constraints verification ;; | ||
;; ;; | ||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
|
||
|
||
|
||
(defcolumns | ||
( prover___RELATIVE_USER_TXN_NUMBER_MAX :i16 ) | ||
( prover___USER_TXN_NUMBER_MAX :i16 ) | ||
) | ||
|
||
(defalias | ||
RELMAX prover___RELATIVE_USER_TXN_NUMBER_MAX | ||
USRMAX prover___USER_TXN_NUMBER_MAX | ||
) | ||
|
||
|
||
|
||
(defconstraint prover-column-constraints---RELATIVE_USER_TXN_NUMBER_MAX---const () (user-transaction-constancy RELMAX)) | ||
(defconstraint prover-column-constraints---RELATIVE_USER_TXN_NUMBER_MAX---zero () (if-zero (perspective-sum) | ||
(vanishes! RELMAX))) | ||
(defconstraint prover-column-constraints---RELATIVE_USER_TXN_NUMBER_MAX---setting () (if-not-zero (* (- 1 (prev SYSF)) SYSF) | ||
(eq! (prev RELMAX) (prev RELUSR)))) | ||
|
||
(defconstraint prover-column-constraints---USER_TXN_NUMBER_MAX () | ||
(begin | ||
(conflation-constancy USRMAX) | ||
(if-zero (perspective-sum) | ||
(vanishes! USRMAX)) | ||
)) | ||
|
||
(defconstraint prover-column-constraints---USER_TXN_NUMBER_MAX---finalization | ||
(:domain {-1}) ;; "" | ||
(eq! USRMAX USER_TXN_NUMBER)) | ||
|
||
|
||
|
||
;; TOTL|USER|SYSF|SYSI|prover |
Uh oh!
There was an error while loading. Please reload this page.