Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Iris
RefinedC
Commits
02c3ff05
Commit
02c3ff05
authored
Jun 09, 2021
by
Michael Sammler
Browse files
Reduce closed terms of type Z
parent
02b5f99e
Pipeline
#48436
passed with stage
in 21 minutes and 22 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Sidebyside
theories/lithium/base.v
View file @
02c3ff05
...
...
@@ 47,6 +47,21 @@ Ltac get_head e :=

_
=>
constr
:
(
e
)
end
.
(* Checks that a term is closed using a trick by Jason Gross. *)
Ltac
check_closed
t
:
=
assert_succeeds
(
let
x
:
=
fresh
"x"
in
exfalso
;
pose
t
as
x
;
revert
x
;
repeat
match
goal
with
H
:
_

_
=>
clear
H
end
;
lazymatch
goal
with
H
:
_

_
=>
fail

_
=>
idtac
end
).
Tactic
Notation
"reduce_closed"
constr
(
x
)
:
=
check_closed
x
;
let
r
:
=
eval
vm_compute
in
x
in
change_no_check
x
with
r
in
*
.
Definition
Z_of_bool
(
b
:
bool
)
:
Z
:
=
if
b
then
1
else
0
.
Typeclasses
Opaque
Z_of_bool
.
...
...
theories/lithium/solvers.v
View file @
02c3ff05
...
...
@@ 162,10 +162,23 @@ Ltac enrich_context :=
Ltac
solve_goal_prepare_tac
:
=
idtac
.
Ltac
solve_goal_normalized_prepare_tac
:
=
idtac
.
Local
Open
Scope
Z_scope
.
Ltac
reduce_closed_Z_tac
:
=
idtac
.
Ltac
reduce_closed_Z
:
=
idtac
;
reduce_closed_Z_tac
;
repeat
match
goal
with


context
[
?a
≪
?b
]
=>
progress
reduce_closed
(
a
≪
b
)

H
:
context
[
?a
≪
?b
]

_
=>
progress
reduce_closed
(
a
≪
b
)


context
[
?a
≫
?b
]
=>
progress
reduce_closed
(
a
≫
b
)

H
:
context
[
?a
≫
?b
]

_
=>
progress
reduce_closed
(
a
≫
b
)
end
.
Ltac
solve_goal
:
=
try
fast_done
;
solve_goal_prepare_tac
;
normalize_and_simpl_goal
;
solve_goal_normalized_prepare_tac
;
enrich_context
;
solve_goal_normalized_prepare_tac
;
reduce_closed_Z
;
enrich_context
;
repeat
case_bool_decide
=>
//
;
repeat
case_decide
=>
//
;
repeat
case_match
=>
//
;
refined_solver
lia
.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment