Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions prover/prover.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ module STRATEGIES-EXPORTED-SYNTAX
| "direct-proof"
| "check-lhs-constraint-unsat"
| "smt" | "smt-z3" | "smt-cvc4" | "smt-debug"
| "just-left-unfold-Nth" "(" Int ")"
| "just-right-unfold-Nth" "(" Int ")"
| "left-unfold" | "left-unfold-Nth" "(" Int ")"
| "right-unfold" | "right-unfold-Nth" "(" Int "," Int ")" | "right-unfold" "(" Symbol ")"
| "right-unfold-all" "(" "bound" ":" Int ")"
Expand Down
57 changes: 57 additions & 0 deletions prover/strategies/unfolding.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,63 @@ module STRATEGY-UNFOLDING
=> getUnfoldables(P) ++Patterns getUnfoldables(REST)
```

### Just Right Unfold

```k

rule <strategy> just-right-unfold-Nth(M)
=> just-right-unfold-Nth-#1(M, getUnfoldables(RHS))
...
</strategy>
<claim> \implies(\and(LHS), RHS) </claim>

syntax Strategy ::= "just-right-unfold-Nth-#1" "(" Int "," Patterns ")"
| "just-right-unfold-Nth-#2" "(" Pattern "," Pattern ")"


rule <strategy> just-right-unfold-Nth-#1(M, PS)
=> just-right-unfold-Nth-#2(getMember(M, PS), unfold(getMember(M, PS)))
...
</strategy>
requires 0 <=Int M andBool M <Int getLength(PS)

rule <claim> \implies(LHS, RHS => subst(RHS, PATTERN, BODY)) </claim>
<strategy> just-right-unfold-Nth-#2(PATTERN, BODY)
=> noop
...
</strategy>
```


### Just Left Unfold Nth

Just unfolds the Nth predicate on the LHS.

```k
rule <strategy> just-left-unfold-Nth(M)
=> just-left-unfold-Nth-#1(M, getUnfoldables(LHS))
...
</strategy>
<claim> \implies(\and(LHS), RHS) </claim>

syntax Strategy ::= "just-left-unfold-Nth-#1" "(" Int "," Patterns ")"
| "just-left-unfold-Nth-#2" "(" Pattern "," Pattern ")"


rule <strategy> just-left-unfold-Nth-#1(M, PS)
=> just-left-unfold-Nth-#2(getMember(M, PS), unfold(getMember(M, PS)))
...
</strategy>
requires 0 <=Int M andBool M <Int getLength(PS)

rule <claim> \implies(LHS => subst(LHS, PATTERN, BODY), RHS) </claim>
<strategy> just-left-unfold-Nth-#2(PATTERN, BODY)
=> noop
...
</strategy>

```

### Left Unfold (incomplete)

```k
Expand Down