Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
i7
peregrine
Commits
c3f3c6f4
Commit
c3f3c6f4
authored
Aug 08, 2018
by
Philipp Meyer
Browse files
Small rewrite
parent
2f387156
Changes
2
Show whitespace changes
Inline
Side-by-side
src/Property.hs
View file @
c3f3c6f4
...
...
@@ -95,10 +95,10 @@ eliminateModulo' n makeVar (Equation lhs (ModEq m) rhs) =
let
k
=
makeVar
n
in
(
Equation
lhs
Eq
(
rhs
:+:
((
Const
m
)
:*:
(
Var
k
))),
[
k
])
eliminateModulo'
n
makeVar
(
Equation
lhs
(
ModNe
m
)
rhs
)
=
let
j
=
makeVar
(
n
+
1
)
k
=
makeVar
n
let
j
=
makeVar
n
k
=
makeVar
(
n
+
1
)
in
((
Equation
lhs
Eq
(
rhs
:+:
((
Var
j
)
:+:
((
Const
m
)
:*:
(
Var
k
)))))
:&:
(
Equation
(
Const
0
)
Lt
(
Var
j
))
:&:
(
Equation
(
Var
j
)
Lt
(
Const
m
)),
[
k
,
j
])
(
Equation
(
Const
0
)
Lt
(
Var
j
))
:&:
(
Equation
(
Var
j
)
Lt
(
Const
m
)),
[
j
,
k
])
eliminateModulo'
n
makeVar
(
g
:|:
h
)
=
let
(
g'
,
ag
)
=
eliminateModulo'
n
makeVar
g
(
h'
,
ah
)
=
eliminateModulo'
(
n
+
length
ag
)
makeVar
h
...
...
src/Solver/Formula.hs
View file @
c3f3c6f4
...
...
@@ -23,6 +23,8 @@ opToFunction Eq = (.==)
opToFunction
Ne
=
(
./=
)
opToFunction
Le
=
(
.<=
)
opToFunction
Lt
=
(
.<
)
opToFunction
(
ModEq
_
)
=
error
"symbolic modulo not supported"
opToFunction
(
ModNe
_
)
=
error
"symbolic modulo not supported"
evaluateFormula
::
(
Ord
a
,
Show
a
)
=>
Formula
a
->
SIMap
a
->
SBool
evaluateFormula
FTrue
_
=
true
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment