# Comparing s(CASP) models

**URL:** <https://swi-prolog.discourse.group/t/comparing-s-casp-models/4606>\
**Category:** General\
**Created:** [October 28, 2021, 10:54am UTC](https://swi-prolog.discourse.group/t/comparing-s-casp-models/4606 "2021-10-28T10:54:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam.neaves](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/sam.neaves/32/967_2.png) [@sam.neaves](https://swi-prolog.discourse.group/u/sam.neaves)\
**Post date:** [October 28, 2021, 10:54am UTC](https://swi-prolog.discourse.group/t/comparing-s-casp-models/4606/1 "2021-10-28T10:54:30Z")

</div>

Using SWISH:

[https://swish.swi-prolog.org/p/CrbJNPtp.swinb](https://swish.swi-prolog.org/p/CrbJNPtp.swinb)

```prolog
:- use_module(library(scasp)).
p:-q.

q :- not notq.
notq :- not q.

```

I can ask for the model for a query or its negation like so:

```prolog
?-scasp(p),scasp_model(M).
M = [not notq, p, q]

?-scasp(not p), scasp_model(M2).
M2 = [notq, not p, not q]

```

But how would I query both models to be able to compare them?

```prolog
?- scasp(p),scasp_model(M),scasp(not p), scasp_model(M2).
scasp_stack:justification_tree/3: Deterministic procedure scasp_stack:justification_tree/3 failed

```

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [October 28, 2021, 12:02pm UTC](https://swi-prolog.discourse.group/t/comparing-s-casp-models/4606/2 "2021-10-28T12:02:28Z")

</div>

At the moment all I can imagine is

```prolog
?- findall(M, ( scasp(p),scasp_model(M) ; scasp(not p), scasp_model(M)), [M,M2]).

```

Conjunction of scasp/1 queries is still a bit unsettled territory.

---

<div class="post-metadata">

**Author:** ![sam.neaves](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/sam.neaves/32/967_2.png) [@sam.neaves](https://swi-prolog.discourse.group/u/sam.neaves)\
**Post date:** [October 28, 2021, 12:25pm UTC](https://swi-prolog.discourse.group/t/comparing-s-casp-models/4606/3 "2021-10-28T12:25:57Z")

</div>

ok good to know 🙂 Thanks!
