Type-check a file.
(typecheck-file file) → ok
First we go through the file and build the initial static environment, which we use to type-check all the declarations that form the file. In case of success, we return the static environment for the file: this is used as context to check input files.
Function:
(defun typecheck-file (file) (declare (xargs :guard (filep file))) (let ((__function__ 'typecheck-file)) (declare (ignorable __function__)) (b* (((okf env) (file-to-senv file)) ((okf &) (typecheck-topdecl-list (programdecl->items (file->program file)) env))) env)))
Theorem:
(defthm senv-resultp-of-typecheck-file (b* ((ok (typecheck-file file))) (senv-resultp ok)) :rule-classes :rewrite)
Theorem:
(defthm typecheck-file-of-file-fix-file (equal (typecheck-file (file-fix file)) (typecheck-file file)))
Theorem:
(defthm typecheck-file-file-equiv-congruence-on-file (implies (file-equiv file file-equiv) (equal (typecheck-file file) (typecheck-file file-equiv))) :rule-classes :congruence)