-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2883 from FStarLang/guido_deps
Reducing some dependencies from the compiler into ulib
- Loading branch information
Showing
104 changed files
with
166 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from parse import parse | ||
import sys | ||
|
||
def add(adj, m, n): | ||
adj[m,n] = True | ||
|
||
def redundant(adj, nodes, i, j): | ||
for k in nodes: | ||
if k == i or k == j: continue | ||
if adj.get((i,k), False) and adj.get((k,j), False): | ||
return True | ||
|
||
return False | ||
|
||
# Assumes the graph is already transitive | ||
def simpl (adj): | ||
new_adj = {} | ||
nodes = [] | ||
for (i, j) in adj.keys(): | ||
nodes.append(i) | ||
nodes.append(j) | ||
|
||
for (i, j) in adj.keys(): | ||
if i == j: continue | ||
if redundant(adj, nodes, i ,j): continue | ||
new_adj[i,j] = True | ||
|
||
return new_adj | ||
|
||
def output (adj): | ||
print ("digraph{") | ||
for (i, j) in adj.keys(): | ||
print (" \"{0}\" -> \"{1}\"".format(i, j)) | ||
print ("}") | ||
|
||
def parse_graph(fname): | ||
adj = {} | ||
f = open(fname, 'r') | ||
lines = f.readlines() | ||
for line in lines: | ||
try: | ||
# Brittle, FIXME | ||
res = parse(" \"{}\" -> \"{}\"\n", line) | ||
(i,j) = res.fixed | ||
add(adj, i, j) | ||
except AttributeError: | ||
pass | ||
return adj | ||
|
||
file = sys.argv[1] | ||
graph = parse_graph(file) | ||
graph2 = simpl(graph) | ||
output(graph2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,6 @@ | |
|
||
module HyE.RSA | ||
|
||
open FStar.BaseTypes | ||
open FStar.List.Tot | ||
|
||
open Platform.Bytes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ u_boot_fsts | |
u_ocaml-output | ||
|
||
dep.graph | ||
dep_simpl.graph | ||
depgraph.pdf | ||
|
||
[Bb]in/ | ||
[Oo]bj/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
(* | ||
Copyright 2008-2023 Microsoft Research | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*) | ||
|
||
module FStar.Char | ||
|
||
(* This is a trimmed-down version of ulib/FStar.Char, realized by the | ||
same ML implementation. It is here to prevent dependencies from the | ||
compiler into the UInt32 module. *) | ||
|
||
new | ||
val char:eqtype | ||
|
||
type char_code | ||
|
||
val int_of_char : char -> Tot int | ||
val char_of_int : int -> Tot char | ||
|
||
val lowercase: char -> Tot char | ||
val uppercase: char -> Tot char |
File renamed without changes.
Empty file.
Empty file.
Empty file.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Content-Length: 3960 | ||
Content-Length: 3938 | ||
|
||
{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///root/non-existing/fstar/FStar/src/basic/FStar.Const.fst","languageId":"fstar","version":1,"text":"(*\n Copyright 2008-2020 Microsoft Research\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*)\nmodule FStar.Const\nopen FStar.Compiler.Effect module List = FStar.Compiler.List\nopen FStar.Compiler.Effect module List = FStar.Compiler.List\n\nopen FStar.BaseTypes\n\n// IN F*: [@@ PpxDerivingYoJson; PpxDerivingShow ]\ntype signedness = | Unsigned | Signed\n// IN F*: [@@ PpxDerivingYoJson; PpxDerivingShow ]\ntype width = | Int8 | Int16 | Int32 | Int64\n\n(* NB:\n Const_int (_, None) is not a canonical representation for a mathematical integer\n e.g., you can have both\n Const_int(\"0x3ffffff\", None)\n and\n Const_int(\"67108863\", None)\n which represent the same number\n You should do an \"FStar.Compiler.Util.ensure_decimal\" on the\n string representation before comparing integer constants.\n\n eq_const below does that for you\n*)\n\n// IN F*: [@@ PpxDerivingYoJson; PpxDerivingShow ]\ntype sconst =\n | Const_effect\n | Const_unit\n | Const_bool of bool\n | Const_int of string * option (signedness * width) (* When None, means \"mathematical integer\", i.e. Prims.int. *)\n | Const_char of char (* unicode code point: char in F#, int in OCaml *)\n | Const_float of double\n | Const_real of string\n | Const_bytearray of array byte * FStar.Compiler.Range.range\n | Const_string of string * FStar.Compiler.Range.range (* UTF-8 encoded *)\n | Const_range_of (* `range_of` primitive *)\n | Const_set_range_of (* `set_range_of` primitive *)\n | Const_range of FStar.Compiler.Range.range (* not denotable by the programmer *)\n | Const_reify (* a coercion from a computation to a Tot term *)\n | Const_reflect of Ident.lid (* a coercion from a Tot term to an l-computation type *)\n\nlet eq_const c1 c2 =\n match c1, c2 with\n | Const_int (s1, o1), Const_int(s2, o2) ->\n FStar.Compiler.Util.ensure_decimal s1 = FStar.Compiler.Util.ensure_decimal s2 &&\n o1=o2\n | Const_bytearray(a, _), Const_bytearray(b, _) -> a=b\n | Const_string(a, _), Const_string(b, _) -> a=b\n | Const_reflect l1, Const_reflect l2 -> Ident.lid_equals l1 l2\n | _ -> c1=c2\n\nopen FStar.BigInt\nlet rec pow2 (x:bigint) : bigint =\n if eq_big_int x zero\n then one\n else mult_big_int two (pow2 (pred_big_int x))\n\n\nlet bounds signedness width =\n let n =\n match width with\n | Int8 -> big_int_of_string \"8\"\n | Int16 -> big_int_of_string \"16\"\n | Int32 -> big_int_of_string \"32\"\n | Int64 -> big_int_of_string \"64\"\n in\n let lower, upper =\n match signedness with\n | Unsigned ->\n zero, pred_big_int (pow2 n)\n | Signed ->\n let upper = pow2 (pred_big_int n) in\n minus_big_int upper, pred_big_int upper\n in\n lower, upper\n\nlet within_bounds repr signedness width =\n let lower, upper = bounds signedness width in\n let value = big_int_of_string (FStar.Compiler.Util.ensure_decimal repr) in\n le_big_int lower value && le_big_int value upper\n"}}} | ||
{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///root/non-existing/fstar/FStar/src/basic/FStar.Const.fst","languageId":"fstar","version":1,"text":"(*\n Copyright 2008-2020 Microsoft Research\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*)\nmodule FStar.Const\nopen FStar.Compiler.Effect module List = FStar.Compiler.List\nopen FStar.Compiler.Effect module List = FStar.Compiler.List\n\n\n// IN F*: [@@ PpxDerivingYoJson; PpxDerivingShow ]\ntype signedness = | Unsigned | Signed\n// IN F*: [@@ PpxDerivingYoJson; PpxDerivingShow ]\ntype width = | Int8 | Int16 | Int32 | Int64\n\n(* NB:\n Const_int (_, None) is not a canonical representation for a mathematical integer\n e.g., you can have both\n Const_int(\"0x3ffffff\", None)\n and\n Const_int(\"67108863\", None)\n which represent the same number\n You should do an \"FStar.Compiler.Util.ensure_decimal\" on the\n string representation before comparing integer constants.\n\n eq_const below does that for you\n*)\n\n// IN F*: [@@ PpxDerivingYoJson; PpxDerivingShow ]\ntype sconst =\n | Const_effect\n | Const_unit\n | Const_bool of bool\n | Const_int of string * option (signedness * width) (* When None, means \"mathematical integer\", i.e. Prims.int. *)\n | Const_char of char (* unicode code point: char in F#, int in OCaml *)\n | Const_float of double\n | Const_real of string\n | Const_bytearray of array byte * FStar.Compiler.Range.range\n | Const_string of string * FStar.Compiler.Range.range (* UTF-8 encoded *)\n | Const_range_of (* `range_of` primitive *)\n | Const_set_range_of (* `set_range_of` primitive *)\n | Const_range of FStar.Compiler.Range.range (* not denotable by the programmer *)\n | Const_reify (* a coercion from a computation to a Tot term *)\n | Const_reflect of Ident.lid (* a coercion from a Tot term to an l-computation type *)\n\nlet eq_const c1 c2 =\n match c1, c2 with\n | Const_int (s1, o1), Const_int(s2, o2) ->\n FStar.Compiler.Util.ensure_decimal s1 = FStar.Compiler.Util.ensure_decimal s2 &&\n o1=o2\n | Const_bytearray(a, _), Const_bytearray(b, _) -> a=b\n | Const_string(a, _), Const_string(b, _) -> a=b\n | Const_reflect l1, Const_reflect l2 -> Ident.lid_equals l1 l2\n | _ -> c1=c2\n\nopen FStar.BigInt\nlet rec pow2 (x:bigint) : bigint =\n if eq_big_int x zero\n then one\n else mult_big_int two (pow2 (pred_big_int x))\n\n\nlet bounds signedness width =\n let n =\n match width with\n | Int8 -> big_int_of_string \"8\"\n | Int16 -> big_int_of_string \"16\"\n | Int32 -> big_int_of_string \"32\"\n | Int64 -> big_int_of_string \"64\"\n in\n let lower, upper =\n match signedness with\n | Unsigned ->\n zero, pred_big_int (pow2 n)\n | Signed ->\n let upper = pow2 (pred_big_int n) in\n minus_big_int upper, pred_big_int upper\n in\n lower, upper\n\nlet within_bounds repr signedness width =\n let lower, upper = bounds signedness width in\n let value = big_int_of_string (FStar.Compiler.Util.ensure_decimal repr) in\n le_big_int lower value && le_big_int value upper\n"}}} | ||
Content-Length: 46 | ||
|
||
{"jsonrpc":"2.0","method":"exit","params":{}} | ||
{"jsonrpc":"2.0","method":"exit","params":{}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
*) | ||
module Unit1.Basic | ||
open FStar.All | ||
open FStar.BaseTypes | ||
open FStar.Char | ||
|
||
type t = | ||
| A | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified
0
ulib/.cache/FStar.Tactics.CanonCommMonoidSimple.Equiv.fst.hints
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Oops, something went wrong.