Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cool
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hans-Peter Deifel
cool
Commits
123bbbec
Commit
123bbbec
authored
11 years ago
by
daniel
Browse files
Options
Downloads
Patches
Plain Diff
can now have top-level conjunctions and disjunctions
parent
156d3986
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
randcool/randcool.hs
+27
-5
27 additions, 5 deletions
randcool/randcool.hs
with
27 additions
and
5 deletions
randcool/randcool.hs
+
27
−
5
View file @
123bbbec
...
@@ -86,6 +86,8 @@ data RandConf
...
@@ -86,6 +86,8 @@ data RandConf
,
minDis
::
Nat
-- min number of disjuncts per disjunction (0 allows for Bot)
,
minDis
::
Nat
-- min number of disjuncts per disjunction (0 allows for Bot)
,
maxDis
::
Nat
-- max number of disjuncts per disjunction
,
maxDis
::
Nat
-- max number of disjuncts per disjunction
,
probAt
::
Float
-- probability of having an atom
,
probAt
::
Float
-- probability of having an atom
,
topCon
::
Bool
-- allow conjunctions at the top level
,
topDis
::
Bool
-- allow disjunctions at the top level
}
}
...
@@ -114,19 +116,30 @@ someFormula modGen conf = go (depth conf)
...
@@ -114,19 +116,30 @@ someFormula modGen conf = go (depth conf)
lits
lits
=
let
as
=
[
1
..
1
+
numAts
conf
]
in
[
top
,
bot
]
++
map
PAt
as
++
map
NAt
as
=
let
as
=
[
1
..
1
+
numAts
conf
]
in
[
top
,
bot
]
++
map
PAt
as
++
map
NAt
as
juncts
junct_type
r
=
\
f
->
do
n
<-
inRange
r
junct_type
<$>
exactly
n
f
formulaOfDepth
d
formulaOfDepth
d
=
do
(
m
,
junct
,
r
)
<-
oneOf
[(
Dia
,
Con
,
(
minCon
conf
,
maxCon
conf
))
=
do
(
diabox
,
xx
junct
s
)
<-
oneOf
[(
Dia
,
Con
`
juncts
`
(
minCon
conf
,
maxCon
conf
))
,(
Box
,
Dis
,
(
minDis
conf
,
maxDis
conf
))]
,(
Box
,
Dis
`
juncts
`
(
minDis
conf
,
maxDis
conf
))]
n
<-
inRange
r
diabox
<$>
modGen
<*>
xxjuncts
(
go
d
)
m
<$>
modGen
<*>
(
junct
<$>
exactly
n
(
go
d
))
p
=
max
0
$
min
1
$
probAt
conf
p
=
max
0
$
min
1
$
probAt
conf
go
d
go
d
|
d
==
0
|
d
==
0
=
oneOf
lits
=
oneOf
lits
|
d
==
depth
conf
|
d
==
depth
conf
=
formulaOfDepth
(
d
-
1
)
=
let
modal_form
=
formulaOfDepth
(
d
-
1
)
in
join
$
oneOf
$
concat
[
[
modal_form
]
,
[
Con
`
juncts
`
(
minCon
conf
,
maxCon
conf
)
$
modal_form
|
topCon
conf
]
,
[
Dis
`
juncts
`
(
minDis
conf
,
maxDis
conf
)
$
modal_form
|
topDis
conf
]
]
|
otherwise
|
otherwise
=
join
$
fromFreqs
[
oneOf
lits
`
withFreq
`
p
=
join
$
fromFreqs
[
oneOf
lits
`
withFreq
`
p
,
formulaOfDepth
(
d
-
1
)
`
withFreq
`
(
1
-
p
)]
,
formulaOfDepth
(
d
-
1
)
`
withFreq
`
(
1
-
p
)]
...
@@ -252,6 +265,15 @@ randConf
...
@@ -252,6 +265,15 @@ randConf
<>
help
"Probability of an atom occurring instead of a modality"
<>
help
"Probability of an atom occurring instead of a modality"
<>
showDefault
<>
showDefault
)
)
<*>
flag
True
False
(
long
"no-toplevel-conj"
<>
help
"Don't generate conjunctions at the top-level"
)
<*>
flag
True
False
(
long
"no-toplevel-disj"
<>
help
"Don't generate disjunctions at the top-level"
)
...
...
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