-
Notifications
You must be signed in to change notification settings - Fork 40
Lean DRT #158
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
Merged
Merged
Lean DRT #158
Changes from all commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
a6a88a0
add json (de)serialization
fdcca0b
first pass adding Lean DRT
015a13c
Compiles and tests start to run but panic
andrewmwells-amazon 499a366
don't build theorems for now
andrewmwells-amazon 9abffa8
fails on Lean side
andrewmwells-amazon a808fd4
runs, no deserializer
andrewmwells-amazon 4dfce15
deserialization code
andrewmwells-amazon 100750f
lean fails to deserialize
andrewmwells-amazon 89455b4
make stand alone diff test
andrewmwells-amazon 64bca02
smaller test
andrewmwells-amazon e0466de
checkpoint
andrewmwells-amazon 7034a7b
checkpoint
andrewmwells-amazon e90ea11
confusing issue
andrewmwells-amazon 5c120c0
fix jsonToContext
andrewmwells-amazon 0ba105e
remove debugging code
andrewmwells-amazon 39f3731
more cleanup
andrewmwells-amazon cb5624f
failing JSON for 5b
andrewmwells-amazon ed8dfd8
works on 5b.json standalone
andrewmwells-amazon 4b8f1e3
README instructions
andrewmwells-amazon 311cc80
changes for Rust
andrewmwells-amazon de88f0d
run Rust integration tests
andrewmwells-amazon 134d783
added back dafny/java code; added test case to DiffTest/Main.lean
c92b8e0
refactoring in parser
e959dd2
edits
b4e0a8f
Dafny and Lean integration tests run
andrewmwells-amazon 7620580
adding more progress
91eac97
examples for testing
d05803e
fix some bugs in the validator spec
cccdacf
rename DiffTestStandAlone -> Cli; add more examples
7b5d327
forgot to add examples
3b3e0c8
wip
9fef0a5
merge w/ main
3dc359f
update submodule
78ab68c
fix bad merge
7f5d0c1
validation tests are working
60108aa
merge w/ pretty-parser branch
590859d
cleanup
655efab
more cleanup
e547ea3
pulling in Lean changes from main
51cb310
Merge branch 'main' into lean-drt-javaless
d41cd85
forgot to add DiffTest file
0520792
wip
0a812a5
update cedar submodule
3b89530
minor fixes
6d0c6b1
cleanup
f2cb33b
another attempt at ci
665b45f
fix CI
andrewmwells-amazon 0f85cb0
upterm
andrewmwells-amazon 54a56fc
fix CI
andrewmwells-amazon 0c91f6a
minor cleanup
2247432
more nits
628cbf8
remove mathlib
17600fd
upterm
b677417
fix ci?
28e6ac5
oops
0bf565b
one more attempt
1abd248
Update cedar-drt/README.md
khieta 4aebef2
Merge branch 'main' into lean-drt-javaless
122afc0
merge with main + some cleanup
0c0bf12
review comments
c786d25
oops - didn't mean to commit the fuzz target changes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,7 @@ | ||
| use std::env; | ||
| fn main() { | ||
| let lean_dir = env::var("LEAN_LIB_DIR").unwrap(); | ||
| println!("cargo:rustc-link-search=native=../cedar-lean/build/lib"); | ||
| println!("cargo:rustc-link-search=native={lean_dir}"); | ||
| println!("cargo:rustc-link-search=native=../cedar-lean/lake-packages/std/build/lib"); | ||
| } |
This file contains hidden or 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,7 @@ | ||
| use std::env; | ||
| fn main() { | ||
| let lean_dir = env::var("LEAN_LIB_DIR").unwrap(); | ||
| println!("cargo:rustc-link-search=native=../../cedar-lean/build/lib"); | ||
| println!("cargo:rustc-link-search=native={lean_dir}"); | ||
| println!("cargo:rustc-link-search=native=../../cedar-lean/lake-packages/std/build/lib"); | ||
| } |
This file contains hidden or 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 @@ | ||
| ../cedar-lean/lean-toolchain |
This file contains hidden or 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 hidden or 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 hidden or 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,66 @@ | ||
| /* | ||
| * Copyright 2022-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * | ||
| * 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 | ||
| * | ||
| * https://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. | ||
| */ | ||
|
|
||
| use crate::cedar_test_impl::*; | ||
| use cedar_policy::frontend::is_authorized::InterfaceResponse; | ||
| pub use cedar_policy_core::*; | ||
| pub use cedar_policy_validator::{ValidationMode, ValidatorSchema}; | ||
| pub use entities::Entities; | ||
| use serde::{Deserialize, Serialize}; | ||
|
|
||
| #[derive(Debug, Serialize)] | ||
| pub struct RequestForDefEngine<'a> { | ||
| pub request: &'a ast::Request, | ||
| pub policies: &'a ast::PolicySet, | ||
| pub entities: &'a Entities, | ||
| } | ||
|
|
||
| #[derive(Debug, Serialize, Deserialize)] | ||
| pub struct DefinitionalAuthResponse { | ||
| pub serialization_nanos: i64, | ||
| pub deserialization_nanos: i64, | ||
| pub auth_nanos: i64, | ||
| pub response: InterfaceResponse, | ||
| } | ||
|
|
||
| #[derive(Debug, Serialize)] | ||
| pub struct EvalRequestForDefEngine<'a> { | ||
| pub request: &'a ast::Request, | ||
| pub entities: &'a Entities, | ||
| pub expr: &'a ast::Expr, | ||
| pub expected: Option<&'a ast::Expr>, | ||
| } | ||
|
|
||
| #[derive(Debug, Serialize, Deserialize, Clone, Copy)] | ||
| #[repr(transparent)] | ||
| pub struct DefinitionalEvalResponse { | ||
| pub matches: bool, | ||
| } | ||
|
|
||
| #[derive(Debug, Serialize)] | ||
| pub struct RequestForDefValidator<'a> { | ||
| pub schema: &'a ValidatorSchema, | ||
| pub policies: &'a ast::PolicySet, | ||
| pub mode: ValidationMode, | ||
| } | ||
|
|
||
| #[derive(Debug, Deserialize)] | ||
| pub struct DefinitionalValResponse { | ||
| pub serialization_nanos: i64, | ||
| pub deserialization_nanos: i64, | ||
| pub validation_nanos: i64, | ||
| pub response: ValidationInterfaceResponse, | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.