Changes
6 changed files (+72/-0)
-
-
@@ -0,0 +1,61 @@!(defprotocol not_not_not_a_imp_not_a_protocol (comm_term) (cons ;; claim definition (cons (cons ;; expression ;; needs to be a quoted syntax tree (list 'check nil (list 'open comm_term) 'statement) ;; environment (letrec ( (arg1 (lambda (x) (car (cdr x)))) (arg1a (lambda (x) (car (arg1 x)))) (arg1b (lambda (x) (cdr (arg1 x)))) (arg2 (lambda (x) (car (cdr (cdr x))))) (arg2a (lambda (x) (car (arg2 x)))) (arg2b (lambda (x) (cdr (arg2 x)))) (and (lambda (x y) (if x (if y t nil) nil))) (or (lambda (x y) (if x t (if y t nil)))) (geti (lambda (xs i) (if (= i 0) (car xs) (geti (cdr xs) (- i 1))))) (check (lambda (env term typ) ;; Variable (if (= (car term) 10n) (eq typ (geti env (arg1 term))) ;; Lambda (if (and (= (car term) 11n) (= (car typ) 1n)) (and (eq (arg2 typ) (arg1b term)) (check (cons (arg1 typ) env) (arg1a term) (arg1b term))) ;; Application (if (and (= (car term) 12n) (= (car (arg1b term)) 1n)) (and (eq (arg1 (arg1b term)) (arg2b term)) (and (eq (arg2 (arg1b term)) typ) (and (check env (arg1a term) (arg1b term)) (check env (arg2a term) (arg2b term))))) ;; And (if (and (= (car term) 13n) (= (car typ) 2n)) (and (eq (arg1b term) (arg1 typ)) (and (eq (arg2b term) (arg2 typ)) (and (check env (arg1a term) (arg1b term)) (check env (arg2a term) (arg2b term))))) ;; And1 (if (and (= (car term) 14n) (= (car (arg1b term)) 2n)) (and (eq (arg1 (arg1b term)) typ) (check env (arg1a term) (arg1b term))) ;; And2 (if (and (= (car term) 15n) (= (car (arg1b term)) 2n)) (and (eq (arg2 (arg1b term)) typ) (check env (arg1a term) (arg1b term))) ;; Or (if (and (= (car term) 16n) (= (car typ) 3n)) (and (or (eq (arg1b term) (arg1 typ)) (eq (arg1b term) (arg2 typ))) (check env (arg1a term) (arg1b term))) ;; False elim (if (and (= (car term) 20n) (eq (car (arg1b term)) 5n)) t nil)))))))))) (statement (list 1n (list 1n (list 1n (list 1n (list 0n 0n) '(5n)) '(5n)) '(5n)) (list 1n (list 0n 0n) '(5n)))) ) (current-env)) ) ;; expected output t ) ;; post-verification predicate nil) :description "¬¬¬A → ¬A") !(dump-expr not_not_not_a_imp_not_a_protocol "demo_protocol")
-
-
demo/1_demo_proof.lurk (new)
-
@@ -0,0 +1,8 @@!(defq not_not_not_a_imp_not_a_protocol_loaded !(load-expr "demo_protocol")) !(def not_not_not_a_imp_not_a_solution (list 11n (cons (list 11n (cons (list 12n (cons (list 10n 1) (list 1n (list 1n (list 1n (list 0n 0n) '(5n)) '(5n)) '(5n))) (cons (list 12n (cons (list 11n (cons (list 11n (cons (list 12n (cons (list 10n 0) (list 1n (list 0n 0n) '(5n))) (cons (list 10n 1) (list 0n 0n))) '(5n))) (list 1n (list 1n (list 0n 0n) '(5n)) '(5n)))) (list 1n (list 0n 0n) (list 1n (list 1n (list 0n 0n) '(5n)) '(5n)))) (cons (list 10n 0) (list 0n 0n))) (list 1n (list 1n (list 0n 0n) '(5n)) '(5n)))) '(5n))) (list 1n (list 0n 0n) '(5n))))) !(def comm_term_test (hide #0x2903850943570 not_not_not_a_imp_not_a_solution)) !(prove-protocol not_not_not_a_imp_not_a_protocol_loaded "demo_proof" comm_term_test)
-
-
demo/2_demo_verify.lurk (new)
-
@@ -0,0 +1,3 @@!(defq not_not_not_a_imp_not_a_protocol_loaded !(load-expr "demo_protocol")) !(inspect "5b8ee3adb60cbfc0ab9404a29656d5fd06a8364e62008491cd31e93902f567") !(verify-protocol not_not_not_a_imp_not_a_protocol_loaded "demo_proof")
-
-
demo/demo_proof (new)
-
demo/demo_protocol (new)
-