Skip to content

Commit

Permalink
kore: getReturnSort: Case of \mu, \or, \and
Browse files Browse the repository at this point in the history
  • Loading branch information
nishantjr committed May 6, 2020
1 parent 9a16be7 commit 635445f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
22 changes: 22 additions & 0 deletions prover/lang/kore-lang.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,28 @@ module KORE-HELPERS
rule [[ getReturnSort( R ( ARGS ) ) => S ]]
<declaration> symbol R ( _ ) : S </declaration>
rule getReturnSort(\mu _ . Phi) => getReturnSort(Phi)
rule getReturnSort(\or(P, Ps)) => unionSort(getReturnSort(P), getReturnSort(\or(Ps)))
rule getReturnSort(\or(.Patterns)) => BottomSort
rule getReturnSort(\and(P, Ps)) => intersectSort(getReturnSort(P), getReturnSort(\and(Ps)))
rule getReturnSort(\and(.Patterns)) => TopSort
rule getReturnSort(_:SetVariable) => TopSort
syntax Sort ::= "TopSort" [token]
| "BottomSort" [token]
syntax Sort ::= unionSort(Sort, Sort) [function]
rule unionSort(TopSort, S) => TopSort
rule unionSort(S, TopSort) => TopSort
rule unionSort(BottomSort, S) => S
rule unionSort(S, BottomSort) => S
syntax Sort ::= intersectSort(Sort, Sort) [function]
rule intersectSort(TopSort, S) => S
rule intersectSort(S, TopSort) => S
rule intersectSort(BottomSort, S) => BottomSort
rule intersectSort(S, BottomSort) => BottomSort
syntax Bool ::= isUnfoldable(Symbol) [function]
rule [[ isUnfoldable(S:Symbol) => true ]]
<declaration> axiom _ : \forall {_} \iff-lfp(S(_), _) </declaration>
Expand Down
6 changes: 3 additions & 3 deletions prover/t/ltl/until-implies-eventually.kore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
symbol next(State) : State
symbol next(TopSort) : TopSort

// there is always a next state
axiom inf: next(\top())
Expand All @@ -7,8 +7,8 @@ axiom inf: next(\top())
axiom lin: \implies(next(#X), \not(next(\not(#X))))

// phi1 U phi2 => []phi2
claim \implies( \mu #X . \or(PHI2, \and(PHI1, next(#X)))
, \mu #X . \or(PHI2, next(#X))
claim \implies( \mu #X . \or(#PHI2, \and(#PHI1, next(#X)))
, \mu #X . \or(#PHI2, next(#X))
)

/*
Expand Down

0 comments on commit 635445f

Please sign in to comment.