-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fix dc example #567
Fix dc example #567
Changes from 5 commits
0d7d681
1b4dfb2
18102fb
78e4876
7140df8
b0ae680
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,24 +3,22 @@ import SSA.Core.MLIRSyntax.GenericParser | |
import SSA.Projects.CIRCT.DC | ||
import SSA.Projects.CIRCT.DC.Stream | ||
|
||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unrelated. |
||
/-! | ||
## Examples | ||
-/ | ||
namespace DC | ||
namespace Examples | ||
|
||
unseal String.splitOnAux in | ||
def BranchEg1 := [dc_com| { | ||
^entry(%0: !Stream_Bool, %1: !Stream_Bool): | ||
%out = "dc.branch" (%0, %1) : (!Stream_Bool, !Stream_Bool) -> (!Stream2_Bool) | ||
%0 = "dc.fst" (%out) : (!Stream2_Bool) -> (!Stream_Bool) | ||
%outs = "dc.snd" (%out) : (!Stream2_Bool) -> (!Stream_Bool) | ||
%out2 = "dc.merge" (%outf, %outs) : (!Stream_Bool, !Stream_Bool) -> (!Stream_Bool) | ||
"return" (%out) : (!Stream_Bool) -> () | ||
^entry(%0: !Stream_Int, %1: !Stream_Bool): | ||
%out = "dc.branch" (%0, %1) : (!Stream_Int, !Stream_Bool) -> (!Stream2_Int) | ||
%outf = "dc.fst" (%out) : (!Stream2_Int) -> (!Stream_Int) | ||
%outs = "dc.snd" (%out) : (!Stream2_Int) -> (!Stream_Int) | ||
%out2 = "dc.merge" (%outs, %outf) : (!Stream_Int, !Stream_Int) -> (!Stream_Int) | ||
"return" (%out2) : (!Stream_Int) -> () | ||
}] | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unrelated. Maybe not include this in this commit. |
||
#check BranchEg1 | ||
#eval BranchEg1 | ||
#reduce BranchEg1 | ||
|
@@ -30,16 +28,15 @@ def BranchEg1 := [dc_com| { | |
def ofList (vals : List (Option α)) : Stream α := | ||
fun i => (vals.get? i).join | ||
|
||
def x : Stream Bool := ofList [some true, none, some false, some true, some false] | ||
def c : Stream Bool := ofList [some true, some false, none, some true] | ||
def c : Stream Bool := ofList [some true, none, some false, some true, some false] | ||
def x : Stream Int := ofList [some 1, some 2, none, some 3] | ||
|
||
def test : Stream Bool := | ||
BranchEg1.denote (Valuation.ofPair c x) | ||
def test : Stream Int := | ||
BranchEg1.denote (Ctxt.Valuation.ofPair c x) | ||
|
||
def remNone (lst : List (Option Bool)) : List (Option Bool) := | ||
lst.filter (fun | some x => true | ||
| none => false) | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unrelated. Maybe not include this in this commit. |
||
end Examples | ||
end DC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unrelated.