In utop:
#use "topfind";;
#require "Z3";;
| (* | |
| MAKEFILE | |
| plugin = primus_set_mem | |
| all: clean build install | |
| build: | |
| bapbuild -pkg bap-primus -tags 'warn(A)' $(plugin).plugin |
| Module SigmaTry. | |
| Inductive D : Type := | |
| | a | |
| | b | |
| | c. | |
| Definition P (x : D) : Prop := |
General:
| (** MAKEFILE: | |
| build = _build | |
| exe = main.native | |
| all: clean build | |
| clean: | |
| rm -rf $(exe) | |
| rm -rf $(build) |
| Require Import String. | |
| (* Examples by Adam Chlipala *) | |
| (** * Warm-up: natural numbers *) | |
| Inductive nat := O | S (n : nat). | |
| Fixpoint plus (n m : nat) : nat := | |
| match n with | |
| | O => m | |
| | S n' => S (plus n' m) |
| -- *************************************************** | |
| -- 6.820 - Program Analysis - Fall 2019 | |
| -- PROBLEM SET 1 | |
| -- *************************************************** | |
| -- --------------------------------------------------- | |
| -- Problem 1 |
| - Otherwise you can't do the Applicative instance. | |
| import Control.Applicative | |
| -- Simple function | |
| foo :: String -> String | |
| foo x = do | |
| x ++ "!!!" | |
| -- Helper for printing Monads |
| module Loader = struct | |
| let empty_with_program filename prog = | |
| let arch = `unknown and code = Memmap.empty and data = Memmap.empty in | |
| Project.Input.create arch filename ~code ~data | |
| ~finish:(fun proj -> Project.with_program proj prog) | |
| let load filename = | |
| let prog = Program.create () in (* empty prog for now *) | |
| empty_with_program filename prog |