Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Typeching PostScript
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hendrik Rassmann
Typeching PostScript
Commits
d485e64b
Commit
d485e64b
authored
11 months ago
by
Hendrik Rassmann
Browse files
Options
Downloads
Patches
Plain Diff
maybe killing old code
parent
6ecbf158
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
gen0_virtuous_cycle/app/nano.19516.save
+4
-0
4 additions, 0 deletions
gen0_virtuous_cycle/app/nano.19516.save
gen0_virtuous_cycle/lib/ExpTerm.hs
+35
-1
35 additions, 1 deletion
gen0_virtuous_cycle/lib/ExpTerm.hs
with
39 additions
and
1 deletion
gen0_virtuous_cycle/app/nano.19516.save
0 → 100644
+
4
−
0
View file @
d485e64b
dasfafds
asdwq c
This diff is collapsed.
Click to expand it.
gen0_virtuous_cycle/lib/ExpTerm.hs
+
35
−
1
View file @
d485e64b
module
ExpTerm
where
module
ExpTerm
where
type
Probability
=
Double
type
Probability
=
Double
data
Expr
a
=
Node
a
data
Expr
a
=
Node
a
...
@@ -20,4 +21,37 @@ instance Functor Expr where
...
@@ -20,4 +21,37 @@ instance Functor Expr where
fmap
f
(
Code
a
)
=
Code
$
fmap
f
a
fmap
f
(
Code
a
)
=
Code
$
fmap
f
a
fmap
f
(
Neg
a
)
=
Neg
$
fmap
f
a
fmap
f
(
Neg
a
)
=
Neg
$
fmap
f
a
main
=
putStrLn
"main ExpTerm"
main
=
putStrLn
$
exprTree
$
Seq
[
Neg
(
Node
3
),
Alt
[
Seq
[(
Node
7
),
Zero
]
,
Code
(
Node
1
)]]
type
Dot
=
String
type
ID
=
Int
exprTree
::
(
Show
a
)
=>
Expr
a
->
String
exprTree
x
=
"digraph G {
\n
"
<>
(
fst
$
f
x
(
"0 [style = invis];
\n
"
,(
0
,
1
)))
<>
"}"
where
n
::
String
->
ID
->
ID
->
String
->
Dot
n
s
nID
pID
style
=
show
nID
<>
" [label=
\"
"
<>
s
<>
"
\"
, "
<>
style
<>
"] "
<>
(
show
pID
)
<>
"->"
<>
(
show
nID
)
<>
";
\n
"
f
::
(
Show
a
)
=>
Expr
a
->
(
Dot
,
(
ID
,
ID
))
->
(
Dot
,
ID
)
f
(
Node
a
)
(
d
,(
pID
,
nID
))
=
(
d
<>
n
(
show
a
)
nID
pID
"shape=note"
,
nID
+
1
)
f
(
Seq
qs
)
(
d
,(
pID
,
nID
))
=
let
(
dot
,
nID'
)
=
(
foldl
(
\
(
d
,
n
)
q
->
(
f
q
(
d
,(
nID
,
n
)))))
(
""
,(
nID
+
1
))
qs
in
--prob 1: losing old dot, prob 2: double quoting
(
d
<>
n
"*"
nID
pID
"shape=triangle"
<>
dot
,
nID'
)
f
(
Alt
qs
)
(
d
,(
pID
,
nID
))
=
let
(
dot
,
nID'
)
=
(
foldl
(
\
(
d
,
n
)
q
->
(
f
q
(
d
,(
nID
,
n
)))))
(
""
,(
nID
+
1
))
qs
in
--prob 1: losing old dot, prob 2: double quoting
(
d
<>
n
"+"
nID
pID
"shape=diamond"
<>
dot
,
nID'
)
f
(
Code
x
)
(
d
,(
pID
,
nID
))
=
let
(
dot
,
nID'
)
=
f
x
(
""
,(
nID
,
nID
+
1
))
in
(
d
<>
n
"{}"
nID
pID
"shape=hexagon"
<>
dot
,
nID'
)
f
(
Neg
x
)
(
d
,(
pID
,
nID
))
=
let
(
dot
,
nID'
)
=
f
x
(
""
,(
nID
,
nID
+
1
))
in
(
d
<>
n
"~"
nID
pID
"shape=insulator"
<>
dot
,
nID'
)
f
(
Zero
)
(
d
,(
pID
,
nID
))
=
(
d
<>
n
(
"Ø"
)
nID
pID
"shape=doublecircle"
,
nID
+
1
)
in_negation_normal_form
::
(
Expr
a
)
->
Bool
in_negation_normal_form
(
Node
_
)
=
True
in_negation_normal_form
(
Neg
(
Node
_
))
=
True
in_negation_normal_form
(
Neg
_
)
=
False
in_negation_normal_form
(
Code
x
)
=
in_negation_normal_form
x
in_negation_normal_form
(
Alt
x
)
=
all
in_negation_normal_form
x
in_negation_normal_form
(
Seq
x
)
=
all
in_negation_normal_form
x
-- $> main
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment