Run an SVTV and get the outputs.
(svtv-run svtv inalist &key (skip 'nil) (include 'nil) (boolvars 't) (simplify 'nil) (quiet 'nil) (readable 't) (allvars 'nil)) → res
The input names and output names referred to above are the variable symbols used in the defsvtv form. For example,
(defsvtv my-test :inputs '(("clk" 1 ~) ("dwire" _ _ _ dat _) ("cwire" _ ctrl _ _ _)) :overrides '(("inst.signal" _ _ _ ov _)) :outputs '(("firstout" _ _ _ outa _) ("secondout" _ _ _ _ _ outb)) :internals '(("inst2.myint" _ intl)))
In this STV, the input names are
Function:
(defun acl2::svtv-run-fn (svtv inalist skip include boolvars simplify quiet readable allvars) (declare (xargs :guard (svtv-p svtv))) (let ((__function__ 'svtv-run)) (declare (ignorable __function__)) (b* (((svtv svtv) svtv) (inalist (ec-call (svex-env-fix$inline inalist))) ((with-fast inalist)) (svtv.inmasks (make-fast-alist svtv.inmasks)) (boolmasks (hons-copy (and boolvars (svar-boolmasks-limit-to-bound-vars (alist-keys inalist) svtv.inmasks)))) (outs (b* (((unless (or skip include)) svtv.outexprs) (outkeys (or include (difference (mergesort (svex-alist-keys svtv.outexprs)) (mergesort skip))))) (fal-extract outkeys svtv.outexprs))) (res (mbe :logic (svex-alist-eval-for-symbolic outs (make-fast-alist inalist) (cons (cons ':vars (alist-keys svtv.inmasks)) (cons (cons ':boolmasks boolmasks) (cons (cons ':simplify simplify) (cons (cons ':allvars allvars) 'nil))))) :exec (svex-alist-eval outs inalist)))) (clear-memoize-table 'svex-eval) (and (not quiet) (progn$ (cw "~%SVTV Inputs:~%") (if readable (svtv-print-alist-readable inalist) (svtv-print-alist inalist)) (cw "~%SVTV Outputs:~%") (if readable (svtv-print-alist-readable res) (svtv-print-alist res)) (cw "~%"))) (make-fast-alist res))))
Theorem:
(defthm acl2::svex-env-p-of-svtv-run (b* ((res (acl2::svtv-run-fn svtv inalist skip include boolvars simplify quiet readable allvars))) (svex-env-p res)) :rule-classes :rewrite)
Theorem:
(defthm svtv-run-normalize-irrelevant-inputs (implies (syntaxp (not (and (equal boolvars ''t) (equal quiet ''nil) (equal simplify ''nil) (equal readable ''t)))) (equal (svtv-run svtv inalist :skip skip :include include :boolvars boolvars :allvars allvars :simplify simplify :quiet quiet :readable readable) (svtv-run svtv inalist :skip skip :include include))))
Theorem:
(defthm alistp-of-svtv-run (alistp (svtv-run svtv inalist :skip skip :include include :boolvars boolvars :allvars allvars :simplify simplify :quiet quiet :readable readable)))
Theorem:
(defthm lookup-in-svtv-run-under-iff (iff (assoc key (svtv-run svtv inalist :include include :skip skip :boolvars boolvars :allvars allvars :simplify simplify :quiet quiet :readable readable)) (and (member key (svtv->outs svtv)) (if include (member key include) (not (member key skip))))))
Theorem:
(defthm lookup-in-svtv-run-consp (iff (consp (assoc key (svtv-run svtv inalist :include include :skip skip :boolvars boolvars :allvars allvars :simplify simplify :quiet quiet :readable readable))) (and (member key (svtv->outs svtv)) (if include (member key include) (not (member key skip))))))
Theorem:
(defthm 4vec-p-lookup-in-svtv-run (iff (4vec-p (cdr (assoc key (svtv-run svtv inalist :include include :skip skip :boolvars boolvars :allvars allvars :simplify simplify :quiet quiet :readable readable)))) (and (member key (svtv->outs svtv)) (if include (member key include) (not (member key skip))))))
Theorem:
(defthm lookup-in-svtv-run-with-include (implies (and (syntaxp (and (quotep include) (not (equal include ''nil)))) (member signal include)) (equal (assoc signal (svtv-run svtv inalist :include include :skip skip :boolvars boolvars :allvars allvars :simplify simplify :quiet quiet :readable readable)) (assoc signal (svtv-run svtv inalist)))))
Theorem:
(defthm lookup-in-svtv-run-with-skip (implies (and (syntaxp (and (quotep skip) (not (equal skip ''nil)))) (not (member signal skip))) (equal (assoc signal (svtv-run svtv inalist :include nil :skip skip :boolvars boolvars :allvars allvars :simplify simplify :quiet quiet :readable readable)) (assoc signal (svtv-run svtv inalist)))))
Theorem:
(defthm svex-env-boundp-of-svtv-run (iff (svex-env-boundp key (svtv-run svtv inalist :include include :skip skip :boolvars boolvars :allvars allvars :simplify simplify :quiet quiet :readable readable)) (and (if include (member-equal (svar-fix key) include) (not (member-equal (svar-fix key) skip))) (svex-lookup key (svtv->outexprs svtv)))))
Theorem:
(defthm svex-env-lookup-in-svtv-run-with-include (implies (and (syntaxp (and (quotep include) (not (equal include ''nil)))) (member (svar-fix signal) include)) (equal (svex-env-lookup signal (svtv-run svtv inalist :include include :skip skip :boolvars boolvars :allvars allvars :simplify simplify :quiet quiet :readable readable)) (svex-env-lookup signal (svtv-run svtv inalist)))))
Theorem:
(defthm svex-env-lookup-in-svtv-run-with-skip (implies (and (syntaxp (and (quotep skip) (not (equal skip ''nil)))) (not (member (svar-fix signal) skip))) (equal (svex-env-lookup signal (svtv-run svtv inalist :include nil :skip skip :boolvars boolvars :allvars allvars :simplify simplify :quiet quiet :readable readable)) (svex-env-lookup signal (svtv-run svtv inalist)))))
Theorem:
(defthm alist-keys-of-svtv-run (equal (alist-keys (svtv-run svtv env)) (svex-alist-keys (svtv->outexprs svtv))))
Theorem:
(defthm acl2::svtv-run-fn-of-svtv-fix-svtv (equal (acl2::svtv-run-fn (svtv-fix svtv) inalist skip include boolvars simplify quiet readable allvars) (acl2::svtv-run-fn svtv inalist skip include boolvars simplify quiet readable allvars)))
Theorem:
(defthm acl2::svtv-run-fn-svtv-equiv-congruence-on-svtv (implies (svtv-equiv svtv acl2::svtv-equiv) (equal (acl2::svtv-run-fn svtv inalist skip include boolvars simplify quiet readable allvars) (acl2::svtv-run-fn acl2::svtv-equiv inalist skip include boolvars simplify quiet readable allvars))) :rule-classes :congruence)