Skip to content
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

Dune-based extraction #104

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.glob
*.v.d
*.buildtime
_build
Makefile.coq
Makefile.coq.bak
Makefile.coq.conf
Expand Down
103 changes: 10 additions & 93 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,99 +1,16 @@
PYTHON=python2.7

include Makefile.ml-files

default: Makefile.coq
$(MAKE) -f Makefile.coq

quick: Makefile.coq
$(MAKE) -f Makefile.coq quick

vos: Makefile.coq
$(MAKE) -f Makefile.coq vos

checkproofs: quick
$(MAKE) -f Makefile.coq checkproofs

install: Makefile.coq
$(MAKE) -f Makefile.coq install

proofalytics:
$(MAKE) -C proofalytics clean
$(MAKE) -C proofalytics
$(MAKE) -C proofalytics publish

STDBUF=$(shell [ -x "$$(which gstdbuf)" ] && echo "gstdbuf" || echo "stdbuf")
BUILDTIMER=$(PWD)/proofalytics/build-timer.sh $(STDBUF) -i0 -o0

proofalytics-aux: Makefile.coq
$(MAKE) -f Makefile.coq TIMECMD="$(BUILDTIMER)"

Makefile.coq: _CoqProject
coq_makefile -f _CoqProject -o Makefile.coq

theories/Raft/RaftState.v: theories/Raft/RaftState.v.rec
$(PYTHON) script/extract_record_notation.py theories/Raft/RaftState.v.rec raft_data > theories/Raft/RaftState.v
all: Makefile.coq
@+$(MAKE) -f Makefile.coq all

clean: Makefile.coq
$(MAKE) -f Makefile.coq cleanall
rm -f Makefile.coq Makefile.coq.conf
find . -name '*.buildtime' -delete
$(MAKE) -C proofalytics clean
$(MAKE) -C extraction/vard clean
$(MAKE) -C extraction/vard-serialized clean
$(MAKE) -C extraction/vard-log clean
$(MAKE) -C extraction/vard-serialized-log clean
$(MAKE) -C extraction/vard-debug clean

assumptions: Makefile.coq
$(MAKE) -f Makefile.coq script/assumptions.vo
@+$(MAKE) -f Makefile.coq cleanall
@rm -f Makefile.coq Makefile.coq.conf

$(VARDML) $(VARDSERML) $(VARDLOGML) $(VARDSERLOGML) $(VARDDEBUGML): Makefile.coq
$(MAKE) -f Makefile.coq $@

vard:
+$(MAKE) -C extraction/vard

vard-test:
+$(MAKE) -C extraction/vard test

vard-serialized:
+$(MAKE) -C extraction/vard-serialized

vard-serialized-test:
+$(MAKE) -C extraction/vard-serialized test

vard-log:
+$(MAKE) -C extraction/vard-log

vard-log-test:
+$(MAKE) -C extraction/vard-log test

vard-serialized-log:
+$(MAKE) -C extraction/vard-serialized-log

vard-serialized-log-test:
+$(MAKE) -C extraction/vard-serialized-log test

vard-debug:
+$(MAKE) -C extraction/vard-debug

vard-debug-test:
+$(MAKE) -C extraction/vard-debug test

lint:
@echo "Possible use of hypothesis names:"
find . -name '*.v' -exec grep -Hn 'H[0-9][0-9]*' {} \;
Makefile.coq: _CoqProject
$(COQBIN)coq_makefile -f _CoqProject -o Makefile.coq

distclean: clean
rm -f _CoqProject
force _CoqProject Makefile: ;

.PHONY: default quick install clean lint proofalytics distclean checkproofs assumptions vos
.PHONY: vard vard-test vard-serialized vard-serialized-test vard-log vard-log-test vard-serialized-log vard-serialized-log-test vard-debug vard-debug-test
.PHONY: $(VARDML) $(VARDSERML) $(VARDLOGML) $(VARDSERLOGML) $(VARDDEBUGML)
%: Makefile.coq force
@+$(MAKE) -f Makefile.coq $@

.NOTPARALLEL: $(VARDML)
.NOTPARALLEL: $(VARDSERML)
.NOTPARALLEL: $(VARDLOGML)
.NOTPARALLEL: $(VARDSERLOGML)
.NOTPARALLEL: $(VARDDEBUGML)
.PHONY: all clean force
28 changes: 0 additions & 28 deletions Makefile.coq.local

This file was deleted.

5 changes: 0 additions & 5 deletions Makefile.ml-files

This file was deleted.

6 changes: 0 additions & 6 deletions _CoqProject
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,3 @@ theories/Systems/VarDRaftSerialized.v
theories/Systems/VarDRaftSerializers.v
theories/Systems/VarDRaftLog.v
theories/Systems/VarDRaft.v

extraction/vard/coq/ExtractVarDRaft.v
extraction/vard-serialized/coq/ExtractVarDRaftSerialized.v
extraction/vard-log/coq/ExtractVarDRaftLog.v
extraction/vard-serialized-log/coq/ExtractVarDRaftSerializedLog.v
extraction/vard-debug/coq/ExtractVarDRaftDebug.v
4 changes: 0 additions & 4 deletions extraction/vard-log/.merlin

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ From Verdi Require Import ExtrOcamlBool ExtrOcamlList ExtrOcamlFinInt ExtrOcamlD
From Cheerios Require Import ExtrOcamlCheeriosBasic ExtrOcamlCheeriosNatInt.
From Cheerios Require Import ExtrOcamlCheeriosString ExtrOcamlCheeriosFinInt.

Extraction "extraction/vard-log/ml/VarDRaftLog.ml" seq transformed_base_params
Extraction "VarDRaftLog.ml" seq transformed_base_params
transformed_multi_params transformed_failure_params.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
open Str
open Printf
open VarDRaftLog
open VarD
open Util

let outputToString out =
Expand Down
24 changes: 24 additions & 0 deletions extraction/vard-log/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
(library
(name VarDRaftLog)
(flags :standard -w -27-32-39-67)
(libraries verdi-runtime cheerios-runtime)
(modules VarDRaftLog))

(library
(name VarDLogSerialization)
(libraries verdi-runtime VarDRaftLog)
(modules VarDLogSerialization))

(coq.extraction
(prelude ExtractVarDRaftLog)
(extracted_modules VarDRaftLog)
(theories VerdiRaft)
(flags :standard -w -extraction-opaque-accessed))

(executable
(name vardlog)
(public_name vardlog)
(libraries verdi-runtime VarDRaftLog VarDLogSerialization)
(flags :standard -w -27)
(modules vardlog VarDLogArrangement)
(package vard-log))
28 changes: 0 additions & 28 deletions extraction/vard-log/test/VarDSerializedSerializationTest.ml

This file was deleted.

File renamed without changes.
4 changes: 0 additions & 4 deletions extraction/vard/.merlin

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ From Coq Require Import ExtrOcamlBasic ExtrOcamlNatInt ExtrOcamlString.
From Verdi Require Import ExtrOcamlBasicExt ExtrOcamlNatIntExt.
From Verdi Require Import ExtrOcamlBool ExtrOcamlList ExtrOcamlFinInt.

Extraction "extraction/vard/ml/VarDRaft.ml" seq vard_raft_base_params
Extraction "VarDRaft.ml" seq vard_raft_base_params
vard_raft_multi_params vard_raft_failure_params.
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
open Str
open Printf
open VarDRaft
open VarD
open Util

module type IntValue = sig
val v : int
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
open Str
open Printf
open VarDRaft
open VarD
open Util

let serializeOutput out =
Expand Down
23 changes: 23 additions & 0 deletions extraction/vard/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(library
(name VarDRaft)
(flags :standard -w -27-32-39-67)
(modules VarDRaft))

(library
(name VarDSerialization)
(libraries verdi-runtime VarDRaft)
(modules VarDSerialization))

(coq.extraction
(prelude ExtractVarDRaft)
(extracted_modules VarDRaft)
(theories VerdiRaft)
(flags :standard -w -extraction-opaque-accessed))

(executable
(name vard)
(public_name vard)
(libraries verdi-runtime VarDRaft VarDSerialization)
(flags :standard -w -27)
(modules vard VarDArrangement)
(package vard))
12 changes: 0 additions & 12 deletions extraction/vard/scripts/vard.conf

This file was deleted.

1 change: 0 additions & 1 deletion extraction/vard/ml/vard.ml → extraction/vard/vard.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
open List
open Printf
open Str
open Opts

let _ =
Expand Down
89 changes: 0 additions & 89 deletions script/coqproject.sh

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading